function normalizeDataset(
    dataset, isTrainData = true, vectorMeans = [], vectorStddevs = []) {
      const numFeatures = dataset[0].length;
      let vectorMean;
      let vectorStddev;

      for (let i = 0; i < numFeatures; i++) {
        const vector = dataset.map(row => row[i]);

        if (isTrainData) {
          vectorMean = mean(vector);
          vectorStddev = stddev(vector);

          vectorMeans.push(vectorMean);
          vectorStddevs.push(vectorStddev);
        } else {
          vectorMean = vectorMeans[i];
          vectorStddev = vectorStddevs[i];
        }

        const vectorNormalized =
            normalizeVector(vector, vectorMean, vectorStddev);

        vectorNormalized.forEach((value, index) => {
          dataset[index][i] = value;
        });
      }

      return {dataset, vectorMeans, vectorStddevs};
    }
Normalizes the dataset

@param {Array} dataset Dataset to be normalized.
@param {boolean} isTrainData Whether it is training data or not.
@param {Array} vectorMeans Mean of each column of dataset.
@param {Array} vectorStddevs Standard deviation of each column of dataset.

@returns {Object} Contains normalized dataset, mean of each vector column,
                  standard deviation of each vector column.