python/ray/ml/predictors/integrations/xgboost/xgboost_predictor.py
def from_checkpoint(cls, checkpoint: Checkpoint) -> "XGBoostPredictor":
        """Instantiate the predictor from a Checkpoint.

        The checkpoint is expected to be a result of ``XGBoostTrainer``.

        Args:
            checkpoint (Checkpoint): The checkpoint to load the model and
                preprocessor from. It is expected to be from the result of a
                ``XGBoostTrainer`` run.

        """
        with checkpoint.as_directory() as path:
            bst = xgboost.Booster()
            bst.load_model(os.path.join(path, MODEL_KEY))
            preprocessor_path = os.path.join(path, PREPROCESSOR_KEY)
            if os.path.exists(preprocessor_path):
                with open(preprocessor_path, "rb") as f:
                    preprocessor = cpickle.load(f)
            else:
                preprocessor = None
        return XGBoostPredictor(model=bst, preprocessor=preprocessor)
Instantiate the predictor from a Checkpoint.

        The checkpoint is expected to be a result of ``XGBoostTrainer``.

        Args:
            checkpoint (Checkpoint): The checkpoint to load the model and
                preprocessor from. It is expected to be from the result of a
                ``XGBoostTrainer`` run.

        
Instantiate the predictor from a Checkpoint.
The checkpoint is expected to be a result of ``XGBoostTrainer``.
Instantiate the predictor from a Checkpoint . The checkpoint is expected to be a result of ` ` XGBoostTrainer ` ` .
def from_checkpoint(cls, checkpoint: Checkpoint) -> "XGBoostPredictor":
        with checkpoint.as_directory() as path:
            bst = xgboost.Booster()
            bst.load_model(os.path.join(path, MODEL_KEY))
            preprocessor_path = os.path.join(path, PREPROCESSOR_KEY)
            if os.path.exists(preprocessor_path):
                with open(preprocessor_path, "rb") as f:
                    preprocessor = cpickle.load(f)
            else:
                preprocessor = None
        return XGBoostPredictor(model=bst, preprocessor=preprocessor)
def from_checkpoint ( cls , checkpoint : Checkpoint ) -> "XGBoostPredictor" : with checkpoint . as_directory ( ) as path : bst = xgboost . Booster ( ) bst . load_model ( os . path . join ( path , MODEL_KEY ) ) preprocessor_path = os . path . join ( path , PREPROCESSOR_KEY ) if os . path . exists ( preprocessor_path ) : with open ( preprocessor_path , "rb" ) as f : preprocessor = cpickle . load ( f ) else : preprocessor = None return XGBoostPredictor ( model = bst , preprocessor = preprocessor )
Instantiate the predictor from a Checkpoint.
Instantiate the predictor from a Checkpoint .
"""Instantiate the predictor from a Checkpoint.

        The checkpoint is expected to be a result of ``XGBoostTrainer``.

        Args:
            checkpoint (Checkpoint): The checkpoint to load the model and
                preprocessor from. It is expected to be from the result of a
                ``XGBoostTrainer`` run.

        """
cls
checkpoint
Checkpoint
The checkpoint to load the model and
preprocessor from. It is expected to be from the result of a
``XGBoostTrainer`` run.
The checkpoint to load the model and preprocessor from . It is expected to be from the result of a ` ` XGBoostTrainer ` ` run .