Skip to content

Instantly share code, notes, and snippets.

@lucifermorningstar1305
Created March 29, 2020 11:10
Show Gist options
  • Save lucifermorningstar1305/0c24eec512e4f5941b211529da2734d5 to your computer and use it in GitHub Desktop.
Save lucifermorningstar1305/0c24eec512e4f5941b211529da2734d5 to your computer and use it in GitHub Desktop.
import numpy as np
from sklearn import preprocessing
features = np.array([[-500, 5],
[2, 10],
[4, 100],
[9, 10]])
# Create the MinMax Scaler
minmax_scaler = preprocessing.MinMaxScaler(feature_range=(0,1))
# Apply the MinMax Rescaling on our feature maps
scaled_feature = minmax_scaler.fit_transform(features)
print(scaled_features)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment