gd_outsample: gradient descent using out of sample penalty

View source: R/gd_outsample.R

gd_outsampleR Documentation

gradient descent using out of sample penalty

Description

This is a function taking a formula, a dataframe and an optional list of contrast for factor variables, and using gradient descent with out of sample penalty and returning OLS coefficients. Large dataset should have more accurate results for splitting samples.

Usage

gd_outsample(formula, df, contrasts = NULL, gamma = 1e-04, iter = 10^6)

Arguments

formula

an object of class "formula": describing the model to be fitted.

df

a dataframe that containing all the variables in the model.

contrasts

an optional list of contrasts for factor variables.

gamma

gamma_k, the learning rate

iter

number of iterations

Examples

data(iris)
form <- Sepal.Length ~ Sepal.Width
gd_outsample(formula = form,df = iris)

carolineying/bis557 documentation built on April 17, 2023, 4 a.m.