Train

This module was created to accelerate how users define their training pipelines. They will always inherit the base Train object to:

  • train_definition: Define the actions to train

  • run: Orchestrate how to run the training pipeline

PyfuncTrain

This class extends the Train object, and should be used when the user wants to log a customized model with MLFlow, by using the PyFunc flavor. It also guarantees the user will define how to log their metrics, parameters and model.

from pyiris.intelligence.models import BaseIrisModel
from pyiris.intelligence.train.pyfunc_train import PyfuncTrain


model_object = BaseIrisModel()
metrics_dict = {"accuracy": 0.93}
params_dict = {"n_trees": 2}


train_pipeline = PyfuncTrain(
        model=model_object,
        metrics_dict=metrics_dict,
        params_dict=params_dict,
        conda_env="conda.yaml"
    )

if __name__ == "__main__":
    train_pipeline.run()