sklearn.tree.DecisionTreeRegressor: Difference between revisions

From GM-RKB
Jump to navigation Jump to search
m (Remove links to pages that are actually redirects to this page.)
m (Remove links to pages that are actually redirects to this page.)
Line 1: Line 1:
A [[sklearn.tree.DecisionTreeRegressor]] is a [[regression tree learning system]] within <code>[[sklearn.tree]]</code>.
A [[sklearn.tree.DecisionTreeRegressor]] is a [[regression tree learning system]] within <code>[[sklearn.tree]]</code>.
* <B>AKA:</B> [[tree.DecisionTreeRegressor]], [[sklearn.tree.DecisionTreeRegressor|DecisionTreeRegressor]]
* <B>AKA:</B> [[sklearn.tree.DecisionTreeRegressor|tree.DecisionTreeRegressor]], [[sklearn.tree.DecisionTreeRegressor|DecisionTreeRegressor]]
* <B>Context</B>
* <B>Context</B>
** Usage:   
** Usage:   

Revision as of 20:45, 23 December 2019

A sklearn.tree.DecisionTreeRegressor is a regression tree learning system within sklearn.tree.

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


References

2017

2015