cursus.steps.hyperparams.hyperparameters_lightgbmmt

Hyperparameters for LightGBMMT (Multi-Task) model training.

Extends ModelHyperparameters directly with complete LightGBM and multi-task parameters.

class LightGBMMtModelHyperparameters(*, full_field_list, cat_field_list, tab_field_list, id_name, label_name, multiclass_categories, categorical_features_to_encode=<factory>, model_class='lightgbmmt', device=-1, header=0, lr=3e-05, batch_size=2, eval_batch_size_multiplier=2.0, max_epochs=3, metric_choices=['f1_score', 'auroc'], optimizer='SGD', class_weights=None, task_label_names, main_task_index, num_leaves=31, learning_rate=0.1, boosting_type='gbdt', num_iterations=100, max_depth=-1, min_data_in_leaf=20, min_sum_hessian_in_leaf=0.001, feature_fraction=1.0, bagging_fraction=1.0, bagging_freq=0, lambda_l1=0.0, lambda_l2=0.0, min_gain_to_split=0.0, categorical_feature=None, early_stopping_rounds=None, seed=None, loss_type='adaptive', loss_epsilon=1e-15, loss_epsilon_norm=0.0, loss_similarity_min_distance=0.0, loss_beta=0.2, loss_main_task_weight=1.0, loss_weight_lr=1.0, loss_patience=100, loss_weight_method=None, loss_weight_update_frequency=10, loss_delta_lr=0.01, loss_normalize_gradients=True, **extra_data)[source]

Bases: ModelHyperparameters

Hyperparameters for LightGBMMT (Multi-Task) model training.

Extends ModelHyperparameters directly (not LightGBMModelHyperparameters). Includes complete LightGBM parameters plus multi-task specific parameters. All loss function parameters are prefixed with ‘loss_’ to avoid naming conflicts.

Follows three-tier hyperparameter pattern: - Tier 1: Essential User Inputs (from ModelHyperparameters + LightGBM essentials) - Tier 2: System Inputs with Defaults (LightGBM + MT-specific parameters) - Tier 3: Derived Fields (enable_kd computed from loss_type, num_tasks from task_label_names)

Design Notes: - No separate LossConfig class - all loss parameters integrated here - Loss functions receive this hyperparameters object directly - Training parameters (max_epochs, batch_size) inherited from base - No TrainingConfig class - only TrainingState for runtime tracking

task_label_names: list[str]
main_task_index: int
model_class: str
num_leaves: int
learning_rate: float
boosting_type: str
num_iterations: int
max_depth: int
min_data_in_leaf: int
min_sum_hessian_in_leaf: float
feature_fraction: float
bagging_fraction: float
bagging_freq: int
lambda_l1: float
lambda_l2: float
min_gain_to_split: float
categorical_feature: str | None
early_stopping_rounds: int | None
seed: int | None
loss_type: Literal['fixed', 'adaptive', 'adaptive_kd']
loss_epsilon: float
loss_epsilon_norm: float
loss_similarity_min_distance: float
loss_beta: float
loss_main_task_weight: float
loss_weight_lr: float
loss_patience: int
loss_weight_method: Literal['tenIters', 'sqrt', 'delta', 'ema'] | None
loss_weight_update_frequency: int
loss_delta_lr: float
loss_normalize_gradients: bool
property num_tasks: int

Get number of tasks derived from task_label_names.

property enable_kd: bool

Whether knowledge distillation is enabled (derived from loss_type).

property objective: str

Get objective derived from is_binary.

property metric: list

Get evaluation metrics derived from is_binary.

validate_mt_hyperparameters()[source]

Validate multi-task and LightGBM-specific hyperparameters.

get_public_init_fields()[source]

Override to include MT-specific and LightGBM-specific derived fields.

model_config: ClassVar[ConfigDict] = {'arbitrary_types_allowed': True, 'extra': 'allow', 'protected_namespaces': (), 'validate_assignment': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

model_post_init(context, /)

This function is meant to behave like a BaseModel method to initialize private attributes.

It takes context as an argument since that’s what pydantic-core passes when calling it.

Parameters:
  • self (BaseModel) – The BaseModel instance.

  • context (Any) – The context.

full_field_list: List[str]
cat_field_list: List[str]
tab_field_list: List[str]
id_name: str
label_name: str
multiclass_categories: List[int | str]
categorical_features_to_encode: List[str]
device: int
header: int
lr: float
batch_size: int
eval_batch_size_multiplier: float
max_epochs: int
metric_choices: List[str]
optimizer: str
class_weights: List[float] | None