LoslegenKostenlos loslegen

The effect of seasonality

Assume you want to predict whether a candidate donor will donate next month. As predictive variable, you want to include the maximum gift of each donor in the previous month. As you learned in the video, the mean amount of the gifts in July and September are similar, but the gifts are fairly higher in December. In this exercise, you will see how this can influence the performance of your model.

The logistic regression model is created and fitted for you in logreg on the data in July.

Diese Übung ist Teil des Kurses

Intermediate Predictive Analytics in Python

Kurs anzeigen

Interaktive Übung

Versuche dich an dieser Übung, indem du diesen Beispielcode vervollständigst.

# AUC of model in July:
predictions = logreg.____(test_july[["age", "max_amount"]])[:,1]
auc = ____(test_july["target"], predictions)
print(auc)
Code bearbeiten und ausführen