Module mls_lib.model_training.sklearn_model_trainer

SKLModelTrainer: Component that trains and makes predictions.

Classes

class SKLModelTrainer (features: DataFrame, truth: DataFrame, model: Model)

SKLModelTrainer: Component that trains and makes predictions.

Expand source code
class SKLModelTrainer(ModelTrainingStep):
    """ SKLModelTrainer: Component that trains and makes predictions. """
    def __init__(self, features : DataFrame, truth : DataFrame, model : Model) -> None:
        super().__init__(
            features = features,
            truth = truth
        )
        self.step_category = "model_training"
        self.model = model
    def execute(self):
        features = self._get_input('features')
        truth = self._get_input('truth')

        self.model.train(features.get_data(), truth.get_data())

        self._set_output("model", self.model)

        self._finish_execution()

Ancestors

Subclasses

Inherited members