torch_frame.gbdt.LightGBM

class LightGBM(task_type: TaskType, num_classes: Optional[int] = None, metric: Optional[Metric] = None)[source]

Bases: GBDT

LightGBM implementation with hyper-parameter tuning using Optuna.

This implementation extends GBDT and aims to find optimal hyperparameters by optimizing the given objective function.

objective(trial: Any, train_data: Any, eval_data: Any, num_boost_round: int) float[source]

Objective function to be optimized.

Parameters:
  • trial (optuna.trial.Trial) – Optuna trial object.

  • train_data (lightgbm.Dataset) – Train data.

  • eval_data (lightgbm.Dataset) – Validation data.

  • num_boost_round (int) – Number of boosting round.

Returns:

Best objective value. Mean absolute error for regression task and accuracy for classification task.

Return type:

float