from sklearn.linear_model import LogisticRegression # 逻辑回归
from sklearn.neighbors import KNeighborsClassifier # K近邻
from sklearn.svm import SVC # 支持向量机
from sklearn.tree import DecisionTreeClassifier # 决策树
from sklearn.ensemble import RandomForestClassifier # 随机森林
from sklearn.ensemble import AdaBoostClassifier # AdaBoost
from xgboost.sklearn import XGBClassifier # Xgboost
from lightgbm.sklearn import LGBMClassifier # lightgbm
def grid_search(pipeline,param_grid,x_train,y_train,x_test,y_test,num_folds=5,metrics='accuracy'):
response={
}
gs = GridSearchCV(estimator=pipeline,
param_grid=param_grid,
cv=num_folds,
scoring=metrics)
search=gs
网格搜索最优参数
最新推荐文章于 2023-08-24 17:06:46 发布
![](https://img-home.csdnimg.cn/images/20240711042549.png)