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,
  pred_contribs_original = FALSE,
  enable_mojo = TRUE,
  fast_approx = FALSE,
  fast_approx_contribs = FALSE,
  include_columns = NULL,
  pred_labels = FALSE,
  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.

pred_contribs_original

Whether to return prediction contributions in original feature space.

enable_mojo

Whether to use MOJO (if available) to make predictions.

fast_approx

Whether to speed up prediction with approximation

fast_approx_contribs

Whether to speed up prediction contributions with approximation

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)