sklearn.ensemble.ExtraTreesRegressor

From GM-RKB
Jump to navigation Jump to search

A sklearn.ensemble.ExtraTreesRegressor is an Extremely Randomized Trees Regression System within sklearn.ensemble module.

1) Import Extremely Randomized Trees Regression System from scikit-learn : from sklearn.ensemble import ExtraTreesRegressor
2) Create design matrix X and response vector Y
3) Create Extra-Trees Regressor object: clf=ExtraTreesRegressor([n_estimators=10, criterion=’mse’, max_depth=None, min_samples_split=2, min_samples_leaf=1, min_weight_fraction_leaf=0.0,...])
4) Choose method(s):
  • apply(X), applies trees in the forest to X, return leaf indices.
  • decision_path(X), returns the decision path in the forest
  • fit(X, y[, sample_weight]), builds a forest of trees from the training set (X, y).
  • get_params([deep]), retrieves parameters for this estimator.
  • predict(X), predicts regression target for X.
  • score(X, y[, sample_weight]), returns the coefficient of determination R^2 of the prediction.
  • set_params(**params), sets the parameters of this estimator.


References

2017a

2017b

2006