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.


from_checkpoint(checkpoint, predictor_cls, ...)

Create a BatchPredictor from a Checkpoint.


Create a Predictor from a Pandas UDF.


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 the preprocessor to use prior to executing predictions.