
Classification tree leaf (Geron Ch 6, morie.fn grtrc)
Source:R/geron_train_native.R
morie_geron_tree_classification_leaf.RdThe leaf predicts the majority class (0-based, first maximum); proportions are the tree's probabilities.
Examples
V <- c(1, 2, 3, 4, 5, 6, 7, 8)
morie_geron_tree_classification_leaf(V)
#> $prediction
#> [1] 1
#>
#> $proportions
#> [1] 0.000 0.125 0.125 0.125 0.125 0.125 0.125 0.125 0.125
#>
#> $counts
#> [1] 0 1 1 1 1 1 1 1 1
#>
#> $gini
#> [1] 0.875
#>
#> $entropy
#> [1] 3
#>
#> $n_leaf
#> [1] 8
#>
#> $estimate
#> [1] 1
#>
#> $n
#> [1] 8
#>