I try to optimize the averaged prediction of two logistic regressions in a classification task using a superlearner.
My measure of interest is classif.auc
The mlr3 help file tells me (?mlr_learners_avg)
Predictions are averaged using weights (in order of appearance in the data) which are optimized using nonlinear optimization from the package "nloptr" for a measure provided in measure (defaults to classif.acc for LearnerClassifAvg and regr.mse for LearnerRegrAvg). Learned weights can be obtained from $model. Using non-linear optimization is implemented in the SuperLearner R package. For a more detailed analysis the reader is referred to LeDell (2015).
I have two questions regarding this information:
When I look at the source code I think
LearnerClassifAvg$new()defaults to"classif.ce", is that true? I think I could set it toclassif.aucwithparam_set$values <- list(measure="classif.auc",optimizer="nloptr",log_level="warn")The help file refers to the
SuperLearnerpackage and LeDell 2015. As I understand it correctly, the proposed "AUC-Maximizing Ensembles through Metalearning" solution from the paper above is, however, not impelemented inmlr3? Or do I miss something? Could this solution be applied inmlr3? In themlr3book I found a paragraph regarding calling an external optimization function, would that be possible forSuperLearner?
As far as I understand it, LeDell2015 proposes and evaluate a general strategy that optimizes AUC as a black-box function by learning optimal weights. They do not really propose a best strategy or any concrete defaults so I looked into the defaults of the SuperLearner package's AUC optimization strategy.
Assuming I understood the paper correctly:
The
LearnerClassifAvgbasically implements what is proposed in LeDell2015 namely, it optimizes the weights for any metric using non-linear optimization. LeDell2015 focus on the special case of optimizing AUC. As you rightly pointed out, by setting the measure to"classif.auc"you get a meta-learner that optimizes AUC. The default with respect to which optimization routine is used deviates between mlr3pipelines and the SuperLearner package, where we useNLOPT_LN_COBYLAand SuperLearner ... uses the Nelder-Mead method via theoptimfunction to minimize rank loss (from the documentation).So in order to get exactly the same behaviour, you would need to implement a
Nelder-Meadbbotk::Optimizersimilar to here that simply wrapsstats::optimwith methodNelder-Meadand carefully compare settings and stopping criteria. I am fairly confident thatNLOPT_LN_COBYLAdelivers somewhat comparable results, LeDell2015 has a comparison of the different optimizers for further reference.Thanks for spotting the error in the documentation. I agree, that the description is a little unclear and I will try to improve this!