Class a.regress_linear
linear regression
Tables
a.regress_linear | linear regression |
Methods
a.regress_linear:die () | destructor for linear regression |
a.regress_linear:new (coef, bias) | constructor for linear regression |
a.regress_linear:init (coef, bias) | initialize for linear regression |
a.regress_linear:eval (val) | calculate predicted value for linear regression |
a.regress_linear:err (x, y) | calculate residuals for linear regression |
a.regress_linear:gd (input, error, alpha) | gradient descent for linear regression |
a.regress_linear:sgd (x, y, alpha) | stochastic gradient descent for linear regression |
a.regress_linear:bgd (x, y, alpha) | batch gradient descent for linear regression |
a.regress_linear:mgd (x, y, delta, lrmax, lrmin[, lrtim[, epoch[, batch]]]) | mini-batch gradient descent for linear regression |
a.regress_linear:zero () | zeroing for linear regression |
Tables
Methods
- a.regress_linear:die ()
- destructor for linear regression
- a.regress_linear:new (coef, bias)
-
constructor for linear regression
Parameters:
- coef number regression coefficient
- bias number intercept
Returns:
-
a.regress_linear
linear regression userdata
- a.regress_linear:init (coef, bias)
-
initialize for linear regression
Parameters:
- coef number regression coefficient
- bias number intercept
Returns:
-
a.regress_linear
linear regression userdata
- a.regress_linear:eval (val)
-
calculate predicted value for linear regression
Parameters:
- val number independent variable
Returns:
-
number
predicted value
- a.regress_linear:err (x, y)
-
calculate residuals for linear regression
Parameters:
- x table predictor data, specified as a numeric matrix
- y table response data, specified as a numeric vector
Returns:
-
table
residuals, specified as a numeric vector
- a.regress_linear:gd (input, error, alpha)
-
gradient descent for linear regression
Parameters:
- input table predictor data, specified as a numeric vector
- error number residual, specified as a numeric scalar
- alpha number learning rate for gradient descent
Returns:
-
a.regress_linear
linear regression userdata
- a.regress_linear:sgd (x, y, alpha)
-
stochastic gradient descent for linear regression
Parameters:
- x table predictor data, specified as a numeric matrix
- y table response data, specified as a numeric vector
- alpha number learning rate for gradient descent
Returns:
-
a.regress_linear
linear regression userdata
- a.regress_linear:bgd (x, y, alpha)
-
batch gradient descent for linear regression
Parameters:
- x table predictor data, specified as a numeric matrix
- y table response data, specified as a numeric vector
- alpha number learning rate for gradient descent
Returns:
-
a.regress_linear
linear regression userdata
- a.regress_linear:mgd (x, y, delta, lrmax, lrmin[, lrtim[, epoch[, batch]]])
-
mini-batch gradient descent for linear regression
Parameters:
- x table predictor data, specified as a numeric matrix
- y table response data, specified as a numeric vector
- delta number threshold for gradient descent value
- lrmax number maximum learning rate of iterations
- lrmin number minimum learning rate of iterations
- lrtim integer total number of learning rate steps (optional)
- epoch integer maximum number of epochs (optional)
- batch integer batch size of data (optional)
Returns:
-
number
change in loss function
- a.regress_linear:zero ()
-
zeroing for linear regression
Returns:
-
a.regress_linear
linear regression userdata