Skip to contents

Least-squares meta-learner (minimum-norm, matching numpy.lstsq) over out-of-fold base predictions, with an intercept by default.

Usage

morie_geron_stacking_predictor(
  base_preds,
  y,
  blender = NULL,
  include_intercept = TRUE
)

Arguments

base_preds

(m, L) base model predictions.

y

Targets.

blender

Optional function(P, y) returning a predictor.

include_intercept

Prepend a column of ones.

Value

List with predictions, weights, rmse, base_rmse, improvement.

Examples

morie_geron_stacking_predictor(base_preds = c(1, 2, 3, 4, 5, 6, 7, 8), y = 5L)
#> $predictions
#> [1] 5
#> 
#> $weights
#> [1] 0.02439024 0.02439024 0.04878049 0.07317073 0.09756098 0.12195122 0.14634146
#> [8] 0.17073171 0.19512195
#> 
#> $rmse
#> [1] 0
#> 
#> $base_rmse
#> [1] 4 3 2 1 0 1 2 3
#> 
#> $improvement
#> [1] 0
#> 
#> $estimate
#> [1] 5
#> 
#> $n
#> [1] 1
#>