tuning.py 文件源码

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

项目:kaggle-Kobe-Bryant-Shot-Selection 作者: shiba24 项目源码 文件源码
def optimize(self, trials, max_evals=250):
        self.space = {
            "objective": "multi:softprob",
            "eval_metric": "mlogloss",

            #Control complexity of model
            "eta" : hp.quniform("eta", 0.1, 0.3, 0.025),
            "max_depth" : hp.quniform("max_depth", 5, 10, 1),
            "min_child_weight" : hp.quniform('min_child_weight', 5, 10, 1),
            'gamma' : hp.quniform('gamma', 0, 1, 0.05),
            'learning_rate': hp.quniform('learning_rate', 0., 0.1, 0.01),
            'n_estimators': hp.quniform('n_estimators', 500, 800, 10),
            #Improve noise robustness 
            "subsample" : hp.quniform('subsample', 1.0, 2, 0.01),
            "colsample_bytree" : hp.quniform('colsample_bytree', 0.3, 0.6, 0.025),

            'num_class' : 2,
            'silent' : 1}
        best = fmin(self.score, self.space, algo=tpe.suggest, trials=trials, max_evals=max_evals)
        print "best parameters", best
        return best
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号