gradient_descent_new: Gradient Descent with Out-of-sample Accuracy

Description Usage Arguments Value Author(s) Examples

Description

Implement a new function fitting the OLS model using gradient descent that calculates the penalty based on the out-of-sample accuracy.

Usage

1
2
3
4
5
6
7
8
gradient_descent_new(
  form,
  d,
  contrasts = NULL,
  iters = 5e+05,
  gamma = 1e-04,
  threshold = 1e-12
)

Arguments

form

A formula

d

A dataframe

contrasts

Contrasts argument

iters

Number of maximum iterations

gamma

The learning rate

threshold

Threshold for the difference between RSS of new and old betas.

Value

a list of beta coefficients

Author(s)

Yijun Yang

Examples

1
2
3
4
## Not run: 
gradient_descent_new(body_mass_g ~ bill_depth_mm, penguins)

## End(Not run)

yijunyang/bis557 documentation built on Dec. 21, 2020, 3:06 a.m.