Skip to contents

The leaf predicts the majority class (0-based, first maximum); proportions are the tree's probabilities.

Usage

morie_geron_tree_classification_leaf(y, leaf_mask = NULL)

Arguments

y

Integer class labels over the whole node set.

leaf_mask

Optional logical selector of the leaf's rows.

Value

List with prediction, proportions, counts, gini, entropy, n_leaf.

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
#>