Logistic 回归预测
与线性回归一样,Logistic 回归的妙处在于可以进行预测。让我们再走一遍预测流程!
churn 和 mdl_churn_vs_both_inter 已可用;已加载 itertools.product。
本练习是课程的一部分
Python 中级回归:使用 statsmodels
交互式实操练习
通过完成这段示例代码来试试这个练习。
# Create time_since_first_purchase
time_since_first_purchase = ____
# Create time_since_last_purchase
time_since_last_purchase = ____
# Create p as all combinations of values of time_since_first_purchase and time_since_last_purchase
p = ____
# Transform p to a DataFrame and name the columns
explanatory_data = ____
# Print the result
print(explanatory_data)