mlrl.testbed_sklearn.experiments.experiment module

Author: Michael Rapp (michael.rapp.ml@gmail.com)

Provides classes for performing experiments using the scikit-learn framework.

class mlrl.testbed_sklearn.experiments.experiment.SkLearnExperiment(args: Namespace, initial_state: ExperimentState, dataset_splitter: DatasetSplitter, training_procedure: TrainingProcedure | None = None, prediction_procedure: PredictionProcedure | None = None)

Bases: Experiment

An experiment that trains and evaluates a machine learning model using the scikit-learn framework.

class Builder(initial_state: ExperimentState, dataset_splitter: DatasetSplitter)

Bases: Builder

Allows to configure and create instances of the class SkLearnExperiment.

class PredictionProcedure(problem_domain: SkLearnProblem)

Bases: PredictionProcedure

Allows to obtain predictions from a scikit-learn estimator.

predict(state: ExperimentState) Generator[PredictionState, None, None]

See mlrl.testbed.experiments.experiment.Experiment.PredictionProcedure.predict()

class TrainingProcedure(base_learner: sklearn.base.BaseEstimator, fit_kwargs: dict[str, Any] | None = None)

Bases: TrainingProcedure

Allows to fit a scikit-learn estimator to a training dataset.

train(learner: Any | None, parameters: dict[str, Any], dataset: Any) TrainingState

See mlrl.testbed.experiments.experiment.Experiment.TrainingProcedure.train()