business_case_solver_without_classes.py 文件源码

python
阅读 22 收藏 0 点赞 0 评论 0

项目:themarketingtechnologist 作者: thomhopmans 项目源码 文件源码
def predict_probabilities(logistic_regression_results):
    # Predict the conversion probability for 0 up till 50 pageviews
    X = sm.add_constant(range(0, 50))
    y_hat = logistic_regression_results.predict(X)
    df_hat = pd.DataFrame(zip(X[:, 1], y_hat))
    df_hat.columns = ['X', 'y_hat']
    p_conversion_25_pageviews = df_hat.ix[25]['y_hat']
    print("")
    print("The probability of converting after 25 pageviews is {}".format(p_conversion_25_pageviews))
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号