Description Usage Arguments Value Examples
View source: R/ridge_py_hw4a.R
This function fits linear models with the ridge regression regularization (using the l2 norm). This method is used to reduce overfitting. Language is in Python 3.
1 | ridge_py_hw4a(y, X, lambda_val)
|
y |
target/response variable matrix |
X |
independent variables matrix (contrasts should be taken care of here) |
lambda_val |
the lambda value (regularization parameter) |
the best-fit coefficients with ridge regularization
1 2 3 4 | data(iris)
y <- matrix(iris$Sepal.Length, ncol = 1)
X <- model.matrix( ~ . - Sepal.Length - Species, data = iris)
ridge_py_hw4a(y, X, lambda_val = 1)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.