Learn R Programming

mlflow (version 0.9.0.1)

mlflow_rfunc_predict: Predict using RFunc MLflow Model

Description

Performs prediction using an RFunc MLflow model from a file or data frame.

Usage

mlflow_rfunc_predict(model_path, run_uuid = NULL, input_path = NULL,
  output_path = NULL, data = NULL, restore = FALSE)

Arguments

model_path

The path to the MLflow model, as a string.

run_uuid

Run ID of run to grab the model from.

input_path

Path to 'JSON' or 'CSV' file to be used for prediction.

output_path

'JSON' or 'CSV' file where the prediction will be written to.

data

Data frame to be scored. This can be used for testing purposes and can only be specified when `input_path` is not specified.

restore

Should mlflow_restore_snapshot() be called before serving?

Examples

Run this code
# NOT RUN {
library(mlflow)

# save simple model which roundtrips data as prediction
mlflow_save_model(function(df) df, "mlflow_roundtrip")

# save data as json
jsonlite::write_json(iris, "iris.json")

# predict existing model from json data
mlflow_rfunc_predict("mlflow_roundtrip", "iris.json")
# }
# NOT RUN {
# }

Run the code above in your browser using DataLab