plot_path: Plot regularization paths

View source: R/prof_lambda.R

plot_pathR Documentation

Plot regularization paths

Description

Plot regularization paths and optionally log-likelihood trajectories of objects of class "prof_alpha" and "prof_lambda". Coefficient names are automatically added to the plot.

Usage

plot_path(object, plot_logLik = FALSE, ...)

Arguments

object

Object of class "prof_alpha" or "prof_lambda".

plot_logLik

Whether logLik trajectory should be plotted (default plot_logLik = FALSE).

...

Additional arguments to plot

Value

None.

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)
  fit1 <- tramnet(y, x, lambda = 0, alpha = 1)
  pfl <- prof_lambda(fit1)
  plot_path(pfl)
  fit2 <- tramnet(y, x, lambda = 1, alpha = 1)
  pfa <- prof_alpha(fit2)
  plot_path(pfa)
}



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

Related to plot_path in tramnet...