-1
是否有一种使用GridSearch自动调整随机森林分类器的方法。我们没有提供这些值,而是有任何方法可以找到最佳的最佳参数值。使用sklearn在随机森林中自动超参数调整?
rfc = RandomForestClassifier(n_jobs=-1, max_features='sqrt', oob_score = True)
# Use a grid over parameters of interest
param_grid = {
"n_estimators" : [9, 18, 27, 36, 45, 54, 63],
"max_depth" : [1, 5, 10, 15, 20, 25, 30],
"min_samples_leaf" : [1, 2, 4, 6, 8, 10]}
CV_rfc = GridSearchCV(estimator=rfc, param_grid=param_grid, cv= 10)
CV_rfc.fit(train_x, train_y)
print CV_rfc.best_params_
号我会建议在[交叉验证](https://stats.stackexchange.com/)中提出这个问题,你会得到一个更详细的答案,为什么没有。 – ncfirth
我不同意这是一个更好的交叉验证问题。根据我的经验,如果您足够理解您的问题并将其放入scikit-learn代码中,那么SO是一个更好的地方。 –