Description Usage Arguments Examples
View source: R/cv-my-grad-descent.R
Does k-fold cross-validation for my_grad_descent(), returns out-of-sample accuracy (sum of residual squares).
1 | cv_my_grad_descent(form, data, nfolds = 10, ...)
|
form |
a formula object, e.g. y ~ x1 + x2 |
data |
a data frame |
nfolds |
number of folds, default is 10 |
... |
other arguments that can be passed to |
1 2 3 | data(iris)
fit <- cv_my_grad_descent(form = Sepal.Length ~ ., data = iris, nfolds = 5, lambda = 0.0001)
fit$coefficients
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.