class_docstr: LightGBM Model
class_docstr_tok: ["LightGBM","Model"]
code: def predict(
      self, dataset: DatasetH, segment: Union[Text, slice] = "test"
  ):
      if self.model is None:
          raise ValueError("model is not fitted yet!")
      x_test = dataset.prepare(
          segment, col_set="feature", data_key=DataHandlerLP.DK_I
      )
      return pd.Series(
          self.model.predict(x_test.values), index=x_test.index
      )
  
file_path: qlib/qlib/contrib/model/gbdt.py
imports: import numpy
  import pandas
  import lightgbm
  from typing import List, Text, Tuple, Union
  from ...model.base import ModelFT
  from ...data.dataset import DatasetH
  from ...data.dataset.handler import DataHandlerLP
  from ...model.interpret.base import LightGBMFInt
  from ...data.dataset.weight import Reweighter
  from qlib.workflow import R
label_desc: Use image node_id 4 for calling the LGBModel obj's underlying member method code with example usage: obj.predict(dataset, segment) and returns: pd