class_docstr: Callback for LightGBM to prune unpromising trials.
  
  See `the example <https://github.com/optuna/optuna-examples/blob/main/
  lightgbm/lightgbm_integration.py>`__
  if you want to add a pruning callback which observes accuracy
  of a LightGBM model.
  
  Args:
      trial:
          A :class:`~optuna.trial.Trial` corresponding to the current evaluation of
          the objective function.
      metric:
          An evaluation metric for pruning, e.g., ``binary_error`` and ``multi_error``.
          Please refer to
          `LightGBM reference
          <https://lightgbm.readthedocs.io/en/latest/Parameters.html#metric>`_
          for further details.
      valid_name:
          The name of the target validation.
          Validation names are specified by ``valid_names`` option of
          `train method
          <https://lightgbm.readthedocs.io/en/latest/Python-API.html#lightgbm.train>`_.
          If omitted, ``valid_0`` is used which is the default name of the first validation.
          Note that this argument will be ignored if you are calling
          `cv method <https://lightgbm.readthedocs.io/en/latest/Python-API.html#lightgbm.cv>`_
          instead of train method.
      report_interval:
          Check if the trial should report intermediate values for pruning every n-th boosting
          iteration. By default ``report_interval=1`` and reporting is performed after every
          iteration. Note that the pruning itself is performed according to the interval
          definition of the pruner.
code: def __init__(
      self,
      trial: optuna.trial.Trial,
      metric: str,
      valid_name: str = "valid_0",
      report_interval: int = 1,
  ) -> None:
      _imports.check()
  
      self._trial = trial
      self._valid_name = valid_name
      self._metric = metric
      self._report_interval = report_interval
  
file_path: optuna/optuna/integration/lightgbm.py
imports: from __future__ import annotations
  import sys
  from typing import TYPE_CHECKING
  import optuna
  from optuna._imports import try_import
  from optuna.integration import _lightgbm_tuner
label_desc: Use image node_id 1 to create a new LightGBMPruningCallback object  with example: obj = LightGBMPruningCallback(trial, metric, valid_name, report_interval)