Description Usage Arguments Value Examples
View source: R/osm_gradient_descent.R
Implement gradient descent for ordinary least squares
1 2 3 4 5 6 7 8 9 | osm_gradient_descent(
form,
dat,
contrasts = NULL,
factor = 1e-04,
m.iteration = 1e+05,
b.difference = 1e-10,
F = 10
)
|
form |
A formula with the format of "Y ~ .". |
dat |
A dataframe. |
contrasts |
A list of contrasts. |
factor |
The factor to adjust beta, set default as 0.0001. |
m.iteration |
The maximum iteration times to allow the loop to exit, set default as 1e5 |
b.difference |
The difference between previous sum of residuals and new sum of residuals to allow the loop to exit, set default as 1e-10. |
F |
The number of folds, set default as 10 |
A list of coefficients from an linear regression model with gradient descent.
1 2 3 4 | ## Not run:
osm_gradient_descent(Sepal.Length ~ ., iris, contrasts)
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.