update
This commit is contained in:
@@ -428,7 +428,7 @@ p_{mk} = \frac{1}{N_m}\sum_{x_i\in R_m}I(y_i\ne k) = 1-p_{mk}.
|
||||
* Gini index $g$
|
||||
!bt
|
||||
\[
|
||||
g = \sum_{k=1}^K p_{mk}(1-p_{mk}).
|
||||
g = \sum_{k\ne k'} p_{mk}p_{mk'}=\sum_{k=1}^K p_{mk}(1-p_{mk}).
|
||||
\]
|
||||
!et
|
||||
* Information entropy or just entropy $s$
|
||||
@@ -439,6 +439,30 @@ s = -\sum_{k=1}^K p_{mk}\log{p_{mk}}.
|
||||
!et
|
||||
|
||||
|
||||
!split
|
||||
===== Gini Index?Coefficient/Impurity =====
|
||||
|
||||
The Gini index $g$ gives us the degree of probability of a specific
|
||||
variable that is wrongly classified.
|
||||
|
||||
It takes values $g \in [0,1]$,
|
||||
o $g=0$ means a *pure* case where all elements belong to one class only.
|
||||
o A value $g=1$ means that all elements are randomly distributed across various classes.
|
||||
o A value $g=0.5$ means that the elements in a node are uniformly distributed across classes.
|
||||
|
||||
It favors binary splitting.
|
||||
|
||||
!split
|
||||
===== Why binary split? =====
|
||||
|
||||
It is custom to split to a tree uising binary splits. The reason is
|
||||
that multiway splits fragment the data too quickly, leaving
|
||||
insufficient data at the next level down. Multiway splits can be
|
||||
achieved by a series of binary split and this is normally preferred.
|
||||
|
||||
|
||||
|
||||
|
||||
!split
|
||||
===== Visualizing the Tree, Classification =====
|
||||
!bc pycod
|
||||
|
||||
Reference in New Issue
Block a user