始める無料で始める

ロジスティック回帰による予測

線形回帰と同様に、ロジスティック回帰の魅力は予測ができることです。もう一度、予測の流れを順番に確認していきましょう。

churn と mdl_churn_vs_both_inter は使用できる状態になっています。また、itertools.product も読み込み済みです。

この演習はコースの一部です

statsmodels を使った中級 Regression

コースを見る

実践的なインタラクティブ演習

このサンプルコードを完成させて、この演習に挑戦してみましょう。

# 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)
コードを編集して実行