Learn R Programming

PortfolioTesteR (version 0.1.4)

ml_make_ensemble: 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)

Value

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

Arguments

...

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

weights

Optional numeric vector of blend weights (recycled).

Examples

Run this code
if (FALSE) {
ens <- ml_make_ensemble(ml_make_model("ridge"),
                        ml_make_model("rf"),
                        ml_make_model("xgboost"))
}

Run the code above in your browser using DataLab