Skip to content

Instantly share code, notes, and snippets.

Created November 12, 2020 12:15
What would you like to do?
What are standarization and normalization? Test with iris data set in Scikit-learn
# 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]])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment