mlrl.testbed_sklearn.experiments.prediction package¶
Author Michael Rapp (michael.rapp.ml@gmail.com)
Provides classes that allow to obtain predictions from by a machine learning model.
- class mlrl.testbed_sklearn.experiments.prediction.GlobalPredictor(prediction_type: PredictionType)¶
Bases:
PredictorObtains predictions from a previously trained global model.
- obtain_predictions(learner: Any, dataset: Any, dataset_type: DatasetType, **kwargs) Generator[PredictionState, None, None]¶
See
mlrl.testbed_sklearn.experiments.prediction.predictor.Predictor.obtain_predictions()
- class mlrl.testbed_sklearn.experiments.prediction.Predictor(prediction_type: PredictionType)¶
Bases:
ABCAn abstract base class for all classes that allow to obtain predictions from a previously trained model.
- abstractmethod obtain_predictions(learner: Any, dataset: Any, dataset_type: DatasetType, **kwargs) Generator[PredictionState, None, None]¶
Obtains predictions from a previously trained learner once or several times.
- Parameters:
learner – The learner
dataset – The dataset that contains the query examples
dataset_type – The type of the dataset
kwargs – Optional keyword arguments to be passed to the learner when obtaining predictions
- Returns:
A generator that provides access to the results of the individual prediction processes