-
-
Save amandaiglesiasmoreno/13502116e5684b853f27296413e0bd68 to your computer and use it in GitHub Desktop.
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
# min-max normalization (numeric variables) | |
min_max_columns = ['tenure', 'MonthlyCharges', 'TotalCharges'] | |
# scale numerical variables using min max scaler | |
for column in min_max_columns: | |
# minimum value of the column | |
min_column = df_telco_transformed[column].min() | |
# maximum value of the column | |
max_column = df_telco_transformed[column].max() | |
# min max scaler | |
df_telco_transformed[column] = (df_telco_transformed[column] - min_column) / (max_column - min_column) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment