Predicts the target on new data using the DAIModel. The predictions can be also obtained using the scoring pipelines independently of the Driverless server.

# S3 method for DAIModel
predict(
  object,
  newdata,
  output_margin = FALSE,
  pred_contribs = FALSE,
  include_columns = NULL,
  return_df = TRUE,
  progress = getOption("dai.progress", TRUE),
  ...
)

Arguments

object

Model for the prediction.

newdata

DAIFrame with the new data.

output_margin

Whether to return predictions as margins (in link space).

pred_contribs

Whether to return prediction contributions.

include_columns

Vector of column names to be included in the output.

return_df

Whether to return the predictions as data.frame or a file path.

progress

Whether to display a progress bar.

...

Additional parameters to pass.

Value

Either a data-frame or a path of the resulting CSV on the server.

See also

Examples

dai.connect(uri = 'http://127.0.0.1:12345', username = 'h2oai', password = 'h2oai')
iris_dai <- as.DAIFrame(iris, progress = FALSE)
model <- dai.train(training_frame = iris_dai,
                   target_col = 'Species',
                   is_classification = TRUE,
                   is_timeseries = FALSE,
                   progress = FALSE)
predictions <- predict(model, newdata = iris_dai, progress = FALSE)
print(predictions)