Description Usage Arguments Value Examples
In general, the function passed to y_weight_control$optim_risk should expect a named list
of outcomes (Y) and predictions (pred) in validation folds and should return a criteria by
which outcome weights may be optimized. The weights are input to the function via
y_weight and are optimized in the y_weight_control$weight_fn. See
Examples section below for an example of the format of the input list used
for y_weight_control$optim_risk functions. 
In this case, the function computes cross-validated nonparametric R-squared.
| 1 | optim_risk_y_r2(y_weight, input, y_weight_control)
 | 
| y_weight | A numeric vector of weights corresponding to each
outcome. Typically, this is what is maximized over in  | 
| input | A list with named entries Y (matrix of outcomes for this validation fold) and pred (matrix of super learner predictions for each outcomes with columns corresponding to different outcomes). | 
| y_weight_control | Composite outcome weight control options. | 
Numeric value of cross-validated R-squared
| 1 2 3 4 5 6 7 8 9 10 11 | #Simulate data with proper format:
input <- list(Y = cbind(rnorm(50), rnorm(50)), pred = cbind(rnorm(50), rnorm(50)))
# made up weights
y_weight <- c(0.5, 0.5)
# linear combination of outcomes
y_weight_control <- list(ensemble_fn = "ensemble_linear")
# get risk
risk <- optim_risk_y_r2(y_weight, input, y_weight_control)
 | 
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.