ray.train.batch_predictor.BatchPredictor#

class ray.train.batch_predictor.BatchPredictor(checkpoint: ray.air.checkpoint.Checkpoint, predictor_cls: Type[ray.train.predictor.Predictor], **predictor_kwargs)[source]#

Bases: object

Batch predictor class.

Takes a predictor class and a checkpoint and provides an interface to run batch scoring on Ray datasets.

This batch predictor wraps around a predictor class and executes it in a distributed way when calling predict().

PublicAPI (beta): This API is in beta and may change before becoming stable.

Methods

from_pandas_udf(pandas_udf)

Create a Predictor from a Pandas UDF.

get_preprocessor()

Get the preprocessor to use prior to executing predictions.

predict(data, *[, feature_columns, ...])

Run batch scoring on a Dataset.

predict_pipelined(data, *[, ...])

Setup a prediction pipeline for batch scoring.

set_preprocessor(preprocessor)

Set the preprocessor to use prior to executing predictions.