Seabornの回帰プロット

Seaborn による中級データ可視化

Chris Moffitt

Instructor

regplotの概要

  • regplot関数は回帰直線付きの散布図を生成する
  • 使い方はdisplotと同様
  • data、x、y変数の指定が必要
sns.regplot(data=df, x="alcohol", y="pH" )

散布図

Seaborn による中級データ可視化

lmplot()はregplot()をベースに構築されている

  • regplot - 低レベル
sns.regplot(data=df,
            x="alcohol",
            y="quality")

ワイン品質プロット

  • lmplot - 高レベル
sns.lmplot(data=df, 
           x="alcohol",
           y="quality")

ワイン品質プロット

Seaborn による中級データ可視化

lmplotのファセット

  • 色でデータを整理する(hue)
sns.lmplot(data=df, 
           x="quality",
           y="alcohol",
           hue="type")

hueを使ったワイン品質プロット

  • 列でデータを整理する(col)
sns.lmplot(data=df, 
           x="quality",
           y="alcohol",
           col="type")

列を使ったワイン品質プロット

Seaborn による中級データ可視化

練習しましょう!

Seaborn による中級データ可視化

Preparing Video For Download...