class_docstr: A Trainer for data parallel XGBoost training.
  
  This Trainer runs the XGBoost training loop in a distributed manner
  using multiple Ray Actors.
  
  .. note::
      ``XGBoostTrainer`` does not modify or otherwise alter the working
      of the XGBoost distributed training algorithm.
      Ray only provides orchestration, data ingest and fault tolerance.
      For more information on XGBoost distributed training, refer to
      `XGBoost documentation <https://xgboost.readthedocs.io>`__.
  
  Example:
      .. testcode::
  
          import ray
  
          from ray.train.xgboost import XGBoostTrainer
          from ray.train import ScalingConfig
  
          train_dataset = ray.data.from_items(
              [{"x": x, "y": x + 1} for x in range(32)])
          trainer = XGBoostTrainer(
              label_column="y",
              params={"objective": "reg:squarederror"},
              scaling_config=ScalingConfig(num_workers=3),
              datasets={"train": train_dataset}
          )
          result = trainer.fit()
  
      .. testoutput::
          :hide:
  
          ...
  
  Args:
      datasets: The Ray Datasets to use for training and validation. Must include a
          "train" key denoting the training dataset. All non-training datasets will
          be used as separate validation sets, each reporting a separate metric.
      label_column: Name of the label column. A column with this name
          must be present in the training dataset.
      params: XGBoost training parameters.
          Refer to `XGBoost documentation <https://xgboost.readthedocs.io/>`_
          for a list of possible parameters.
      dmatrix_params: Dict of ``dataset name:dict of kwargs`` passed to respective
          :class:`xgboost_ray.RayDMatrix` initializations, which in turn are passed
          to ``xgboost.DMatrix`` objects created on each worker. For example, this can
          be used to add sample weights with the ``weight`` parameter.
      num_boost_round: Target number of boosting iterations (trees in the model).
          Note that unlike in ``xgboost.train``, this is the target number
          of trees, meaning that if you set ``num_boost_round=10`` and pass a model
          that has already been trained for 5 iterations, it will be trained for 5
          iterations more, instead of 10 more.
      scaling_config: Configuration for how to scale data parallel training.
      run_config: Configuration for the execution of the training run.
      resume_from_checkpoint: A checkpoint to resume training from.
      metadata: Dict that should be made available in `checkpoint.get_metadata()`
          for checkpoints saved from this Trainer. Must be JSON-serializable.
      **train_kwargs: Additional kwargs passed to ``xgboost.train()`` function.
class_docstr_tok: ["A","Trainer","for","data","parallel","XGBoost","training",".","This","Trainer","runs","the","XGBoost","training","loop","in","a","distributed","manner","using","multiple","Ray","Actors",".","..","note",":",":","``","XGBoostTrainer","``","does","not","modify","or","otherwise","alter","the","working","of","the","XGBoost","distributed","training","algorithm",".","Ray","only","provides","orchestration",",","data","ingest","and","fault","tolerance",".","For","more","information","on","XGBoost","distributed","training",",","refer","to","`","XGBoost","documentation","<","https",":","\/\/xgboost.readthedocs.io",">","`","__",".","Example",":","..","testcode",":",":","import","ray","from","ray.train.xgboost","import","XGBoostTrainer","from","ray.train","import","ScalingConfig","train_dataset","=","ray.data.from_items","(","[","{","``","x","''",":","x",",","``","y","''",":","x","+","1","}","for","x","in","range","(","32",")","]",")","trainer","=","XGBoostTrainer","(","label_column=","''","y","''",",","params=","{","``","objective","''",":","``","reg",":","squarederror","''","}",",","scaling_config=ScalingConfig","(","num_workers=3",")",",","datasets=","{","``","train","''",":","train_dataset","}",")","result","=","trainer.fit","(",")","..","testoutput",":",":",":","hide",":","...","Args",":","datasets",":","The","Ray","Datasets","to","use","for","training","and","validation",".","Must","include","a","``","train","''","key","denoting","the","training","dataset",".","All","non-training","datasets","will","be","used","as","separate","validation","sets",",","each","reporting","a","separate","metric",".","label_column",":","Name","of","the","label","column",".","A","column","with","this","name","must","be","present","in","the","training","dataset",".","params",":","XGBoost","training","parameters",".","Refer","to","`","XGBoost","documentation","<","https",":","\/\/xgboost.readthedocs.io\/",">","`","_","for","a","list","of","possible","parameters",".","dmatrix_params",":","Dict","of","``","dataset","name",":","dict","of","kwargs","``","passed","to","respective",":","class",":","`","xgboost_ray.RayDMatrix","`","initializations",",","which","in","turn","are","passed","to","``","xgboost.DMatrix","``","objects","created","on","each","worker",".","For","example",",","this","can","be","used","to","add","sample","weights","with","the","``","weight","``","parameter",".","num_boost_round",":","Target","number","of","boosting","iterations","(","trees","in","the","model",")",".","Note","that","unlike","in","``","xgboost.train","``",",","this","is","the","target","number","of","trees",",","meaning","that","if","you","set","``","num_boost_round=10","``","and","pass","a","model","that","has","already","been","trained","for","5","iterations",",","it","will","be","trained","for","5","iterations","more",",","instead","of","10","more",".","scaling_config",":","Configuration","for","how","to","scale","data","parallel","training",".","run_config",":","Configuration","for","the","execution","of","the","training","run",".","resume_from_checkpoint",":","A","checkpoint","to","resume","training","from",".","metadata",":","Dict","that","should","be","made","available","in","`","checkpoint.get_metadata","(",")","`","for","checkpoints","saved","from","this","Trainer",".","Must","be","JSON-serializable",".","*","*","train_kwargs",":","Additional","kwargs","passed","to","``","xgboost.train","(",")","``","function","."]
code: def _load_checkpoint(self, checkpoint: Checkpoint) -> xgboost.Booster:
      return self.__class__.get_model(checkpoint)
  
file_path: ray/python/ray/train/xgboost/xgboost_trainer.py
imports: import os
  from typing import Any, Dict
  import xgboost
  import xgboost_ray
  from xgboost_ray.tune import TuneReportCheckpointCallback
  from ray.train import Checkpoint
  from ray.train.gbdt_trainer import GBDTTrainer
  from ray.train.xgboost import XGBoostCheckpoint
  from ray.util.annotations import PublicAPI
label_desc: Use image node_id 3 for calling the XGBoostTrainer obj's underlying member method code with example usage: obj._load_checkpoint(checkpoint) and returns: self