lambda: Computes a lambda sequence for the regularization path

Description Usage Arguments Value Author(s) Examples

Description

Computes a decreasing lambda sequence of length d. The sequence ranges from a data determined maximal lambda λ_\textrm{max} to the user inputed lambda.min.

Usage

1
2
3
4
5
lambda(x, classes, sampleWeights = NULL, grouping = NULL,
  groupWeights = NULL, parameterWeights = NULL, alpha = 0.5,
  d = 100L, standardize = TRUE, lambda.min, intercept = TRUE,
  sparse.data = is(x, "sparseMatrix"), lambda.min.rel = FALSE,
  algorithm.config = msgl.standard.config)

Arguments

x

design matrix, matrix of size N \times p.

classes

classes, factor of length N.

sampleWeights

sample weights, a vector of length N.

grouping

grouping of features, a vector of length p. Each element of the vector specifying the group of the covariate.

groupWeights

the group weights, a vector of length m+1 (the number of groups). The first element of the vector is the intercept weight. If groupWeights = NULL default weights will be used. Default weights are 0 for the intercept and

√{K\cdot\textrm{number of features in the group}}

for all other weights.

parameterWeights

a matrix of size K \times (p+1). The first column of the matrix is the intercept weights. Default weights are is 0 for the intercept weights and 1 for all other weights.

alpha

the α value 0 for group lasso, 1 for lasso, between 0 and 1 gives a sparse group lasso penalty.

d

the length of lambda sequence

standardize

if TRUE the features are standardize before fitting the model. The model parameters are returned in the original scale.

lambda.min

the smallest lambda value in the computed sequence.

intercept

should the model include intercept parameters

sparse.data

if TRUE x will be treated as sparse, if x is a sparse matrix it will be treated as sparse by default.

lambda.min.rel

is lambda.min relative to lambda.max ? (i.e. actual lambda min used is lambda.min*lambda.max, with lambda.max the computed maximal lambda value)

algorithm.config

the algorithm configuration to be used.

Value

a vector of length d containing the computed lambda sequence.

Author(s)

Martin Vincent

Examples

1
2
3
4
5
6
7
data(SimData)

# A quick look at the data
dim(x)
table(classes)

lambda <- msgl::lambda(x, classes, alpha = .5, d = 100, lambda.min = 0.01)

Example output

Loading required package: Matrix
Loading required package: sglOptim
Loading required package: foreach
Loading required package: doParallel
Loading required package: iterators
Loading required package: parallel
[1] 100 400
classes
 A  B  C  D  E  F  G  H  I  J 
10 10 10 10 10 10 10 10 10 10 

msgl documentation built on May 8, 2019, 9:03 a.m.