cv_risk_sl_nloglik: Cross-validated negative log-likelihood of the super learner

Description Usage Arguments Details Value Examples

Description

In general, the function passed to sl_control$cv_risk should expect a list of outcomes and predictions in validation folds. The function should return a list with names cv_measure, ci_low, ci_high, and p_value. The output of this function is returned irrespective of the names of the list; however, the names are necessary for print methods to work properly.

Usage

1
cv_risk_sl_nloglik(input, sl_control)

Arguments

input

List where each entry corresponds to a validation fold. Each entry is a list with entries: Y (univariate outcome for this validation fold), pred (matrix of predictions from learner and columns correspond to different leaners).

sl_control

List of super learner control options.

Details

Confidence intervals are computed for negative log-likelihood. The p-value is for the one-sided hypothesis test that cross-validated negative log-likelihood is less than -log(0.5), which is what the value of negative log-likelihood if every observation were predicted to have Y = 1 with probability 0.5.

Value

A list with named entries cv_measure, ci_low, ci_high, and p_value. The list will be returned by max_assoc irrespective of the named entries; however, the print methods will only work if the function returns the above names.

Examples

1
2
3
4
5
6
7
8
9
# simulate data with proper format
input <- list(list(valid_folds=1, Y = rbinom(50,1,0.5),pred = runif(50,0,1)),
              list(valid_folds=2, Y = rbinom(50,1,0.5),pred = runif(50,0,1))) 
     
# alpha value                        
sl_control= list(alpha= 0.05)    

# get risk 
cv_risk <- cv_risk_sl_nloglik(input, sl_control)                         

benkeser/cvma documentation built on May 5, 2019, 1:37 p.m.