Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>In this concrete example, the "error" of a node is the Gini Index of all examples that reached that node.</p> <p>In general, the "error" of a node depends on the concrete impurity criterion (e.g. gini or entropy for classification and mean squared error for regression).</p> <p>Intuitively you can think of both impurity criteria (gini and entropy) as a measure how homogeneous a multi set is. A multi set is homogeneous if it contains mostly elements of one type (this is also called "pure" thus the name "impurity criterion"). In our case the elements of the multi set are the class labels that reach the corresponding node. When we split a node we want that the resulting partitions are pure - meaning that the classes are well separated (a partition contains mostly instances of one class).</p> <p>In the case of <code>criterion="entropy"</code> and binary classification an error of 1.0 means that there is an equal number of positive and negative examples in the node (the most in-homogeneous multi set).</p> <p>You can access the tree data structure that underlies a <code>DecisionTreeClassifier</code> or <code>DecisionTreeRegressor</code> via its <code>tree_</code> attribute which holds an on object of the extension type <code>sklearn.tree._tree.Tree</code>. This object represents the tree as a series of parallel numpy arrays. The array <code>init_error</code> hold the initial error of each node; <code>best_error</code> holds sum of the errors of the two partitions if the node is a splitting node. See the class documentation in <a href="https://github.com/scikit-learn/scikit-learn/blob/master/sklearn/tree/_tree.pyx#L45" rel="nofollow">https://github.com/scikit-learn/scikit-learn/blob/master/sklearn/tree/_tree.pyx#L45</a> for more details.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload