Skip to contents

w <- w exp(alpha 1{misclassified}), then renormalise. The weighted error BEFORE the update is reported so alpha can be checked against log((1-r)/r).

Usage

morie_geron_adaboost_weight_update(y_true, y_pred, weights, alpha_t)

Arguments

y_true, y_pred

Label vectors of equal length.

weights

Non-negative sample weights.

alpha_t

Predictor weight of the round just fitted.

Value

List with weights_new, misclassified, weighted_error, boost_factor.

Examples

morie_geron_adaboost_weight_update(c(0, 0, 1, 1), c(0, 1, 1,
    1), rep(0.25, 4), log(3))
#> $weights_new
#> [1] 0.1666667 0.5000000 0.1666667 0.1666667
#> 
#> $misclassified
#> [1] FALSE  TRUE FALSE FALSE
#> 
#> $weighted_error
#> [1] 0.25
#> 
#> $boost_factor
#> [1] 3
#> 
#> $alpha_t
#> [1] 1.098612
#> 
#> $estimate
#> [1] 0.25
#> 
#> $n
#> [1] 4
#> 
#> $method
#> [1] "AdaBoost sample-weight update"
#>