View source: R/sparse_regression_model.R
fit_srm | R Documentation |
Sparse regression model
fit_srm(
x,
y,
cross_validation = FALSE,
seed = 1,
penalty = "L0",
regulators_num = ncol(x),
n_folds = 5,
verbose = TRUE,
...
)
x |
The matrix of regulators. |
y |
The vector of target. |
cross_validation |
Logical value, default is |
seed |
The random seed for cross-validation, default is |
penalty |
The type of regularization, default is |
regulators_num |
The number of non-zore coefficients, this value will affect the final performance. The maximum support size at which to terminate the regularization path. |
n_folds |
The number of folds for cross-validation, default is |
verbose |
Logical value, default is |
... |
Parameters for other methods. |
A list of the sparse regression model. The list has the following components:
model |
The sparse regression model. |
metrics |
A list of metrics. |
coefficients |
A list of coefficients. |
data("example_matrix")
fit_srm(
x = example_matrix[, -1],
y = example_matrix[, 1]
)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.