Skip to content

Instantly share code, notes, and snippets.

@AI-MOO
Created February 28, 2022 15:51
Show Gist options
  • Save AI-MOO/456a7807c69d010656dfd7925c902bf0 to your computer and use it in GitHub Desktop.
Save AI-MOO/456a7807c69d010656dfd7925c902bf0 to your computer and use it in GitHub Desktop.
categorical_val.remove('target')
dataset = pd.get_dummies(df, columns = categorical_val)
from sklearn.preprocessing import StandardScaler
s_sc = StandardScaler()
col_to_scale = ['age', 'trestbps', 'chol', 'thalach', 'oldpeak']
dataset[col_to_scale] = s_sc.fit_transform(dataset[col_to_scale])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment