Created
January 10, 2018 17:40
-
-
Save dipanjanS/6633de554e89783aef62aef4107793a4 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
# Scaling attribute values to avoid few outiers | |
cols = ['density', 'residual sugar', 'total sulfur dioxide', 'fixed acidity'] | |
subset_df = wines[cols] | |
from sklearn.preprocessing import StandardScaler | |
ss = StandardScaler() | |
scaled_df = ss.fit_transform(subset_df) | |
scaled_df = pd.DataFrame(scaled_df, columns=cols) | |
final_df = pd.concat([scaled_df, wines['wine_type']], axis=1) | |
final_df.head() | |
# plot parallel coordinates | |
from pandas.plotting import parallel_coordinates | |
pc = parallel_coordinates(final_df, 'wine_type', color=('#FFE888', '#FF9999')) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment