predict.LinearRegression {hana.ml.r} | R Documentation |
Similar to other predict methods, this function predicts fitted values from a fitted "LinearRegression" object.
## S3 method for class 'LinearRegression' predict(model, data, key, features = NULL, model.format = NULL, ...)
model |
|
data |
|
key |
|
features |
|
model.format |
|
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.
## Not run: #'Perform the predict on DataFrame df2 using "LinearRegression" object lr: >df2$Collect() ID X1 X2 X3 0 0 1.690 B 1 1 1 0.054 B 2 2 2 0.123 A 2 3 3 1.980 A 1 4 4 0.563 A 1 >fitted <- predict(model = lr, data = df2, key = "ID")$Collect() ID VALUE 0 0 10.314760 1 1 1.685926 2 2 -7.409561 3 3 2.021592 4 4 -3.122685 > fitted ID VALUE 1 0 8.889325 2 1 1.140495 3 2 -8.013622 4 3 0.418650 5 4 -3.963423 ## End(Not run)