automl / amltk

A build-it-yourself AutoML Framework
https://automl.github.io/amltk/
BSD 3-Clause "New" or "Revised" License
62 stars 4 forks source link

[Feature] A dedicated `models` attribute for Trials #259

Open eddiebergman opened 7 months ago

eddiebergman commented 7 months ago

Is your feature request related to a problem? Please describe. It's come up a few times that essentially I would like a dedicated interface for "give me the models for this report".

Describe the solution you'd like Ideally something that you can store a model such as:

trial.store({f"model_{i}.pkl": model})

And retrieve it later from the report as

stored_models: dict[str, Stored[Any]] = report.models
models = {model_name: stored_model.load() for model_name, stored_model in report.models.items()]

The above description isn't enough in trial.store() to know that this item is specifically a model that should be put in report.models. This means we need to do one of two things:

trial.store_model({f"model_{i}.pkl": model})
# Or
trial.store({f"model_{i}.pkl": model}, tag="model")

The second is more flexible as we could essentially provide tagged items in a store but I am afraid that this feature ends up opening up another whole can of worms. As a result, I think the first approach is more scoped.

Describe alternatives you've considered The current alternative is just having no report.models attribute and manually mapping between. This workaround works absolutely fine but prevents some higher level automations from occuring unless there's a stringly based interface