-
Notifications
You must be signed in to change notification settings - Fork 103
Description
In the past, we had many discussions where @GaelVaroquaux or myself complain with the needs to use .put and specified the name of an item to store it (and get it).
I came #949 to mention that I wanted my CrossValidationReport accessible from project such that this operation happen. However, one limitation as mentioned by @auguste-probabl is that native Python type cannot benefit from this API. There is also discussion that you can use the same class into different ways that could be confusing.
In an IRL with @adrinjalali, an API that seems much better would be to have a dict/Bunch UX to deal with this use case:
project.put("my_int, 1)would be replaced by:
project.artifacts.my_int = 1
or for a report
report = CrossValidationReport(...)
project.put("estimator_report, report)would be replaced by:
project.artifacts.estimator_report = CrossValidateRerport(...)To access, the latest version of an items:
# pushing to the extreme without storing the artifact in another variable
project.artifacts.estimator_report.metrics.roc.plot()would work.
All of those would work if we consider that skore.open set implicitly the "run" for which we store and access the items. We would still need .get if one wants to access an item from a different run where we come back to the discussion on having skore.get_metadata or similar to be able to query the database.