title: Feeding integer CSV data to a Keras Dense first layer in sequential model
body: <p>The documentation for <a href="https://www.tensorflow.org/guide/data#consuming_csv_data" rel="nofollow noreferrer">CSV Datasets</a> stops short of showing how to use a CSV dataset for anything practical like using the data to train a neural network. Can anyone provide a straightforward example to demonstrate how to do this, with clarity around data shape and type issues at a minimum, and preferably considering batching, shuffling, repeating over epochs as well?</p>
  
  <p>For example, I have a CSV file of <code>M</code> rows, each row being an integer class label followed by <code>N</code> integers from which I hope to predict the class label using an old-style 3-layer neural network with <code>H</code> hidden neurons:</p>
  
  <pre><code>model = Sequential()
  model.add(Dense(H, activation='relu', input_dim=N))
  ...
  model.fit(train_ds, ...)
  </code></pre>
  
  <p>For my data, <code>M &gt; 50000</code> and <code>N &gt; 200</code>. I have tried creating my dataset by using:</p>
  
  <pre><code>train_ds = tf.data.experimental.make_csv_dataset('mydata.csv`, batch_size=B)
  </code></pre>
  
  <p>However... this leads to compatibility problems between the dataset and the model... but it's not clear where these compatibility problems lie - are they in the input shape, the integer (not float) data, or somewhere else?</p>