Apache Spark Deep Learning Cookbook
上QQ阅读APP看书,第一时间看更新

How it works...

This section explains how the array is validated and constructed for optimal future use within the neural network.

  1. The new mean of the height should be 0 and the standard deviation should be 1. This can be seen in the following screenshot:

  1. This is confirmation of a normalized dataset, as it includes a mean of 0 and a standard deviation of 1.
  2. The original data_array is no longer useful for a neural network because it contains the original, non-normalized, input values for height, weight, and gender.
  3. Nonetheless, with a little bit of numpy magic, data_array can be restructured to include the normalized height and weight, along with gender.  This is done with numpy.stack().   The output of the new array, data_array, can be seen in the following screenshot: