Created
November 12, 2020 12:15
-
-
Save yuyasugano/7365cef2e8a727502683f7c9e0df0b4a to your computer and use it in GitHub Desktop.
What are standarization and normalization? Test with iris data set in Scikit-learn
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# apply StandardScaler for iris data set, this is z-score normalization | |
from sklearn.preprocessing import StandardScaler | |
df_s = df.copy() | |
std_scaler = StandardScaler() | |
df_s.iloc[:, [0, 1, 2, 3]] = std_scaler.fit_transform(df_s.iloc[:, [0, 1, 2, 3]]) | |
df_s.head() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment