business_case_solver.py 文件源码

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

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


问题


面经


文章

微信
公众号

扫码关注公众号