Skip to content

Instantly share code, notes, and snippets.

Embed
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]])
df_s.head()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment