n_estimator_params= range(1, 100,5) confusion_matrixes={}forn_estimatorinn_estimator_params: rf= RandomForestClassifier(n_estimators=n_estimator,n_jobs=-1, verbose=True) rf.fit(X[training], y[training])print("Accuracy:\t", (rf.predict(X[~training]) == y[~training]).mean())'''==...
#调整随机森林的参数(调整n_estimators随机森林中树的数量默认10个树,精度递增显著)from sklearn import datasets X, y = datasets.make_classification(n_samples=10000,n_features=20,n_informative=15,flip_y=.5, weights=[.2, .8])import numpy as np training = np.random.choice([True, False], p=...
#调整随机森林的参数(调整n_estimators随机森林中树的数量默认10个树,精度递增显著,但并不是越多越好),加上verbose=True,显示进程使用信息 2016-03-31 18:36 −... qqhfeng16 0 15708 如何调整随机森林的参数达到更好的效果。 2016-10-07 22:17 −原文地址: https://www.analyticsvidhya.com/blog/2015...