from sklearn.preprocessing import StandardScaler
import numpy as np
import matplotlib.pyplot as mlt
import seaborn as sb
precipitation = { 'rain': 0, 'snow': 1}
train['precip_type'][train['precip_type'] == 'rain'] =0
train['precip_type'][train['precip_type'] == 'snow'] =1
stdsclr = StandardScaler()
transf = stdsclr.fit_transform(train.values)
cov_mat = np.cov(transf.T)
mlt.figure(figsize=(12,12))
hm = sb.heatmap(cov_mat,
annot=True,
annot_kws={'size': 10},
cmap='coolwarm',
yticklabels=train.columns ,
xticklabels=train.columns)
mlt.show()
"""
there is insignificancy in wind_speed, cloud_cover, pressure and wind_bearing since they are not correlated
"""
C:\Users\Admin\anaconda3\lib\site-packages\ipykernel_launcher.py:7: SettingWithCopyWarning: A value is trying to be set on a copy of a slice from a DataFrame
See the caveats in the documentation: https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy import sys C:\Users\Admin\anaconda3\lib\site-packages\pandas\core\generic.py:8767: SettingWithCopyWarning: A value is trying to be set on a copy of a slice from a DataFrame
See the caveats in the documentation: https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy self._update_inplace(new_data) C:\Users\Admin\anaconda3\lib\site-packages\ipykernel_launcher.py:8: SettingWithCopyWarning: A value is trying to be set on a copy of a slice from a DataFrame
See the caveats in the documentation: https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy