1

我正在尝试在 XGBoost 中进行参数调整。但是,当我运行代码时,它会卡住并且永远不会完成。我使用的数据集有 50000 行和 35 列。我做错了什么还是计算成本太高?

param_test1 = [{
 'max_depth':[3],
 'min_child_weight':[3]
}]

gsearch1 = GridSearchCV(estimator = XGBClassifier(learning_rate =0.1, n_estimators=140, max_depth=5,
                                              min_child_weight=1, gamma=0, subsample=0.8, colsample_bytree=0.8,
                                              objective= 'binary:logistic', nthread=4, scale_pos_weight=1, seed=27), 
                    param_grid = param_test1, scoring='roc_auc',n_jobs=4,iid=False, cv=5)

target = 'AntAktAvtBank'
predictors = [x for x in dtrain.columns if x not in [target, ID_col]]
gsearch1.fit(dtrain[predictors],dtrain[target])
gsearch1.grid_scores_, gsearch1.best_params_, gsearch1.best_score_
4

0 回答 0