📜  sklearn 中的 randomforestregressor - Python 代码示例

📅  最后修改于: 2022-03-11 14:45:25.550000             🧑  作者: Mango

代码示例1
from sklearn.ensemble import RandomForestRegressor
from sklearn.datasets import make_regression
X, y = make_regression(n_features=4, n_informative=2,
                       random_state=0, shuffle=False)
regr = RandomForestRegressor(max_depth=2, random_state=0)
regr.fit(X, y)

print(regr.predict([[0, 0, 0, 0]]))