Skip to content

Instantly share code, notes, and snippets.

@sgsg704
Created August 24, 2021 06:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sgsg704/313b9128299026659cf96a6a38ec1a20 to your computer and use it in GitHub Desktop.
Save sgsg704/313b9128299026659cf96a6a38ec1a20 to your computer and use it in GitHub Desktop.
features = data.drop(['RainTomorrow', 'Date','day', 'month'], axis=1) # dropping target and extra columns
target = data['RainTomorrow']
#Set up a standard scaler for the features
col_names = list(features.columns)
s_scaler = preprocessing.StandardScaler()
features = s_scaler.fit_transform(features)
features = pd.DataFrame(features, columns=col_names)
features.describe().T
#Detecting outliers
#looking at the scaled features
colours = ["#D0DBEE", "#C2C4E2", "#EED4E5", "#D1E6DC", "#BDE2E2"]
plt.figure(figsize=(20,10))
sns.boxenplot(data = features,palette = colours)
plt.xticks(rotation=90)
plt.show()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment