View source: R/lassocoef.plot.R
Plot of the LASSO coefficients | R Documentation |
Plot of the LASSO coefficients.
lassocoef.plot(lasso, lambda = TRUE)
lasso |
An object where you have saved the result of the LASSO regression. See the examples for more details. |
lambda |
If you want the x-axis to contain the logarithm of the penalty parameter |
This function plots the L_2
-norm of the coefficients of each predictor variable versus the
\log(\lambda)
or the L_1
-norm of the coefficients. This is the same plot as the one produced
by the glmnet package with type.coef = "2norm".
A plot of the L_2
-norm of the coefficients of each predictor variable (y-axis) versus the L_1
-norm
of all the coefficients (x-axis).
Michail Tsagris and Abdulaziz Alenazi.
R implementation and documentation: Michail Tsagris mtsagris@uoc.gr and Abdulaziz Alenazi a.alenazi@nbu.edu.sa. a.alenazi@nbu.edu.sa.
Alenazi, A. A. (2022). f-divergence regression models for compositional data. Pakistan Journal of Statistics and Operation Research, 18(4): 867–882.
Friedman, J., Hastie, T. and Tibshirani, R. (2010) Regularization Paths for Generalized Linear Models via Coordinate Descent. Journal of Statistical Software, Vol. 33(1), 1–22.
lasso.klcompreg, cv.lasso.klcompreg, lasso.compreg, cv.lasso.compreg,
kl.compreg, comp.reg
y <- as.matrix(iris[, 1:4])
y <- y / rowSums(y)
x <- matrix( rnorm(150 * 30), ncol = 30 )
a <- lasso.klcompreg(y, x)
lassocoef.plot(a)
b <- lasso.compreg(y, x)
lassocoef.plot(b)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.