Validating array for optimal neural network performance
A little bit of validation goes a long way in ensuring that our array is normalized for optimal performance within our upcoming neural network.
Getting ready
This section will require a bit of numpy
magic using the numpy.stack()
function.
How to do it...
The following steps walk through validating that our array has been normalized.
- Execute the following step to print the mean and standard deviation of array inputs:
print('standard deviation') print(round(X[:,0].std(axis=0),0)) print('mean') print(round(X[:,0].mean(axis=0),0))
- Execute the following script to combine height, weight, and gender into one array,
data_array
:
data_array = np.column_stack((X[:,0], X[:,1],y))
How it works...
This section explains how the array is validated and constructed for optimal future use within the neural network.
The new
mean
of the height should be 0 and thestandard deviation
should be 1. This can be seen in the following screenshot:

- This is confirmation of...