metalearner_nnls: Non-negative least squares meta learner

View source: R/superlearner.R

metalearner_nnlsR Documentation

Non-negative least squares meta learner

Description

Estimates the ensemble weights of a superlearner by minimizing the cross-validated MSE via non-negative least squares regression. The estimated weights are non-negative and normalized to sum to one.

Usage

metalearner_nnls(y, pred, method = "quadprog", ...)

Arguments

y

(numeric) Response vector.

pred

(matrix) Matrix of cross-validated predictions with one column per candidate learner.

method

(character) Quadratic-programming solver used to compute the non-negative least squares weights. Either "quadprog" (default, using quadprog::solve.QP) or "nnls" (using nnls::nnls).

...

Additional arguments (currently ignored).

Details

targeted:::metalearner_nnls2 is an internal wrapper for using the "nnls" package instead of "quadprog".

Value

(numeric) Vector of ensemble weights, one element per column of pred.

See Also

superlearner learner_sl


targeted documentation built on July 15, 2026, 9:06 a.m.