Learn R Programming

rtemis (version 1.4.3)

setup_NNLS: Setup NNLS Hyperparameters

Description

Setup hyperparameters for non-negative least squares.

Usage

setup_NNLS(normalize = TRUE, ifw = FALSE)

Value

NNLSHyperparameters object.

Arguments

normalize

(Tunable) Logical: If TRUE, scale the coefficients to sum to 1.

ifw

(Tunable) Logical: If TRUE, use Inverse Frequency Weighting in classification.

Author

EDG

Details

NNLS fits y ~ Xb subject to b >= 0, with no intercept. It is the default meta learner of the stacked meta learners (setup_SuperLearner, setup_ModalityStacking), where the predictors are the base learners' cross-validated predictions and a non-negative, sum-to-one coefficient vector is the ensemble weighting. With no intercept and a sign constraint, it fits only outcomes in the cone the predictors span.

With normalize = TRUE the coefficients are scaled to sum to 1, so the fit is a convex combination of the predictors. For classification the outcome is coded 0/1 on the second factor level and the fitted values are read as probabilities of that level; unnormalized coefficients do not guarantee a value in [0, 1], so predictions are clamped.

Get more information from nnls::nnls.

Examples

Run this code
nnls_hyperparams <- setup_NNLS(normalize = FALSE)
nnls_hyperparams

Run the code above in your browser using DataLab