class_docstr: Implementation of the scikit-learn API for LightGBM.
class_docstr_tok: ["Implementation","of","the","scikit-learn","API","for","LightGBM","."]
docstr: Process the parameters of this estimator based on its type, parameter aliases, etc.
  
  Parameters
  ----------
  stage : str
      Name of the stage (can be ``fit`` or ``predict``) this method is called from.
  
  Returns
  -------
  processed_params : dict
      Processed parameter names mapped to their values.
code: def _process_params(self, stage: str) -> Dict[str, Any]:
      """Process the parameters of this estimator based on its type, parameter aliases, etc.
  
      Parameters
      ----------
      stage : str
          Name of the stage (can be ``fit`` or ``predict``) this method is called from.
  
      Returns
      -------
      processed_params : dict
          Processed parameter names mapped to their values.
      """
      assert stage in {"fit", "predict"}
      params = self.get_params()
  
      params.pop("objective", None)
      for alias in _ConfigAliases.get("objective"):
          if alias in params:
              obj = params.pop(alias)
              _log_warning(
                  f"Found '{alias}' in params. Will use it instead of 'objective' argument"
              )
              if stage == "fit":
                  self._objective = obj
      if stage == "fit":
          if self._objective is None:
              if isinstance(self, LGBMRegressor):
                  self._objective = "regression"
              elif isinstance(self, LGBMClassifier):
                  if self._n_classes > 2:
                      self._objective = "multiclass"
                  else:
                      self._objective = "binary"
              elif isinstance(self, LGBMRanker):
                  self._objective = "lambdarank"
              else:
                  raise ValueError("Unknown LGBMModel type.")
      if callable(self._objective):
          if stage == "fit":
              params["objective"] = _ObjectiveFunctionWrapper(
                  self._objective
              )
          else:
              params["objective"] = "None"
      else:
          params["objective"] = self._objective
  
      params.pop("importance_type", None)
      params.pop("n_estimators", None)
      params.pop("class_weight", None)
  
      if isinstance(params["random_state"], np.random.RandomState):
          params["random_state"] = params["random_state"].randint(
              np.iinfo(np.int32).max
          )
      elif isinstance(params["random_state"], np_random_Generator):
          params["random_state"] = int(
              params["random_state"].integers(np.iinfo(np.int32).max)
          )
      if self._n_classes > 2:
          for alias in _ConfigAliases.get("num_class"):
              params.pop(alias, None)
          params["num_class"] = self._n_classes
      if hasattr(self, "_eval_at"):
          eval_at = self._eval_at
          for alias in _ConfigAliases.get("eval_at"):
              if alias in params:
                  _log_warning(
                      f"Found '{alias}' in params. Will use it instead of 'eval_at' argument"
                  )
                  eval_at = params.pop(alias)
          params["eval_at"] = eval_at
  
      # register default metric for consistency with callable eval_metric case
      original_metric = (
          self._objective if isinstance(self._objective, str) else None
      )
      if original_metric is None:
          # try to deduce from class instance
          if isinstance(self, LGBMRegressor):
              original_metric = "l2"
          elif isinstance(self, LGBMClassifier):
              original_metric = (
                  "multi_logloss"
                  if self._n_classes > 2
                  else "binary_logloss"
              )
          elif isinstance(self, LGBMRanker):
              original_metric = "ndcg"
  
      # overwrite default metric by explicitly set metric
      params = _choose_param_value("metric", params, original_metric)
  
      # use joblib conventions for negative n_jobs, just like scikit-learn
      # at predict time, this is handled later due to the order of parameter updates
      if stage == "fit":
          params = _choose_param_value(
              "num_threads", params, self.n_jobs
          )
          params["num_threads"] = self._process_n_jobs(
              params["num_threads"]
          )
  
      return params
  
imports: import copy
  from inspect import signature
  from pathlib import Path
  from typing import Any, Callable, Dict, List, Optional, Tuple, Union
  import numpy
  import scipy.sparse
  from .basic import Booster, Dataset, LightGBMError, _choose_param_value, _ConfigAliases, _LGBM_BoosterBestScoreType, _LGBM_CategoricalFeatureConfiguration, _LGBM_EvalFunctionResultType, _LGBM_FeatureNameConfiguration, _LGBM_GroupType, _LGBM_InitScoreType, _LGBM_LabelType, _LGBM_WeightType, _log_warning
  from .callback import _EvalResultDict, record_evaluation
  from .compat import SKLEARN_INSTALLED, LGBMNotFittedError, _LGBMAssertAllFinite, _LGBMCheckArray, _LGBMCheckClassificationTargets, _LGBMCheckSampleWeight, _LGBMCheckXY, _LGBMClassifierBase, _LGBMComputeSampleWeight, _LGBMCpuCount, _LGBMLabelEncoder, _LGBMModelBase, _LGBMRegressorBase, dt_DataTable, np_random_Generator, pd_DataFrame
  from .engine import train
label_desc: Use image node_id 6 for calling the LGBMModel obj's underlying member method code with example usage: obj._process_params(stage) and returns: params