prof_lambda: Profiling tuning parameters

View source: R/prof_lambda.R

prof_lambdaR Documentation

Profiling tuning parameters

Description

Computes the regularization path of all coefficients for a single tuning parameter, lambda, over a sequence of values.

Usage

prof_lambda(model, min_lambda = 0, max_lambda = 15, nprof = 5, as.lm = FALSE)

Arguments

model

Object of class "tramnet".

min_lambda

Minimal value of lambda (default min_lambda = 0).

max_lambda

Maximal value of lambda (default max_lambda = 15).

nprof

Number of profiling steps (default nprof = 5).

as.lm

Return scaled coefficients for class "tramnet_Lm".

Value

Object of class "prof_lambda" which contains the regularization path of all coefficients and the log-likelihood over the penalty parameter lambda

Examples


if (require("survival") & require("penalized")) {
  data("nki70", package = "penalized")
  nki70$resp <- with(nki70, Surv(time, event))
  x <- scale(model.matrix( ~ 0 + DIAPH3 + NUSAP1 + TSPYL5 + C20orf46, data = nki70))
  y <- Coxph(resp ~ 1, data = nki70, order = 10, log_first = TRUE)
  fit <- tramnet(y, x, lambda = 0, alpha = 1)
  pfl <- prof_lambda(fit)
  plot_path(pfl)
}



tramnet documentation built on Nov. 4, 2023, 3 p.m.

Related to prof_lambda in tramnet...