ml_make_ensemble: NA-tolerant ensemble blender (row-wise)

View source: R/ml_helper.R

ml_make_ensembleR Documentation

NA-tolerant ensemble blender (row-wise)

Description

Creates an equal- or user-weighted blend of multiple model objects produced by ml_make_model(). The returned fit trains each component; predict combines component predictions with an NA-safe weighted average.

Usage

ml_make_ensemble(..., weights = NULL)

Arguments

...

Two or more model objects each with ⁠$fit⁠/⁠$predict⁠.

weights

Optional numeric vector of blend weights (recycled).

Value

A list with ⁠$fit⁠ and ⁠$predict⁠ closures for the ensemble.

Examples

## Not run: 
ens <- ml_make_ensemble(ml_make_model("ridge"),
                        ml_make_model("rf"),
                        ml_make_model("xgboost"))

## End(Not run)

PortfolioTesteR documentation built on Nov. 5, 2025, 5:23 p.m.