class_docstr: Abstract class for scaling gradient-boosting decision tree (GBDT) frameworks.
  
  Inherited by XGBoostTrainer and LightGBMTrainer.
  
  Args:
      datasets: 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: Framework specific training parameters.
      dmatrix_params: Dict of ``dataset name:dict of kwargs`` passed to respective
          :class:`xgboost_ray.RayDMatrix` initializations.
      num_boost_round: Target number of boosting iterations (trees in the model).
      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 framework ``train()`` function.
code: def __init__(
      self,
      *,
      datasets: Dict[str, GenDataset],
      label_column: str,
      params: Dict[str, Any],
      dmatrix_params: Optional[Dict[str, Dict[str, Any]]] = None,
      num_boost_round: int = _DEFAULT_NUM_ITERATIONS,
      scaling_config: Optional[ScalingConfig] = None,
      run_config: Optional[RunConfig] = None,
      preprocessor: Optional["Preprocessor"] = None,  # Deprecated
      resume_from_checkpoint: Optional[Checkpoint] = None,
      metadata: Optional[Dict[str, Any]] = None,
      **train_kwargs,
  ):
      self.label_column = label_column
      self.params = params
  
      self.num_boost_round = num_boost_round
      self.train_kwargs = train_kwargs
      self.dmatrix_params = dmatrix_params or {}
  
      super().__init__(
          scaling_config=scaling_config,
          run_config=run_config,
          datasets=datasets,
          preprocessor=preprocessor,
          resume_from_checkpoint=resume_from_checkpoint,
          metadata=metadata,
      )
  
      # Datasets should always use distributed loading.
      for dataset_name in self.datasets.keys():
          dataset_params = self.dmatrix_params.get(dataset_name, {})
          dataset_params["distributed"] = True
          self.dmatrix_params[dataset_name] = dataset_params
  
imports: import logging
  import os
  import tempfile
  import warnings
  from dataclasses import dataclass
  from typing import TYPE_CHECKING, Any, Dict, Optional, Type
  from ray import train, tune
  from ray._private.dict import flatten_dict
  from ray.train import Checkpoint, RunConfig, ScalingConfig
  from ray.train.constants import MODEL_KEY, TRAIN_DATASET_KEY
  from ray.train.trainer import BaseTrainer, GenDataset
  from ray.tune import Trainable
  from ray.tune.execution.placement_groups import PlacementGroupFactory
  from ray.util.annotations import DeveloperAPI
label_desc: Use image node_id 1 to create a new GBDTTrainer object from inherited base classes: BaseTrainer with example: obj = GBDTTrainer()