Difference between revisions of "sklearn.tree.DecisionTreeRegressor"

From GM-RKB
Jump to: navigation, search
m (Text replacement - "</B>[[" to "</B> [[")
m (Remove links to pages that are actually redirects to this page.)
Line 32: Line 32:
 
=== 2015 ===
 
=== 2015 ===
 
* http://scikit-learn.org/stable/modules/tree.html#regression
 
* http://scikit-learn.org/stable/modules/tree.html#regression
** [[decision tree training system|Decision trees]] can also be applied to [[regression problem]]s, using the [[DecisionTreeRegressor class]].        <P>        As in the [[supervised classification task|classification setting]], the fit method will take as argument arrays X and y, only that in this case y is expected to have [[floating point value]]s instead of [[integer value]]s:
+
** [[decision tree training system|Decision trees]] can also be applied to [[regression problem]]s, using the [[sklearn.tree.DecisionTreeRegressor|DecisionTreeRegressor class]].        <P>        As in the [[supervised classification task|classification setting]], the fit method will take as argument arrays X and y, only that in this case y is expected to have [[floating point value]]s instead of [[integer value]]s:
 
----
 
----
 
__NOTOC__
 
__NOTOC__
 
[[Category:Concept]]
 
[[Category:Concept]]

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