Sparse Generalized Linear Model with L0 Approximation for Feature Selection

Fits sparse generalized linear models using an adaptive ridge approximation to an L0 penalty. Supported model families include Gaussian, logistic, Poisson, gamma, and inverse Gaussian regression. The package also provides cross-validation for selecting the penalty parameter.


l0ara

CRAN RStudio mirror downloads

Overview

l0ara fits sparse generalized linear models using an adaptive ridge approximation to an L0 penalty.

Installation

Install the package from CRAN with:

install.packages("l0ara")

Basic usage

Fit a sparse Gaussian model:

library(l0ara)

n <- 100
p <- 40
x <- matrix(rnorm(n * p), n, p)
beta <- c(1, 0, 2, 3, rep(0, p - 4))
y <- x %*% beta + rnorm(n)

fit <- l0ara(x, y, family = "gaussian", lam = log(n))
print(fit)
coef(fit)

Select the penalty by cross-validation:

lam <- c(0.1, 0.3, 0.5)
cv_fit <- cv.l0ara(x, y, family = "gaussian", lam = lam, measure = "mse")

print(cv_fit)
coef(cv_fit)
plot(cv_fit)

Reference manual

It appears you don't have a PDF plugin for this browser. You can click here to download the reference manual.

install.packages("l0ara")

0.1.7 by Wenchuan Guo, 5 months ago


Browse source code at https://github.com/cran/l0ara


Authors: Wenchuan Guo [aut, cre] , Shujie Ma [aut] , Zhenqiu Liu [aut]


Documentation:   PDF Manual  


GPL-2 license


Imports Rcpp

Linking to Rcpp, RcppArmadillo


See at CRAN