ecpolley / SuperLearner

Current version of the SuperLearner R package
272 stars 72 forks source link

discrete SL + full-fit SL #137

Closed rachaelvp closed 3 years ago

rachaelvp commented 3 years ago
  1. Is there a way to specify as the metalearner the cross-validated selector, so I can specify an SL that is the discrete SL?
  2. Is there a way to specify a SuperLearner that ensembles predictions from models trained on all of the data? This SL still learns the weights/ensemble/coefficients from the cross-validated predictions. [update: or is this already the default behavior?]
ecpolley commented 3 years ago

For 1, yes, with a custom method.* function, you could specify the coefficients to be 1 for the algorithm with the minimum CV risk estimate and 0 for the others. Take a look at method.template for the structure of writing your own method wrapper.

For 2, This is what the SuperLearner() function does. The coefficients are trained in the cross-validation, and the final ensemble combines the coefficients with the estimates trained using all the data.

ecpolley commented 3 years ago

Example method over in the SuperLearnerExtra space: https://github.com/ecpolley/SuperLearnerExtra/blob/master/method/method.discreteSL.R