Seasonality

Intermediate Predictive Analytics in Python

Nele Verbiest

Senior Data Scientist @PythonPredictions

Seasonal effects (1)

Intermediate Predictive Analytics in Python

Seasonal effects (2)

Mean number of donations

Intermediate Predictive Analytics in Python

Seasonal effects (3)

Mean donation amount

Intermediate Predictive Analytics in Python

Seasonality and the timeline (1)

Intermediate Predictive Analytics in Python

Seasonality and the timeline (2)

Intermediate Predictive Analytics in Python

Seasonality and the timeline (3)

Intermediate Predictive Analytics in Python

Dealing with seasonality

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

Intermediate Predictive Analytics in 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
Intermediate Predictive Analytics in Python

Let's practice!

Intermediate Predictive Analytics in Python

Preparing Video For Download...