Skip to content

Instantly share code, notes, and snippets.

@yuyasugano
Created November 12, 2020 12:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save yuyasugano/fae48a1a67209d58cbfeda0f2fdab63e to your computer and use it in GitHub Desktop.
Save yuyasugano/fae48a1a67209d58cbfeda0f2fdab63e to your computer and use it in GitHub Desktop.
What are standarization and normalization? Test with iris data set in Scikit-learn
# apply MinMaxScaler for iris data set, [0, 1] for the range
from sklearn.preprocessing import MinMaxScaler
df_n = df.copy()
min_max_scaler = MinMaxScaler()
df_n.iloc[:, [0, 1, 2, 3]] = min_max_scaler.fit_transform(df_n.iloc[:, [0, 1, 2, 3]])
df_n.head()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment