季節性

Pythonで学ぶ中級予測分析

Nele Verbiest

Senior Data Scientist @PythonPredictions

季節効果 (1)

Pythonで学ぶ中級予測分析

季節効果 (2)

寄付件数の平均

Pythonで学ぶ中級予測分析

季節効果 (3)

平均寄付金額

Pythonで学ぶ中級予測分析

季節性とタイムライン (1)

Pythonで学ぶ中級予測分析

季節性とタイムライン (2)

Pythonで学ぶ中級予測分析

季節性とタイムライン (3)

Pythonで学ぶ中級予測分析

季節性への対処

  • 季節性を確認する
gifts.groupby("month")["amount"].mean()
gifts.groupby("month").size()
  • 履歴に適切なタイムラインを使用する

Pythonで学ぶ中級予測分析

季節性と予測モデル

モデルのタイムライン:2018年5月

logreg = linear_model.LogisticRegression()
logreg.fit(X_may2018, y_may2018)

predictions = logreg.predict_proba(X_jan2019)[:,1] auc = roc_auc_score(y_jan2019, predictions) print(round(auc,2))
0.53

モデルのタイムライン:2018年1月

logreg = linear_model.LogisticRegression()
logreg.fit(X_jan2018, y_jan2018)

predictions = logreg.predict_proba(X_jan2019)[:,1] auc = roc_auc_score(y_jan2019, predictions) print(round(auc,2))
0.56
Pythonで学ぶ中級予測分析

練習しましょう!

Pythonで学ぶ中級予測分析

Preparing Video For Download...