plot_path | R Documentation |
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.
plot_path(object, plot_logLik = FALSE, ...)
object |
Object of class |
plot_logLik |
Whether |
... |
Additional arguments to |
None.
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)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.