LinearRegressions
creates a streaming algorithm that can
calculate and update linear regression coefficients.
Methods
Method new()
Creates a new LinearRegression
streamer object.
Arguments
X
initial design matrix
y
initial labels
fit_intercept
if `TRUE`, add an intercept to the model
method
the method used to update regression coefficients
Returns
The new LinearRegression
(invisibly)
Updates the regression coefficient based on new data
Usage
LinearRegression$update(X, y)
Arguments
X
new design matrix
y
new labels
#' @return The updated LinearRegression
(invisibly)
Method clone()
The objects of this class are cloneable with this method.
Usage
LinearRegression$clone(deep = FALSE)
Arguments
deep
Whether to make a deep clone.
Examples
X <- matrix(c(3, 1, 4, 1, 5, 9, 2, 6), ncol = 2)
y <- c(2, 7, 1, 8)
reg <- LinearRegression$new(X, y)
X_new <- matrix(c(5, 3, 5, 8), ncol = 2)
y_new <- c(2, 8)
reg$update(X_new, y_new)