oob_score : bool (default=False) Whether to use out-of-bag samples to estimate the generalization accuracy. oob_score: bool(默认=False)是否使用袋外样品进行估算泛化精度。
# 需要导入模块: from sklearn.ensemble import RandomForestClassifier [as 别名]# 或者: from sklearn.ensemble.RandomForestClassifier importoob_score[as 别名]model = RandomForestClassifier(n_jobs=6)ifargs.CV: parameters = {'n_estimators': [150,175,200],'oob_score': [True,False]}fromsklearn...
df.head() train, test = df[df['is_train']==True], df[df['is_train']==False] features = df.columns[:4] clf = RandomForestClassifier(n_jobs=2) y, _ = pd.factorize(train['species']) clf.fit(train[features], y) preds = iris.target_names[clf.predict(test[features])] pd.cros...
resting blood pressure (in mm Hg on admission to the hospital)grid_3x3cholsort serum cholestoral in mg/dlgrid_3x3fbssort (fasting blood sugar > 120 mg/dl) (1 = true; 0 = false)grid_3x3restecgsort resting electrocardiographic resultsgrid_3x3thalachsort maximum heart rate achievedgrid_3x3...