LGBMHyperParams#
- class openstef_models.models.forecasting.lgbm_forecaster.LGBMHyperParams(*, n_estimators: int = 100, eta: float = 0.49, max_depth: int = 2, min_child_weight: float = 1, min_data_in_leaf: int = 10, min_data_in_bin: int = 10, reg_alpha: float = 0, reg_lambda: float = 1, num_leaves: int = 100, max_bin: int = 256, colsample_bytree: float = 1.0, early_stopping_rounds: int | None = None)[source]
Bases:
HyperParamsLightGBM hyperparameters for gradient boosting tree models.
Example
Creating custom hyperparameters for deep trees with regularization
>>> hyperparams = LGBMHyperParams( ... n_estimators=200, ... max_depth=8, ... learning_rate=0.1, ... reg_alpha=0.1, ... reg_lambda=1.0, ... )
Note
These parameters are optimized for probabilistic forecasting with quantile regression. The default objective function is specialized for magnitude-weighted pinball loss.
- Parameters:
- n_estimators: int
- learning_rate: float
- max_depth: int
- min_child_weight: float
- min_data_in_leaf: int
- min_data_in_bin: int
- reg_alpha: float
- reg_lambda: float
- num_leaves: int
- max_bin: int
- colsample_bytree: float
- classmethod forecaster_class() type[LGBMForecaster][source]
Create a LightGBM forecaster instance from this configuration.
- Return type:
type[LGBMForecaster]- Returns:
Forecaster class associated with this configuration.
- model_config: ClassVar[ConfigDict] = {'arbitrary_types_allowed': False, 'extra': 'ignore', 'protected_namespaces': ()}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].