Skip to content

Instantly share code, notes, and snippets.

@Mehdi-Amine
Created April 21, 2020 15:33
Show Gist options
  • Save Mehdi-Amine/4cc3780057f37b63b4218863a514241c to your computer and use it in GitHub Desktop.
Save Mehdi-Amine/4cc3780057f37b63b4218863a514241c to your computer and use it in GitHub Desktop.
from sklearn.preprocessing import MinMaxScaler
norm_scaler = MinMaxScaler()
dx_train_normalized_sklearn = norm_scaler.fit_transform(dx_train)
# Printing the first 5 rows
print(f"Training data normalized using Scikit-Learn: \n{dx_train_normalized_sklearn[:5]}")
'''
Out:
Training data normalized using Scikit-Learn:
[[0.3 0.95]
[0.7 0.5 ]
[0.35 1. ]
[0.3 0.9 ]
[0.5 0.5 ]]
'''
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment