#输入一组网格参数 param_grid = dict(learning_rate=self.lr_lst, n_estimators=self.n_lst, depth=self.depth_lst,sample_rate=self.sample_lst,verbosity=[0],seed=[1]) # 转化为字典格式,网络搜索要求 from sklearn.model_selection import GridSearchCV #网格搜索 grid_search = GridSearchCV(model, param_grid,n_jobs=4) #训练模型 model=grid_search.fit(x_train, y_train, eval_metric='rmse')
xgboost网格搜索
最新推荐文章于 2024-05-05 00:06:07 发布