mltune.wrappers package

Module contents

class mltune.wrappers.RandomForestModelWrapper(hyperparameters=None, features=None)[source]

Bases: BaseModelWrapper

Wrapper for sklearn.ensemble.RandomForestClassifier.

Initializes the underlying RandomForestClassifier with given hyperparameters.

Parameters:
  • hyperparameters (dict of str to Any) – Model hyperparameters to configure RandomForestClassifier.

  • features (list of str) – List of feature names to use during training and prediction.

get_model_factory()[source]

Returns a factory function that creates new RandomForestClassifier instances.

Returns:

A factory function: dynamic_params → model instance.

Return type:

Callable[[dict[str, Any]], Any]

class mltune.wrappers.XGBoostModelWrapper(hyperparameters=None, features=None)[source]

Bases: BaseModelWrapper

Wrapper for xgboost.XGBClassifier.

Initializes the underlying XGBClassifier with given hyperparameters.

Parameters:
  • hyperparameters (dict of str to Any) – Model hyperparameters to configure RandomForestClassifier.

  • features (list of str) – List of feature names to use during training and prediction.

get_model_factory()[source]

Returns a factory function that creates new XGBClassifier instances.

Returns:

A factory function: dynamic_params → model instance.

Return type:

Callable[[dict[str, Any]], Any]

class mltune.wrappers.LightGBMModelWrapper(hyperparameters=None, features=None)[source]

Bases: BaseModelWrapper

Wrapper for lightgbm.LGBMClassifier.

Initializes the underlying LGBMClassifier with given hyperparameters.

Parameters:
  • hyperparameters (dict of str to Any) – Model hyperparameters to configure RandomForestClassifier.

  • features (list of str) – List of feature names to use during training and prediction.

get_model_factory()[source]

Returns a factory function that creates new LGBMClassifier instances.

Returns:

A factory function: dynamic_params → model instance.

Return type:

Callable[[dict[str, Any]], Any]