predict.PolynomialRegression.Rd
Similar to other predict methods, this function predicts fitted values from a fitted "PolynomialRegression" object.
# S3 method for PolynomialRegression
predict(
model,
data,
key,
features = NULL,
thread.ratio = NULL,
model.format = NULL
)
S3
methods
R6Class object
A "PolynomialRegression" object for prediction.
DataFrame
DataFrame containting the data.
character
Name of the ID column.
character, optional
Name of feature column for prediciton.
If not provided, it defaults to the first non-key column of data.
double, optional
Controls the proportion of available threads that can be used by this
function.
The value range is from 0 to 1, where 0 indicates a single thread,
and 1 indicates all available threads.
Values between 0 and 1 will use up to
that percentage of available threads.Values outside this
range are ignored.
Defaults to 0.
character, optional
Choose the format of mdoel for prediction. optional are "coefficients" or "pmml".
Defaults to "coefficients".
Predicted values are returned as a DataFrame, structured as follows.
ID: with same name and type as data's ID column.
VALUE: type DOUBLE, representing predicted values.
Input DataFrame data2:
> data2$Collect()
ID X1
1 0 0.30
2 1 4.00
3 2 1.60
4 3 0.45
5 4 1.70
Predict with DataFrame data2 and the "PolynomialRegression" Object pr:
> predict(pr, data2, key = "ID")
ID VALUE
1 1 6.157063
2 2 8.401269
3 3 15.668581
4 4 33.928501