concept Boston - housing datum in category deep learning

appears as: Boston-housing data
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.

This should open a new tab in your browser pointing to a port on localhost, which will run the example. If your browser doesn’t automatically react, you can navigate to the URL output on the command line. Clicking the button labeled Train Linear Regressor will trigger the routine to build a linear model and fit it to the Boston-housing data, and then output an animated graph of the loss on the training and testing datasets after each epoch, as figure 2.11 illustrates.

Listing 2.7. Converting the Boston-housing data to tensors in index.js
// Initialize a BostonHousingDataset object defined in data.js.
const bostonData = new BostonHousingDataset();
const tensors = {};

// Convert the loaded csv data, of type number[][] into 2d tensors.
export const arraysToTensors = () => {
  tensors.rawTrainFeatures = tf.tensor2d(bostonData.trainFeatures);
  tensors.trainTarget = tf.tensor2d(bostonData.trainTarget);
  tensors.rawTestFeatures = tf.tensor2d(bostonData.testFeatures);
  tensors.testTarget = tf.tensor2d(bostonData.testTarget);
}

// Trigger the data to load asynchronously once the page has loaded.
let tensors;
document.addEventListener('DOMContentLoaded', async () => {
  await bostonData.loadData();
  arraysToTensors();
}, false);


!@%STYLE%@!
{"css":"{\"css\": \"font-weight: bold;\"}","target":"[[{\"line\":6,\"ch\":29},{\"line\":6,\"ch\":66}],[{\"line\":7,\"ch\":24},{\"line\":7,\"ch\":59}],[{\"line\":8,\"ch\":28},{\"line\":8,\"ch\":64}],[{\"line\":9,\"ch\":23},{\"line\":9,\"ch\":57}]]"}
!@%STYLE%@!