-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathREADME.Rmd
74 lines (55 loc) · 2.55 KB
/
README.Rmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
---
output: github_document
---
<!-- README.md is generated from README.Rmd. Please edit that file -->
```{r setup, include = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>",
fig.path = "man/figures/README-",
out.width = "100%"
)
```
# sgdnet
[![Travis build status](https://travis-ci.org/jolars/sgdnet.svg?branch=master)](https://travis-ci.org/jolars/sgdnet)
[![AppVeyor build status](https://ci.appveyor.com/api/projects/status/github/jolars/sgdnet?branch=master&svg=true)](https://ci.appveyor.com/project/jolars/sgdnet)
[![Coverage status](https://codecov.io/gh/jolars/sgdnet/branch/master/graph/badge.svg)](https://codecov.io/github/jolars/sgdnet?branch=master)
**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](https://cran.r-project.org/)
but can be installed using the
[devtools](https://CRAN.R-project.org/package=devtools)
package:
```{r, eval = FALSE}
# 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](https://CRAN.R-project.org/package=glmnet) to
facilitate transitioning between the two.
First we load the package, and then we fit a multinomial model to
the [iris](https://en.wikipedia.org/wiki/Iris_flower_data_set) data set.
We set the
[elastic net penalty](https://en.wikipedia.org/wiki/Elastic_net_regularization)
to 0.8 using the `alpha` argument to achieve a compromise between the
[ridge](https://en.wikipedia.org/wiki/Tikhonov_regularization)
and [lasso](https://en.wikipedia.org/wiki/Lasso_(statistics)) penalties.
**sgdnet** fits the model across an automatically computed
regularization path. Altneratively, the user might supply their own
path using the `lambda` argument.
```{r, fig.cap = "The coefficients from a multinomial model along the regularization path fit to the iris data set.", out.width = "auto", fig.width = 8, fig.asp = 0.5}
library(sgdnet)
fit <- sgdnet(iris[, 1:4], iris[, 5], family = "multinomial", alpha = 0.8)
plot(fit)
```
## License
**sgdnet** is open source software, licensed under [GPL-3](LICENSE.md).
## Versioning
**sgdnet** uses [semantic versioning](https://semver.org/).
## Acknowledgements
The initial work on **sgdnet** was supported by Google through the
[Google Summer of Code](https://summerofcode.withgoogle.com) program with
Michael Weylandt and Toby Dylan Hocking as mentors.