R/1_1_model.R
fit_flasso.Rd
Automatic model selection for highdimensional Cox models with fused lasso penalty, evaluated by crossvalidated likelihood.
fit_flasso(x, y, nfolds = 5L, lambda1 = c(0.001, 0.05, 0.5, 1, 5), lambda2 = c(0.001, 0.01, 0.5), maxiter = 25, epsilon = 0.001, seed = 1001, trace = FALSE, parallel = FALSE, ...)
x  Data matrix. 

y  Response matrix made by 
nfolds  Fold numbers of crossvalidation. 
lambda1  Vector of lambda1 candidates.
Default is 
lambda2  Vector of lambda2 candidates.
Default is 
maxiter  The maximum number of iterations allowed.
Default is 
epsilon  The convergence criterion.
Default is 
seed  A random seed for crossvalidation fold division. 
trace  Output the crossvalidation parameter tuning
progress or not. Default is 
parallel  Logical. Enable parallel parameter tuning or not,
default is FALSE. To enable parallel tuning, load the

... 
The crossvalidation procedure used in this function is the
approximated crossvalidation provided by the penalized
package. Be careful dealing with the results since they might be more
optimistic than a traditional CV procedure. This crossvalidation
method is more suitable for datasets with larger number of observations,
and a higher number of crossvalidation folds.
data("smart") x < as.matrix(smart[, c(1, 2)])[1:120, ] time < smart$TEVENT[1:120] event < smart$EVENT[1:120] y < survival::Surv(time, event) fit < fit_flasso( x, y, lambda1 = c(1, 10), lambda2 = c(0.01), nfolds = 3, seed = 11 )#> 123123nom < as_nomogram( fit, x, time, event, pred.at = 365 * 2, funlabel = "2Year Overall Survival Probability" ) plot(nom)