sklearn.tree.ExtraTreeRegressor

From GM-RKB
Jump to navigation Jump to search

A sklearn.tree.ExtraTreeRegressor is a Regresssion Extra-Trees Learning System within sklearn.tree module.

1) Import Regression Extra-Trees Learning System from scikit-learn : from sklearn.tree import ExtraTreeRegressor
2) Create design matrix X and response vector Y
3) Create Extra-Trees Regressor object: ETreg=ExtraTreeRegressor(criterion=’gini’, splitter=’best’[, max_depth=None, min_samples_split=2, min_samples_leaf=1,...])
4) Choose method(s):
  • ETreg.apply(X[, check_input]), returns the leaf index for each sample predictor.
  • ETreg.decision_path(X[, check_input]), returns the decision path in the tree.
  • ETreg.fit(X, y[, sample_weight, check_input,...]) builds a decision tree regressor from the training set (X, y).
  • ETreg.get_params([deep]) returns parameters for this estimator.
  • ETreg.predict(X[, check_input]), predicts regression value for X.
  • ETreg.score(X, y[, sample_weight]), returns the coefficient of determination R^2 of the prediction.
  • ETreg.set_params(**params), sets the parameters of this estimator.


References

2017