ray.train.xgboost.XGBoostPredictor#

class ray.train.xgboost.XGBoostPredictor(model: xgboost.core.Booster, preprocessor: Optional[Preprocessor] = None)[source]#

Bases: ray.train.predictor.Predictor

A predictor for XGBoost models.

Parameters
  • model – The XGBoost booster to use for predictions.

  • preprocessor – A preprocessor used to transform data batches prior to prediction.

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

Methods

from_checkpoint(checkpoint)

Instantiate the predictor from a Checkpoint.

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, dmatrix_kwargs])

Run inference on data batch.

preferred_batch_format()

Batch format hint for upstream producers to try yielding best block format.

set_preprocessor(preprocessor)

Set the preprocessor to use prior to executing predictions.