async function getBaselineMeanAbsoluteError(
    jenaWeatherData, normalize, includeDateTime, lookBack, step, delay) {
  const batchSize = 128;
  const dataset = tf.data.generator(
      () => jenaWeatherData.getNextBatchFunction(
          false, lookBack, delay, batchSize, step, VAL_MIN_ROW, VAL_MAX_ROW,
          normalize, includeDateTime));

  const batchMeanAbsoluteErrors = [];
  const batchSizes = [];
  await dataset.forEachAsync(dataItem => {
    const features = dataItem.xs;
    const targets = dataItem.ys;
    const timeSteps = features.shape[1];
    batchSizes.push(features.shape[0]);
    batchMeanAbsoluteErrors.push(tf.tidy(
        () => tf.losses.absoluteDifference(
            targets,
            features.gather([timeSteps - 1], 1).gather([1], 2).squeeze([2]))));
  });

  const meanAbsoluteError = tf.tidy(() => {
    const batchSizesTensor = tf.tensor1d(batchSizes);
    const batchMeanAbsoluteErrorsTensor = tf.stack(batchMeanAbsoluteErrors);
    return batchMeanAbsoluteErrorsTensor.mul(batchSizesTensor)
        .sum()
        .div(batchSizesTensor.sum());
  });
  tf.dispose(batchMeanAbsoluteErrors);
  return meanAbsoluteError.dataSync()[0];
}
Calculate the commonsense baseline temperture-prediction accuracy.

The latest value in the temperature feature column is used as the
prediction.

@param {boolean} normalize Whether to used normalized data for training.
@param {boolean} includeDateTime Whether to include date and time features
  in training.
@param {number} lookBack Number of look-back time steps.
@param {number} step Step size used to generate the input features.
@param {number} delay How many steps in the future to make the prediction
  for.
@returns {number} The mean absolute error of the commonsense baseline
  prediction.