Description Usage Arguments Value Examples
View source: R/gradient_descent_new.R
This is a function to fit the OLS model using gradient descent that calculates the penalty based on the out-of-sample accuracy.
1 2 3 4 5 6 7 8 | gradient_descent_new(
formula,
data_frame,
contrasts = NULL,
lambda = 1e-04,
epsilon = 1e-20,
iters = 1e+06
)
|
formula |
The formula of the model to be fitted. |
data_frame |
A data frame which contains the data for the model. |
contrasts |
Default is NULL. A list of contrasts for factor variables. |
lambda |
Default is 0.0001. The learning rate. |
epsilon |
Default is 1e-20. The minimum difference between the current SSR and the updated SSR. |
iters |
Default is 1e6. The maximum number of iterations. |
A list of estimated coefficients.
1 2 3 | data(iris)
model <- gradient_descent_new(Sepal.Length ~ ., data = iris)
model$coefficients
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.