predictor.py 文件源码

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

项目:kaggle-Kobe-Bryant-Shot-Selection 作者: shiba24 项目源码 文件源码
def randomsearch_xgboost(df):
        param_distributions={'max_depth': sp.stats.randint(1, 11),
                             'subsample': sp.stats.uniform(0.25, 0.75),
                             'colsample_bytree': sp.stats.uniform(0.25, 0.75)
        }
        xgb_model = XGBClassifier()
        rs = RandomizedSearchCV(xgb_model,
                                param_distributions,
                                cv=10,
                                n_iter=20,
                                scoring="log_loss",
                                n_jobs=1,
                                verbose=2)
        rs.fit(train_X, train_y.transpose()[0]) 
        predict = rs.predict_proba(test_X)
        return predict[:, 1]
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号