dual.ridge.lm: Fitting Linear Models with Ridge Penalty using Dual Solution

Description Usage Arguments Value

View source: R/dual.ridge.lm.R

Description

Implementation of the dual analytical solution for a linear regression model with a Ridge penalty term.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
dual.ridge.lm(
  formula,
  data,
  lambda,
  intercept = F,
  standardize = F,
  kernel = "lin",
  const = 0,
  degree = NULL,
  scale = NULL
)

Arguments

formula

an object of class formula: a symbolic description of the model to be fitted following the standard of lm.

data

an optional data frame, list or environment (or object coercible by as.data.frame to a data frame) containing the variables in the model. If not found in data, the variables are taken from environment (formula), typically the environment from which this function is called.

lambda

penalty term scaling hyperparameter.

intercept

optional boolean indicating whether to fit an intercept. If TRUE, standardize is ignored. Default is FALSE.

standardize

optional boolean indicating whether to return results for standardized data. If intercept is TRUE, this argument is ignored. Default is FALSE. TRUE, standardize is ignored. Default is FALSE.

kernel

optional kernel to use in the ridge regression model. By default the linear kernel with constant zero is used, that is, no kernel transformation is applied. See the details section for more details on available kernel transformations.

const

optional constant parameter for the kernel transformation. Default is 0.

degree

optional degree parameter in the kernel transformation. Default is NULL.

scale

optional scale parameter in the kernel transformation. Default is NULL.

Value

dual.ridge.lm returns an object of class mlkit.dual.ridge.fit. An object of class mlkit.dual.ridge.fit is a list containing at least the following components:

coefficients

a named vector of optimal coefficients.

alpha

L1-weight hyperparameter in elastic net penalty term.

lambda

penalty term scaling hyperparameter.

r2

coefficient of determination for optimal coefficients.

x

matrix containing the explanatory variables used in estimation.

ker.mat

kernel matrix used in estimation.

kernel

kernel transformation.

const

constant parameter in the kernel transformation.

degree

degree parameter in the kernel transformation.

scale

scale parameter in the kernel transformation.


Accelerytics/mlkit documentation built on Dec. 31, 2020, 9:46 a.m.