concept csv file in category deep learning

appears as: CSV file, CSV files
Deep Learning with JavaScript: Neural networks in TensorFlow.js

This is an excerpt from Manning's book Deep Learning with JavaScript: Neural networks in TensorFlow.js.

The data has been presplit by randomly assigning samples into training and testing portions. About two-thirds of the samples are in the training split, and the remaining one-third are reserved for independently evaluating the trained model. Additionally, for each split, the target feature has been separated into a CSV file apart from the other features, resulting in the four file names listed in table 2.2.

Creating a tf.data.Dataset from a CSV file

A very common type of dataset element is a key-value object representing one row of a table, such as one row of a CSV file. The next listing shows a very simple program that will connect to and list out the Boston-housing dataset, the one we first used in chapter 2.

Listing 6.2. Building a tf.data.Dataset from a CSV file
  const myURL =
      "https://storage.googleapis.com/tfjs-examples/" +
          "multivariate-linear-regression/data/train-data.csv";
  const myCSVDataset = tf.data.csv(myURL);                       #1
  await myCSVDataset.forEachAsync(e => console.log(e));          #2

// Yields output of 333 rows like
// {crim: 0.327, zn: 0, indus: 2.18, chas: 0, nox: 0.458, rm: 6.998,
// age: 45.8, tax: 222}
// ...

Instead of tf.data.array(), here we use tf.data.csv() and point to a URL of a CSV file. This will create a dataset backed by the CSV file, and iterating over the dataset will iterate over the CSV rows. In Node.js, we can connect to a local CSV file by using a URL handle with the file:// prefix, like the following: