RFCombinerHyperParams#

class openstef_meta.models.forecast_combiners.RFCombinerHyperParams(*, n_estimators: int = 20, n_leaves: int = 31, bagging_freq: int = 1, bagging_fraction: float = 0.8, feature_fraction: float = 1)[source]

Bases: HyperParams

Hyperparameters for the LGBM random-forest classifier.

Parameters:
  • n_estimators (int)

  • n_leaves (int)

  • bagging_freq (int)

  • bagging_fraction (float)

  • feature_fraction (float)

n_estimators: int
n_leaves: int
bagging_freq: int
bagging_fraction: float
feature_fraction: float
get_classifier() → ClassifierMixin[source]

Create an LGBM random-forest classifier from these hyperparameters.

Return type:

ClassifierMixin

Returns:

Configured LGBMClassifier instance in random-forest mode.

Raises:

MissingExtraError – If lightgbm is not installed.

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].

model_post_init(context: Any, /) → None

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.

Return type:

None