
Determine SuperLearner Weights with Nonnegative Least Squares
Source:R/determine_weights.R
determine_super_learner_weights_nnls.RdThis function accepts a dataframe that is structured to have one column `Y` and other columns with unique names corresponding to different model predictions for `Y`, and it will use nonnegative least squares to determine the weights to use for a SuperLearner.
Arguments
- data
A data frame consisting of an outcome (y_variable) and other columns corresponding to predictions from candidate learners.
- y_variable
The string name of the outcome column in `data`.
- obs_weights
A vector of weights for each observation that dictate how prediction should be more targeted to higher weighted observations.