sgdnet is an R-package that fits elastic net-regularized generalized linear models to big data using the incremental gradient average algorithm SAGA (Defazio et al. 2014).

## Installation

sgdnet is not currently available on CRAN but can be installed using the devtools package:

# install.packages("devtools")
devtools::install_github("jolars/sgdnet")

## Usage

It is simple to fit a model using sgdnet. The interface deliberately mimics that of glmnet to facilitate transitioning between the two.

First we load the package, and then we fit a multinomial model to the iris data set. We set the elastic net penalty to 0.8 using the alpha argument to achieve a compromise between the ridge and lasso penalties.

sgdnet fits the model across an automatically computed regularization path. Altneratively, the user might supply their own path using the lambda argument.

library(sgdnet)
fit <- sgdnet(iris[, 1:4], iris[, 5], family = "multinomial", alpha = 0.8)
plot(fit)