class_docstr: Check for overfit caused by using too many iterations in a gradient boosted model.
  
  The check runs a pre-defined number of steps, and in each step it limits the boosting model to use up to X
  estimators (number of estimators is monotonic increasing). It plots the given score calculated for each step for
  both the train dataset and the test dataset.
  
  Parameters
  ----------
  scorer : Union[Callable, str] , default: None
      Scorer used to verify the model, either function or sklearn scorer name.
  scorer_name : str , default: None
      Name to be displayed in the plot on y-axis. must be used together with 'scorer'
  num_steps : int , default: 20
      Number of splits of the model iterations to check.
  n_samples : int , default: 1_000_000
      number of samples to use for this check.
  random_state : int, default: 42
      random seed for all check internals.
code: def __init__(
      self,
      alternative_scorer: Tuple[str, Union[str, Callable]] = None,
      num_steps: int = 20,
      n_samples: int = 1_000_000,
      random_state: int = 42,
      **kwargs,
  ):
      super().__init__(**kwargs)
      self.alternative_scorer = (
          dict([alternative_scorer]) if alternative_scorer else None
      )
      self.num_steps = num_steps
      self.n_samples = n_samples
      self.random_state = random_state
  
      if not isinstance(self.num_steps, int) or self.num_steps < 2:
          raise DeepchecksValueError(
              "num_steps must be an integer larger than 1"
          )
  
imports: from copy import deepcopy
  from typing import TYPE_CHECKING, Callable, Tuple, Union
  import numpy
  import plotly.graph_objects
  from sklearn.pipeline import Pipeline
  from deepchecks.core import CheckResult, ConditionCategory, ConditionResult
  from deepchecks.core.errors import DeepchecksValueError, ModelValidationError
  from deepchecks.tabular import Context, TrainTestCheck
  from deepchecks.utils.docref import doclink
  from deepchecks.utils.model import get_model_of_pipeline
  from deepchecks.utils.strings import format_percent
label_desc: Use image node_id 1 to create a new BoostingOverfit object from inherited base classes: TrainTestCheck with example: obj = BoostingOverfit(alternative_scorer, num_steps, n_samples, random_state)