How it works...

This section explains how the height and weight are normalized.

  1. The data_array matrix is split into two matrices:
    1. X is composed of the height and the weight
    2. y is composed of the gender
  1. The output of both arrays can be seen in the following screenshot:
  1. The X component is the input and is the only part that will undergo the normalization process. The y component, or the gender, will be disregarded for the moment. The normalization process involves extracting the mean and standard deviation of both inputs for all 29 individuals. The output of the mean and standard deviations for the height and weight can be seen in the following screenshot:

  1. The mean of the height is ~67 inches and the standard deviation of the height is ~3.4 inches. The mean of the weight is ~145 lbs and the standard deviation of the weight is ~22 lbs.
  1. Once they are extracted, the inputs are normalized using the following equation: X_norm = (X - X_mean)/X_std.

  2. The X array is normalized using the Python function normalize() and the X array is now assigned to the values of the newly minted normalized set, as seen in the following screenshot: