
Hard voting ensemble (Geron Ch 7, morie.fn grvoth)
Source:R/geron_train_native.R
morie_geron_hard_voting.Rdy_hat = mode of the L predicted labels; ties go to the lowest class index and are counted.
Examples
V <- c(1, 2, 3, 4, 5, 6, 7, 8)
morie_geron_hard_voting(V)
#> $y_hat
#> [1] 1 2 3 4 5 6 7 8
#>
#> $vote_counts
#> [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9]
#> [1,] 0 1 0 0 0 0 0 0 0
#> [2,] 0 0 1 0 0 0 0 0 0
#> [3,] 0 0 0 1 0 0 0 0 0
#> [4,] 0 0 0 0 1 0 0 0 0
#> [5,] 0 0 0 0 0 1 0 0 0
#> [6,] 0 0 0 0 0 0 1 0 0
#> [7,] 0 0 0 0 0 0 0 1 0
#> [8,] 0 0 0 0 0 0 0 0 1
#>
#> $agreement
#> [1] 1 1 1 1 1 1 1 1
#>
#> $ties
#> [1] 0
#>
#> $estimate
#> [1] 1 2 3 4 5 6 7 8
#>
#> $n
#> [1] 8
#>