您运行的scikit-learn是什么版本呢?我在python3.7 的 scikit-learn 0.20.0测试了,没有问题

from sklearn.ensemble import RandomForestRegressor

RandomForestRegressor(n_estimators=1000, max_depth=10, min_samples_split=1)

RandomForestRegressor(bootstrap=True, criterion='mse', max_depth=10,

max_features='auto', max_leaf_nodes=None,

min_impurity_decrease=0.0, min_impurity_split=None,

min_samples_leaf=1, min_samples_split=1,

min_weight_fraction_leaf=0.0, n_estimators=1000, n_jobs=None,

oob_score=False, random_state=None, verbose=0, warm_start=False)

官方文档如下:https://scikit-learn.org/stable/modules/generated/sklearn.ensemble.RandomForestRegressor.html#sklearn.ensemble.RandomForestRegressor

```

min_samples_split : int, float, optional (default=2)

The minimum number of samples required to split an internal node:

If int, then consider min_samples_split as the minimum number.

If float, then min_samples_split is a fraction and ceil(min_samples_split * n_samples) are the minimum number of samples for each split.

```

神烦小宝 发表于 2018-11-23 08:41:29

Logo

技术共进,成长同行——讯飞AI开发者社区

更多推荐