sklearn.tree.ExtraTreeClassifier

From GM-RKB
Jump to navigation Jump to search

A sklearn.tree.ExtraTreeClassifier is a Classification Extra-Trees Learning System within sklearn.tree module.

1) Import Classification Extra-Trees Learning System from scikit-learn : from sklearn.tree import ExtraTreeClassifier
2) Create design matrix X and response vector Y
3) Create Extra-Trees Classifier object: ETclf=ExtraTreeClassifier(criterion=’gini’, splitter=’best’[, max_depth=None, min_samples_split=2, min_samples_leaf=1,...])
4) Choose method(s):
  • ETclf.apply(X[, check_input]), returns the leaf index for each sample predictor.
  • ETclf.decision_path(X[, check_input]), returns the decision path in the tree.
  • ETclf.fit(X, y[, sample_weight, check_input,...]) builds a decision tree classifier from the training set (X, y).
  • ETclf.get_params([deep]) returns parameters for this estimator.
  • ETclf.predict(X[, check_input]), predicts class for X.
  • ETclf.predict_log_proba(X), predicts class log-probabilities of the input samples X.
  • ETclf.predict_proba(X[, check_input]), predicts class probabilities of the input samples X.
  • ETclf.score(X, y[, sample_weight]), returns the mean accuracy on the given test data and labels.
  • ETclf.set_params(**params), sets the parameters of this estimator.


References

2017