docstr: :param stop_after: time budget in seconds.
  :param target: name of the target column that the mixer will learn to predict.
  :param dtype_dict: dictionary with dtypes of all columns in the data.
  :param input_cols: list of column names.
  :param fit_on_dev: whether to perform a `partial_fit()` at the end of `fit()` using the `dev` data split.
  :param use_optuna: whether to activate the automated hyperparameter search (optuna-based). Note that setting this flag to `True` does not guarantee the search will run, rather, the speed criteria will be checked first (i.e., if a single iteration is too slow with respect to the time budget, the search will not take place). 
docstr_tok: [":","param","stop_after",":","time","budget","in","seconds",".",":","param","target",":","name","of","the","target","column","that","the","mixer","will","learn","to","predict",".",":","param","dtype_dict",":","dictionary","with","dtypes","of","all","columns","in","the","data",".",":","param","input_cols",":","list","of","column","names",".",":","param","fit_on_dev",":","whether","to","perform","a","`","partial_fit","(",")","`","at","the","end","of","`","fit","(",")","`","using","the","`","dev","`","data","split",".",":","param","use_optuna",":","whether","to","activate","the","automated","hyperparameter","search","(","optuna-based",")",".","Note","that","setting","this","flag","to","`","True","`","does","not","guarantee","the","search","will","run",",","rather",",","the","speed","criteria","will","be","checked","first","(","i.e.",",","if","a","single","iteration","is","too","slow","with","respect","to","the","time","budget",",","the","search","will","not","take","place",")","."]
code: def __init__(
      self,
      stop_after: float,
      target: str,
      dtype_dict: Dict[str, str],
      input_cols: List[str],
      fit_on_dev: bool,
      use_optuna: bool,
      target_encoder: BaseEncoder,
  ):
      """
      :param stop_after: time budget in seconds.
      :param target: name of the target column that the mixer will learn to predict.
      :param dtype_dict: dictionary with dtypes of all columns in the data.
      :param input_cols: list of column names.
      :param fit_on_dev: whether to perform a `partial_fit()` at the end of `fit()` using the `dev` data split.
      :param use_optuna: whether to activate the automated hyperparameter search (optuna-based). Note that setting this flag to `True` does not guarantee the search will run, rather, the speed criteria will be checked first (i.e., if a single iteration is too slow with respect to the time budget, the search will not take place).
      """  # noqa
      super().__init__(stop_after)
      self.model = None
      self.ordinal_encoder = None
      self.positive_domain = False
      self.label_set = set()
      self.target = target
      self.dtype_dict = dtype_dict
      self.input_cols = input_cols
      self.use_optuna = use_optuna
      self.params = {}
      self.fit_on_dev = fit_on_dev
      self.cls_dtypes = [
          dtype.categorical,
          dtype.binary,
          dtype.cat_tsarray,
      ]
      self.float_dtypes = [
          dtype.float,
          dtype.quantity,
          dtype.num_tsarray,
      ]
      self.num_dtypes = [dtype.integer] + self.float_dtypes
      self.supports_proba = dtype_dict[target] in self.cls_dtypes
      self.stable = True
      self.target_encoder = target_encoder
  
      # GPU Only available via --install-option=--gpu with opencl-dev and libboost dev (a bunch of them) installed, so let's turn this off for now and we can put it behind some flag later # noqa
      gpu_works = check_gpu_support()
      if not gpu_works:
          self.device = torch.device("cpu")
          self.device_str = "cpu"
          log.warning(
              "LightGBM running on CPU, this somewhat slower than the GPU version, consider using a GPU instead"
          )  # noqa
      else:
          self.device = torch.device("cuda")
          self.device_str = "gpu"
  
      self.max_bin = 255
  
imports: import time
  import inspect
  from typing import Dict, List, Set, Optional
  import torch
  import optuna
  import lightgbm
  import numpy
  import pandas
  from sklearn.preprocessing import OrdinalEncoder
  import optuna.integration.lightgbm
  from type_infer.dtype import dtype
  from lightwood.encoder.base import BaseEncoder
  from lightwood.helpers.log import log
  from lightwood.mixer.base import BaseMixer
  from lightwood.helpers.device import get_devices
  from lightwood.api.types import PredictionArguments
  from lightwood.data.encoded_ds import EncodedDs
label_desc: Use image node_id 1 to create a new LightGBM object from inherited base classes: BaseMixer with example: obj = LightGBM(stop_after, target, dtype_dict, input_cols, fit_on_dev, use_optuna, target_encoder)