Computes a decreasing lambda sequence of length d
.
The sequence ranges from a data determined maximal lambda \(\lambda_\textrm{max}\) to the user inputed lambda.min
.
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)
design matrix, matrix of size \(N \times p\).
classes, factor of length \(N\).
sample weights, a vector of length \(N\).
grouping of features, a vector of length \(p\). Each element of the vector specifying the group of the covariate.
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 $$\sqrt{K\cdot\textrm{number of features in the group}}$$ for all other weights.
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.
the \(\alpha\) value 0 for group lasso, 1 for lasso, between 0 and 1 gives a sparse group lasso penalty.
the length of lambda sequence
if TRUE the features are standardize before fitting the model. The model parameters are returned in the original scale.
the smallest lambda value in the computed sequence.
should the model include intercept parameters
if TRUE x
will be treated as sparse, if x
is a sparse matrix it will be treated as sparse by default.
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)
the algorithm configuration to be used.
a vector of length d
containing the computed lambda sequence.
# NOT RUN {
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)
# }
Run the code above in your browser using DataLab