1、关于调参
调参是模型适应不同数据集的一个优化过程,如果只是建立了模型,而不对参数进行调整,是很不合理的。
2、xgboost调参
3、网络调参
from sklearn.metrics import fbeta_score, make_scorer,r2_score
from sklearn.model_selection import GridSearchCVcv = KFold(n_splits=5,shuffle=True,random_state=45) parameters = {
'alpha': [0.5,0.6,0.7]} clf=KernelRidge()r2 = make_scorer(r2_score)
grid_obj = GridSearchCV(clf, parameters, cv=cv,scoring=r2)
# grid_fit = grid_obj.fit(train, labels)
grid_fit = grid_obj.fit(train_df.values, y_train_df)best_clf = grid_fit.best_estimator_ best_clf.fit(train_df.values, y_train_df)
参考:
- scikit-learn随机森林类库概述;
- 网络优化方法