
Soft voting ensemble (Geron Ch 7, morie.fn grvots)
Source:R/geron_train_native.R
morie_geron_soft_voting.Rdy_hat = argmax of the weight-averaged class probabilities.
Examples
P <- array(0, c(2, 2, 2))
P[1, , ] <- rbind(c(0.7, 0.3), c(0.6, 0.4))
P[2, , ] <- rbind(c(0.2, 0.8), c(0.4, 0.6))
r <- morie_geron_soft_voting(P)
str(r, max.level = 1)
#> List of 6
#> $ y_hat : int [1:2] 1 0
#> $ mean_probabilities: num [1:2, 1:2] 0.45 0.5 0.55 0.5
#> $ confidence : num [1:2] 0.55 0.5
#> $ margin : num [1:2] 0.1 0
#> $ estimate : int [1:2] 1 0
#> $ n : int 2