fit_srm: Sparse regression model

View source: R/sparse_regression_model.R

fit_srmR Documentation

Sparse regression model

Description

Sparse regression model

Usage

fit_srm(
  x,
  y,
  cross_validation = FALSE,
  seed = 1,
  penalty = "L0",
  regulators_num = ncol(x),
  n_folds = 5,
  verbose = TRUE,
  ...
)

Arguments

x

The matrix of regulators.

y

The vector of target.

cross_validation

Logical value, default is FALSE, whether to use cross-validation.

seed

The random seed for cross-validation, default is 1.

penalty

The type of regularization, default is L0. This can take either one of the following choices: L0, L0L1, and L0L2. For high-dimensional and sparse data, L0L2 is more effective.

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 5.

verbose

Logical value, default is TRUE, whether to print progress messages.

...

Parameters for other methods.

Value

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.

Examples

data("example_matrix")
fit_srm(
  x = example_matrix[, -1],
  y = example_matrix[, 1]
)

inferCSN documentation built on April 13, 2025, 5:11 p.m.