Description Usage Arguments Examples
implementation of gradient descent for ordinary least squares, finding the solutions for Y = X*beta and choose the best best beta that gives best out of sample accuracy
1 2 | out_gradient_descent(formula, data, lambda = 1e-04, N = 5e+05,
M = 10)
|
formula |
a formula for ridge regression |
data |
the data you want to regress on |
lambda |
learning rate |
N |
number of iterations |
M |
number of folds to split the dataset |
1 2 3 4 5 6 | set.seed(100)
ogd = data.frame(red = runif(100,0,1), yellow = runif(100,0,1),blue=runif(100,0,1))
ogd$price = 0.2*ogd$red + (0.4*(ogd$yellow **2)) + 0.5 * ogd$blue
formula = price ~ .
data = ogd
out_gradient_descent(formula, data)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.