mlrl.testbed_sklearn.runnables module¶
Author: Michael Rapp (michael.rapp.ml@gmail.com)
Provides classes for running experiments using the scikit-learn framework.
- class mlrl.testbed_sklearn.runnables.SkLearnRunnable¶
-
An abstract base class for all programs that run an experiment using the scikit-learn framework.
- class GlobalPredictorFactory(prediction_type: PredictionType)¶
Bases:
PredictorFactoryAllow to create instances of type Predictor that obtain predictions from a global model.
- class ProblemDomainExtension¶
Bases:
ExtensionAn extension that configures the problem domain.
- PROBLEM_TYPE = <mlrl.util.cli.SetArgument object>¶
- static get_problem_domain(args: Namespace, runnable: SkLearnRunnable, fit_kwargs: Dict[str, Any] | None = None, predict_kwargs: Dict[str, Any] | None = None) ProblemDomain¶
Returns the problem domain that should be tackled by an experiment.
- Parameters:
args – The command line arguments specified by the user
runnable – The SkLearnRunnable that is used to run the experiment
fit_kwargs – Optional keyword arguments to be passed to the estimator’s predict function
predict_kwargs – Optional keyword arguments to be passed to the estimator’s fit function
- Returns:
The problem domain that should be tackled by the experiment
- abstractmethod create_classifier(args: Namespace) ClassifierMixin | None¶
Must be implemented by subclasses in order to create a machine learning algorithm that can be applied to classification problems.
- Parameters:
args – The command line arguments
- Returns:
The learner that has been created or None, if regression problems are not supported
- create_experiment_builder(args: Namespace) Builder¶
See
mlrl.testbed.runnables.Runnable.create_experiment_builder()
- create_predictor_factory(args: Namespace, prediction_type: PredictionType) PredictorFactory¶
May be overridden by subclasses in order to create the SkLearnProblem.PredictorFactory that should be used for obtaining predictions from a previously trained model.
- Parameters:
args – The command line arguments
prediction_type – The type of the predictions to be obtained
- Returns:
The SkLearnProblem.PredictorFactory that has been created
- abstractmethod create_regressor(args: Namespace) RegressorMixin | None¶
Must be implemented by subclasses in order to create a machine learning algorithm that can be applied to regression problems.
- Parameters:
args – The command line arguments
- Returns:
The learner that has been created or None, if regression problems are not supported