Usually, when we use neural networks, we get improved performance when we standardize the data. Standardization just means normalizing the values so that they all fit between a certain range, such as 0 to 1 or -1 to +1.
There is one more way to normalize the data: by using mean and standard deviations. The normalization function in the following code can standardize the data for better performance:
In[23]: def normalization(x): return (x - train_stats['mean']) / train_stats['std'] In[24]: normed_train_data = normalization(train_dataset) In[25]: normed_test_data = normalization(test_dataset)