| mbo_tramnet | R Documentation |
Uses model based optimization to find the optimal tuning parameter(s) in a regularized transformation model based on cross-validated log-likelihoods. Here the tramnet package makes use of the mlr3mbo interface for Bayesian Optimization in machine learning problems to maximize the cv-logLik as a black-box function of the tuning parameters alpha and lambda.
mbo_tramnet(
object,
fold = 2,
n_design = 5,
n_iter = 5,
minlambda = 0,
maxlambda = 16,
minalpha = 0,
maxalpha = 1,
folds = NULL,
learner = "regr.km",
pred.type = "se",
opt_crit = "ei",
noisy = FALSE,
obj_type = c("lasso", "ridge", "elnet"),
verbose = TRUE,
...
)
object |
object of class |
fold |
fold for cross validation |
n_design |
number of rows of the initial design matrix based on a random latin hypercube design |
n_iter |
number of iterations in the model based optimization procedure |
minlambda |
minimum value for lambda (default: |
maxlambda |
maximum value for lambda (default: |
minalpha |
minimum value for alpha (default: |
maxalpha |
maximum value for alpha (default: |
folds |
self specified folds for cross validation (mainly for reproducibility and comparability purposes) |
learner |
type of learner used as surrogate model in the optimization,
either the key of a regression learner in
|
pred.type |
prediction type of the learner (default: |
opt_crit |
optimization criterion, either the key of an acquisition
function in |
noisy |
indicates whether folds for k-fold cross-validation should
be random for each iteration, leading to a noisy objective function
(default: |
obj_type |
objective type, one of |
verbose |
toggle for a verbose output (default: |
... |
additional arguments are ignored |
returns a list containing the recommended tuning parameters
(x), the corresponding objective value (y), i.e., minus
two times the cross-validated log-likelihood, the type of objective
(obj_type) and the optimization instance (instance) of
class OptimInstanceBatchSingleCrit, which contains
the full archive of evaluated tuning parameters
Lucas Kook
if (require("survival") & require("TH.data") & require("DiceKriging")) {
set.seed(241068)
data("GBSG2", package = "TH.data")
GBSG2$surv <- with(GBSG2, Surv(time, cens))
mt <- Coxphnet(surv ~ horTh + age + tsize + pnodes, data = GBSG2,
lambda = 0, alpha = 0, log_first = TRUE)
tmbo <- mbo_tramnet(mt, obj_type = "lasso", fold = 2, n_iter = 3,
verbose = FALSE)
tmbo$x
coef(mbo_recommended(tmbo, mt))
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.