我用GridSearchCV閱讀微調模型和我遇到以下所示的參數電網傳來:什麼n_estimators和max_features意味着RandomForestRegressor
param_grid = [
{'n_estimators': [3, 10, 30], 'max_features': [2, 4, 6, 8]},
{'bootstrap': [False], 'n_estimators': [3, 10], 'max_features': [2, 3, 4]},
]
forest_reg = RandomForestRegressor(random_state=42)
# train across 5 folds, that's a total of (12+6)*5=90 rounds of training
grid_search = GridSearchCV(forest_reg, param_grid, cv=5,
scoring='neg_mean_squared_error')
grid_search.fit(housing_prepared, housing_labels)
在這裏,我沒有得到n_estimator和max_feature的概念。它是否像n_estimator意味着來自數據的記錄數量,max_features是指從數據中選擇的屬性數量?
進一步說後,我得到了這樣的結果:
>> grid_search.best_params_
{'max_feature':8, 'n_estimator':30}
所以事情是,我沒有得到這其實結果想說什麼..
請閱讀文檔:[RandomForestRegressor](http://scikit-learn.org/stable/modules/generated/sklearn.ensemble.RandomForestRegressor.html)和[用戶指南](http:// scikit-learn .org/stable/modules/ensemble.html#forest-of-randomized-trees) –
@VivekKumar謝謝 –