cursus.steps.hyperparams.hyperparameters_lightgbm¶
- class LightGBMModelHyperparameters(*, full_field_list, cat_field_list, tab_field_list, id_name, label_name, multiclass_categories, categorical_features_to_encode=<factory>, model_class='lightgbm', 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, num_leaves, learning_rate, 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, min_data_per_group=100, cat_smooth=10.0, max_cat_threshold=32, use_native_categorical=True, **extra_data)[source]¶
Bases:
ModelHyperparametersHyperparameters for the LightGBM model training, extending the base ModelHyperparameters.
Fields are organized into three tiers: 1. Tier 1: Essential User Inputs - fields that users must explicitly provide 2. Tier 2: System Inputs with Defaults - fields with reasonable defaults that can be overridden 3. Tier 3: Derived Fields - fields calculated from other fields (private attributes with properties)
- 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].
- get_public_init_fields()[source]¶
Override get_public_init_fields to include LightGBM-specific fields. Gets a dictionary of public fields suitable for initializing a child config.
- 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.