Skip to contents

A wrapper around mlpack::linear_regression() and mlpack::lars() that allows passing a formula.

Usage

linear_regression(
  formula = NULL,
  data = NULL,
  lambda1 = 0,
  lambda2 = 0,
  no_intercept = FALSE,
  no_normalize = FALSE,
  use_cholesky = FALSE,
  x = NULL,
  y = NULL
)

Arguments

formula

A formula.

data

A data.frame.

lambda1

Regularization parameter for L1-norm penalty.

lambda2

Regularization parameter for L2-norm penalty.

no_intercept

Logical; passed to mlpack::lars().

no_normalize

Logical; passed to mlpack::lars().

use_cholesky

Logical; passed to mlpack::lars().

x

Design matrix.

y

Response matrix.

Value

An object of class baritsu_lr.

Details

When the lambda1 is 0, this function fallbacks to mlpack::linear_regression() for performance.