科学の箱

科学・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

Python + Slack Bot – 2

Slackのチャネルに投稿するにはChanel IDが必要。 Chanel IDは下記から取得できる。 https://api.slack.com/methods/channels.list/test …

no image

automated the boring – day9

https://automatetheboringstuff.com/chapter17/ >>> from PIL import Image &gt …

no image

janomeで品詞を解析する

  import sys import os from glob import glob from janome.tokenizer import Tokenizer def main(): …

no image

scikit-learnで適切なアルゴリズムを選択するためのチートシート

  http://scikit-learn.org/stable/tutorial/machine_learning_map/index.html Related posts:selecto …

no image

seabornをEDAに応用する

seabornを利用すれば基本となるビジュアルと分布、regressionをすぐに取得できる。 import seaborn as sns tips = sns.load_dataset(‘tips’ …

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

side bar top



アーカイブ

カテゴリー