Seasonality

Predictive Analytics Tingkat Menengah dengan Python

Nele Verbiest

Senior Data Scientist @PythonPredictions

Seasonal effects (1)

Predictive Analytics Tingkat Menengah dengan Python

Seasonal effects (2)

Mean number of donations

Predictive Analytics Tingkat Menengah dengan Python

Seasonal effects (3)

Mean donation amount

Predictive Analytics Tingkat Menengah dengan Python

Seasonality and the timeline (1)

Predictive Analytics Tingkat Menengah dengan Python

Seasonality and the timeline (2)

Predictive Analytics Tingkat Menengah dengan Python

Seasonality and the timeline (3)

Predictive Analytics Tingkat Menengah dengan Python

Dealing with seasonality

  • Check for seasonality
gifts.groupby("month")["amount"].mean()
gifts.groupby("month").size()
  • Use appropriate timeline in history

Predictive Analytics Tingkat Menengah dengan Python

Seasonality and predictive models

Model timeline May 2018

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

Model timeline January 2018

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
Predictive Analytics Tingkat Menengah dengan Python

Let's practice!

Predictive Analytics Tingkat Menengah dengan Python

Preparing Video For Download...