predict.AutomaticRegression.Rd
Similar to other predict methods, this function predicts fitted values from a fitted "hanaml.AutomaticRegression" object.
# S3 method for AutomaticRegression
predict(
model,
data,
key,
features = NULL,
show.explainer = FALSE,
top.k.attributions = NULL
)
S3
methods
R6Class
An "hanaml.AutomaticRegression" object for prediction.
DataFrame
DataFrame containting the data.
character, optional
Name of the ID column.
If not provided, the data is assumed to have no ID column.
No default value.
character of list of characters, optional
Name of feature columns for prediction.
If not provided, it defaults to all non-key columns of data.
logical, optional
If True, the reason code will be returned. Only valid when background.size is provided during the fit process.
int, optional
Display the top k attributions in reason code.
Predicted values are returned as a DataFrame, structured as follows.
1st column: Data type and name same as the 1st column of data
.
2nd column: SCORE, predicted values.
Assume we have df.fit for training, df.predict for prediction.
> auto.reg <- hanaml.AutomaticRegression(data = df.fit,
pipeline = NULL,
categorical.variable =
list("OUTLOOK", "WINDY"),
scorings = NULL,
generations = 2,
population.size = 5,
offspring.size =10,
elite.number = 3,
min.layer = 2,
max.layer = 5,
mutation.rate = 0.1,
crossover.rate = 0.9,
random.seed = 1,
config.dict = NULL,
progress.indicator.id = "AUTOML_REG_TEST",
fold.num = 5,
resampling.method = "cv",
max.eval.time.mins = NULL,
early.stop = 3)
If we want to predict:
> pre.res <- predict(model = auto.reg,
data = df.predict,
key = "ID")
The output could be achieved by the following lines:
> print(pre.res$Collect())