我正在尝试使用来自sklearn的 GridsearchCV 找到Catboost 分类器的最佳值。
from catboost import CatBoostClassifier
from sklearn.grid_search import GridSearchCV
cb_model =
CatBoostClassifier(iterations=1000,learning_rate=0.01,depth=12,eval_metric='AUC',random_seed = 42,bagging_temperature = 0.8,od_type='Iter',metric_period =
50,od_wait=20)
param_test5 = {'learning_rate':[0.01,0.025,0.045,0.0625,0.1],'iterations' : [500,750,1000,1250]}
gsearch5 = GridSearchCV(estimator = CatBoostClassifier(iterations=750,learning_rate=0.01,depth=12,eval_metric='AUC',random_seed = 42,bagging_temperature = 0.2,od_type='Iter',metric_period = 50,od_wait=20),
param_grid = param_test5, scoring='roc_auc',n_jobs=3,iid=False, cv=5,verbose = 2)
gsearch5.fit(features,target)
gsearch5.grid_scores_, gsearch5.best_params_, gsearch5.best_score_,gsearch5.best_estimator_