PomaLasso: Lasso, Ridge and Elasticnet Regularized Generalized Linear...

Description Usage Arguments Value Author(s) References Examples

View source: R/PomaLasso.R

Description

PomaLasso() is an implementation of the lasso, ridge and elasticnet regression from glmnet package for binary outcomes.

Usage

1
2
3
4
5
6
7
8
PomaLasso(
  data,
  alpha = 1,
  ntest = NULL,
  nfolds = 10,
  lambda = NULL,
  labels = FALSE
)

Arguments

data

A MSnSet object. First pData column must be the subject group/type.

alpha

Elasticnet mixing parameter. alpha = 1 is the lasso penalty and alpha = 0 is the ridge penalty. This value must be between 0 and 1.

ntest

Numeric indicating the percentage of observations that will be used as test set. Default is NULL (no test set).

nfolds

Number of folds for CV (default is 10). Although nfolds can be as large as the sample size (leave-one-out CV), it is not recommended for large datasets. Smallest value allowable is nfolds = 3.

lambda

A user supplied lambda sequence. Typical usage is to have the program compute its own lambda sequence based on nlambda and lambda.min.ratio. See ?glmnet::glmnet().

labels

Logical indicating if feature names should be plotted in coefficient plot or not. Default is FALSE.

Value

A list with all results including plots, data frames and the resulting prediction model.

Author(s)

Pol Castellano-Escuder

References

Jerome Friedman, Trevor Hastie, Robert Tibshirani (2010). Regularization Paths for Generalized Linear Models via Coordinate Descent. Journal of Statistical Software, 33(1), 1-22. URL http://www.jstatsoft.org/v33/i01/.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
data("st000336")

# lasso
st000336 %>%
  PomaImpute() %>%
  PomaNorm() %>%
  PomaOutliers() %>%
  PomaLasso()

# elasticnet
st000336 %>%
  PomaImpute() %>%
  PomaNorm() %>%
  PomaOutliers() %>%
  PomaLasso(alpha = 0.5)

# ridge
st000336 %>%
  PomaImpute() %>%
  PomaNorm() %>%
  PomaOutliers() %>%
  PomaLasso(alpha = 0)

POMA documentation built on Nov. 8, 2020, 6:26 p.m.