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.
1 | optim_risk_y_nloglik(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 negative log-likelihood.
1 2 3 4 5 6 7 8 9 10 11 12 | #Simulate data with proper format:
input <- list(Y = cbind(rbinom(50,1,0.5), rbinom(50,1,0.5), rbinom(50,1,0.5)),
pred = cbind(runif(50,0,1), runif(50,0,1), runif(50,0,1)))
#Linear combination of outcomes:
y_weight_control <- list(ensemble_fn = "ensemble_linear")
#Example weights:
y_weight<-c(0,1,0)
#Get risk:
risk <- optim_risk_y_nloglik(y_weight, input, y_weight_control)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.