13,716
edits
m (Text replacement - "</B>[[" to "</B> [[") |
m (Remove links to pages that are actually redirects to this page.) |
||
Line 2: | Line 2: | ||
* <B>Context</B> | * <B>Context</B> | ||
** Usage: | ** Usage: | ||
::: 1) Import [[Classification Tree Learning System]] from [[scikit-learn]] : <code>from [[sklearn.tree]] import [[DecisionTreeClassifier]]</code> | ::: 1) Import [[Classification Tree Learning System]] from [[scikit-learn]] : <code>from [[sklearn.tree]] import [[sklearn.tree.DecisionTreeClassifier|DecisionTreeClassifier]]</code> | ||
::: 2) Create [[design matrix]] <code>X</code> and [[response vector]] <code>Y</code> | ::: 2) Create [[design matrix]] <code>X</code> and [[response vector]] <code>Y</code> | ||
::: 3) Create [[Decision Tree Classifier]] object: <code>DTclf=[[DecisionTreeClassifier]](criterion=’gini’, splitter=’best’[, max_depth=None, min_samples_split=2, min_samples_leaf=1,...])</code> | ::: 3) Create [[Decision Tree Classifier]] object: <code>DTclf=[[sklearn.tree.DecisionTreeClassifier|DecisionTreeClassifier]](criterion=’gini’, splitter=’best’[, max_depth=None, min_samples_split=2, min_samples_leaf=1,...])</code> | ||
::: 4) Choose method(s): | ::: 4) Choose method(s): | ||
::::* <code>DTclf</code>.<code>apply(X[, check_input])</code>, returns the leaf index for each sample predictor. | ::::* <code>DTclf</code>.<code>apply(X[, check_input])</code>, returns the leaf index for each sample predictor. | ||
Line 31: | Line 31: | ||
=== 2017b === | === 2017b === | ||
* (Scikit-Learn, 2017B) ⇒ http://scikit-learn.org/stable/modules/tree.html#classification | * (Scikit-Learn, 2017B) ⇒ http://scikit-learn.org/stable/modules/tree.html#classification | ||
** QUOTE: [[DecisionTreeClassifier]] is a [[class]] capable of performing [[multi-class classification]] on a [[dataset]]. <P> As with other [[classifier]]s, [[DecisionTreeClassifier]] takes as input two arrays: an array X, sparse or dense, of size <code>[n_samples, n_features]</code> holding the [[training sample]]s, and an array Y of integer values, size <code>[n_samples]</code>, holding the class labels for the training samples: | ** QUOTE: [[sklearn.tree.DecisionTreeClassifier|DecisionTreeClassifier]] is a [[class]] capable of performing [[multi-class classification]] on a [[dataset]]. <P> As with other [[classifier]]s, [[sklearn.tree.DecisionTreeClassifier|DecisionTreeClassifier]] takes as input two arrays: an array X, sparse or dense, of size <code>[n_samples, n_features]</code> holding the [[training sample]]s, and an array Y of integer values, size <code>[n_samples]</code>, holding the class labels for the training samples: | ||
---- | ---- | ||
__NOTOC__ | __NOTOC__ | ||
[[Category:Concept]] | [[Category:Concept]] |
edits