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.
The scikit-learn library also provides a nice function for this. Click on the following link for more information: http://scikit-learn.org/stable/modules/generated/sklearn.preprocessing.MinMaxScaler.html.
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)
Previously, we performed standardization using mean and standard deviation. In general, it is recommended to normalize the data in one go...