predict.OnlineLinearRegression.Rd
Similar to other predict methods, this function predicts fitted values from a fitted "OnlineLinearRegression" object.
# S3 method for OnlineLinearRegression
predict(model, data, key, features = NULL)
S3
methods
R6Class object
An "OnlineLinearRegression" object for prediction.
DataFrame
DataFrame containting the data.
character
Name of the ID column.
character of list of characters, optional
Name of feature columns for prediction.
If not provided, it defaults to all non-key columns of data.
Predicted values are returned as a DataFrame, structured as follows.
ID column, with same name and type as data's ID column.
VALUE, type DOUBLE, representing predicted values.
Call predict() with df.predict:
> df.predict$Collect()
ID X1 X2
0 14 2 67
1 15 3 51
Invoke predict():
> fitted <- predict(olr, df.predict, key="ID", features=list("X1", "X2"))
> fitted$Collect()
ID VALUE
0 14 279.020611
1 15 218.024511