Description Usage Arguments Examples
View source: R/gd_out_of_sample.R
This function fits OLS model using gradient descent that calculates the loss based on out-of-sample accuracy
1 | gradient_descent_loss(form, data, alpha, num_iters, v)
|
form |
A given formula for fitting the regression |
data |
A given dataset to fit the model |
alpha |
The learning rate |
num_iters |
The number of iterations |
v |
The number of folds when implementing n-folds cross-validation |
1 2 3 | library(palmerpenguins)
data(penguins)
gradient_descent_loss(bill_length_mm ~ ., data = penguins[,-8],alpha=0.1,num_iters=1000)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.