Skip to content

SuperLearner underperforming best learner? #154

Description

@DanielPark-MGH

Hi, I'm getting a result that seems unintuitive. Could I ask if this is a possible result or if there could be a bug?

I trained a CV.SuperLearner:

num_cores <- RhpcBLASctl::get_num_cores()
num_folds_cvSL <- 10
options(mc.cores = num_cores - 1)
set.seed(1, "L'Ecuyer-CMRG")

# enet <- create.Learner()

sl_lib <- c(
  "SL.mean",
  "SL.lm",
  "SL.glmnet",
  "SL.ranger"
  )

cv_sl <- CV.SuperLearner(
  Y = y.train,
  X = X.train,
  obsWeights = wts_obs,
  cvControl = list(
    V = num_folds_cvSL
    ),
  parallel = "multicore",
  family = gaussian(),
  SL.library = sl_lib,
  verbose = TRUE
  )

Then summary(cv_sl) shows:

> summary(cv_sl)

Call:  
CV.SuperLearner(Y = y.train, X = X.train, family = gaussian(), SL.library = sl_lib, verbose = TRUE,  
    cvControl = list(V = num_folds_cvSL), obsWeights = wts_obs, parallel = "multicore") 

Risk is based on: Mean Squared Error

All risk estimates are based on V =  10 

     Algorithm       Ave         se      Min       Max
 Super Learner 0.0751603 1.3361e-04 0.070365 0.0799643
   Discrete SL 0.2240814 3.1295e-04 0.220039 0.2296513
   SL.mean_All 0.2473175 1.4485e-05 0.241507 0.2526675
     SL.lm_All 0.2246898 3.4062e-04 0.220455 0.2304481
 SL.glmnet_All 0.2240814 3.1295e-04 0.220039 0.2296513
 SL.ranger_All 0.0080468 1.5909e-04 0.007421 0.0087511

However, this doesn't seem to agree with the results of

lapply(
  cv_sl$AllSL,
  function(sl) {sl$cvRisk}
  ) %>% 
  do.call(rbind, .) %>%
  colMeans(.)
SL.mean_All     SL.lm_All SL.glmnet_All SL.ranger_All 
    0.2474629     0.2231949     0.2219471     0.4422828

Question 1: How is the average risk of SL.ranger_ALL = 0.008 from summary(cv_sl) when the empirical average across all the SuperLearners in cv_sl = 0.442?
Question 2: If the average risk of SL.ranger_ALL really = 0.008, why does the Super Learner from cv_sl have higher average risk than the supposed best performing learner?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions