ridgereg-class: Ridge regression ridgereg(formula, data, lambda). Ridge...

Description Details Fields Methods References Examples

Description

Returns the result of the Ridge Regression

Details

Ridge regression class

Fields

lambda

argument lambda a constant for ridge. "a hyperparameter"

formula

formula, is a object of class formula. format y ~ x_1 + x_2 + ... + x_n.

data

data.frame, The data is typically a data.frame. The gieven data set.

Methods

coef()

return the ridge regression coefficients ^y ridge

predict(newdata = NULL)

return the predicted values ^y, it should be able to predict for new dataset similar

print()

print out the coefficients and coefficient names, similar as done by the lm class.

References

Reference Classes: http://adv-r.had.co.nz/R5.html

Examples

1
2
3
4
data(iris)
ridgereg$new(Petal.Length~Sepal.Width+Sepal.Length, data=iris, lambda = 0)$print()
ridgereg$new(Petal.Length~Sepal.Width+Sepal.Length, data=iris, lambda = 0)$predict()
ridgereg$new(Petal.Length~Sepal.Width+Sepal.Length, data=iris, lambda = 0)$coef()

nourqweder/Bonous documentation built on Nov. 4, 2019, 10:09 p.m.