网格调参也是min_samples_leaf=1最好,建模参数要如何选取
来源:6-7 实战(三)
weixin_慕慕5408511
2022-10-17
from sklearn.model_selection import GridSearchCV
min_samples_leaf=[1,2,3,4,5,6,7,8,9]
parameters = {‘min_samples_leaf’: min_samples_leaf}
model = tree.DecisionTreeClassifier(criterion=‘entropy’)
clf = GridSearchCV(model, parameters, cv=3, scoring=‘accuracy’,verbose=1,n_jobs=-1)
clf = clf.fit(x,y)
print(clf.best_params_)
{‘min_samples_leaf’: 1}
写回答
1回答
-
flare_zhao
2022-10-18
可以根据以前的模型的经验数字来选取,也可以根据你这种网格调参来选取
00
相似问题