docstr: Updates the LightGBM model.
  
  :param train_data: encoded features for (new) training dataset
  :param dev_data: encoded features for (new) dev dataset
docstr_tok: ["Updates","the","LightGBM","model",".",":","param","train_data",":","encoded","features","for","(","new",")","training","dataset",":","param","dev_data",":","encoded","features","for","(","new",")","dev","dataset"]
code: def partial_fit(
      self,
      train_data: EncodedDs,
      dev_data: EncodedDs,
      args: Optional[dict] = None,
  ) -> None:
      """
      Updates the LightGBM model.
  
      :param train_data: encoded features for (new) training dataset
      :param dev_data: encoded features for (new) dev dataset
      """
      pct_of_original = len(train_data) / self.fit_data_len
      iterations = max(
          1, int(self.num_iterations * pct_of_original) / 2
      )
  
      data = {
          "retrain": {"ds": train_data, "data": None, "label_data": {}},
          "dev": {"ds": dev_data, "data": None, "label_data": {}},
      }
  
      output_dtype = self.dtype_dict[self.target]
      data = self._to_dataset(data, output_dtype)
  
      train_dataset = lightgbm.Dataset(
          data["retrain"]["data"],
          label=data["retrain"]["label_data"],
          weight=data["retrain"]["weights"],
      )
      dev_dataset = lightgbm.Dataset(
          data["dev"]["data"],
          label=data["dev"]["label_data"],
          weight=data["dev"]["weights"],
      )
  
      log.info(f"Updating lightgbm model with {iterations} iterations")
      self.params["num_iterations"] = int(iterations)
  
      kwargs = {}
      if "verbose_eval" in inspect.getfullargspec(lightgbm.train).args:
          kwargs["verbose_eval"] = False
  
      self.model = lightgbm.train(
          self.params,
          train_dataset,
          valid_sets=[dev_dataset, train_dataset],
          valid_names=["dev", "retrain"],
          init_model=self.model,
          **kwargs,
      )
      log.info(
          f"Model now has a total of {self.model.num_trees()} weak estimators"
      )
  
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 4 for calling the LightGBM obj's underlying member method code with example usage: obj.partial_fit(train_data, dev_data, args) without return types