You can optimize hyperparameters for specific algorithms by using create.Learner(). This allows you to define a grid of parameters to test for a single algorithm and then include those optimized versions in your SL.library.
For example, to tune the alpha parameter in SL.glmnet (where 0 is ridge and 1 is lasso):
# Fit elastic net with 5 different alphas: 0, 0.2, 0.4, 0.6, 0.8, 1.0
enet = create.Learner("SL.glmnet", detailed_names = T,
tune = list(alpha = seq(0, 1, length.out = 5)))
# Add the tuned learners to the library
sl_lib2 = c("SL.mean", "SL.lm", enet$names)
# Run SuperLearner with the tuned library
enet_sl = SuperLearner(Y = Boston$medv, X = Boston[, -14], SL.library = sl_lib2)
# Identify the best-performing alpha value or use the automatic ensemble
enet_sl