ridge_hw2d: Ridge Regression: Finding Lambda

Description Usage Arguments Value Examples

View source: R/ridge_hw2d.R

Description

This function finds the lambda which gives the lowest loss.

Usage

1
ridge_hw2d(form, d, lambda_vals, contrasts = NULL)

Arguments

form

linear model formula

d

data frame

lambda_vals

the lambda values (regularization parameter)

contrasts

optional list of constants for factor variables aka contrast

Value

The minimum loss and the lambda associated with it

Examples

1
2
3
data(iris)
ridge_hw2d(form = Sepal.Length ~ ., d = iris[,-5],
           lambda_vals = 10^seq(-3, 2, length = 200))

brian-d1018/bis557 documentation built on Dec. 17, 2020, 6:21 p.m.