prof_alpha | R Documentation |
Computes the regularization path of all coefficients for a single tuning, alpha, parameter over a sequence of values.
prof_alpha(model, min_alpha = 0, max_alpha = 1, nprof = 5, as.lm = FALSE)
model |
Object of class |
min_alpha |
Minimal value of alpha (default |
max_alpha |
Maximal value of alpha (default |
nprof |
Number of profiling steps (default |
as.lm |
Return scaled coefficients for class |
Object of class "prof_alpha"
which contains the regularization
path of all coefficients and the log-likelihood over the mixing parameter
alpha
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 = 1, alpha = 1)
pfa <- prof_alpha(fit)
plot_path(pfa)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.