Probabilities
There are four main ways of expressing the prediction from a logistic regression model – we'll look at each of them over the next four exercises. Firstly, since the response variable is either "yes" or "no", you can make a prediction of the probability of a "yes". Here, you'll calculate and visualize these probabilities.
Two variables are available:
mdl_churn_vs_relationshipis the fitted logistic regression model ofhas_churnedversustime_since_first_purchase.explanatory_datais a DataFrame of explanatory values.
Bu egzersiz
Introduction to Regression with statsmodels in Python
kursunun bir parçasıdırUygulamalı interaktif egzersiz
Bu örnek kodu tamamlayarak bu egzersizi bitirin.
# Create prediction_data
prediction_data = explanatory_data.assign(
____
)
# Print the head
print(____)