科学の箱

科学・IT・登山の話題

Python

SIGNATE お弁当の需要予測-4

投稿日:2018年5月17日 更新日:

今回はSeabornのpairplotを利用して相関の概要を見てみる。ただし相関を見るためにはデータのクレンジングが必要。

まずはnullデータのヒートマップを確認してみる。


sns.heatmap(d_train.isnull(),yticklabels=False,cbar=False,cmap='viridis')

次にデータのクレンジング


d_train_w=d_train.fillna({'kcal':0})
d_train_w = d_train_w.drop('event', axis=1)
d_train_w = d_train_w.drop('remarks', axis=1)
d_train_w = d_train_w.drop('precipitation', axis=1)
d_train_w = d_train_w.drop('name', axis=1)
d_train_w = d_train_w.drop('payday', axis=1)

データのフォーマット確認


d_train_w.head()

もう一度ヒートマップで確認


sns.heatmap(d_train_w.isnull(),yticklabels=False,cbar=False,cmap='viridis')

ペアプロット作成

sns.pairplot(d_train_w)
sns.pairplot(d_train_w, hue='weather')

 

 

メタ情報

inarticle



メタ情報

inarticle



-Python
-,

執筆者:


comment

メールアドレスが公開されることはありません。 * が付いている欄は必須項目です

関連記事

no image

cp932 error

pythonで入力ファイルにおける文字コードが正しく認識されない場合、以下のようなエラーがでる。 UnicodeDecodeError: ‘cp932’ codec can&# …

no image

kaggle Titanic Tutorial – 1

KaggleでTitanic tutorialにチャレンジしてみる。 Titanic: Machine Learning from Disaster https://www.kaggle.com/c/ …

no image

dataframeのgroupbyで使えるメソッド

Dataframeでgroupby経由で使宇メソッド。基礎統計で大事そうなものだけを記載。 mean() sum() std() count() max(), min() describe() Rel …

no image

Pythonで文字列を生成するときの方法についてまとめる

Pythonで文字列を生成するときには様々な方法があるのでまとめる。 まず最も基本となるのは生成したい文字をシングルクォーテーションもしくはダブルクォーテーションで囲む方法である。どちらの方法を使って …

no image

pipインストールでエラーが出る場合

pipインストールでエラーが出る場合 Collecting tensorflow WARNING: Retrying (Retry(total=4, connect=None, read=None, …

2018年5月
« 4月   6月 »
 123456
78910111213
14151617181920
21222324252627
28293031  

side bar top



アーカイブ

カテゴリー