Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make MlflowMetricsDataSet capable of saving a Dict[str, float] object, as mlflow.log_metrics() does #440

Open
yury-fedotov opened this issue Aug 2, 2023 · 2 comments
Labels
enhancement New feature or request

Comments

@yury-fedotov
Copy link

yury-fedotov commented Aug 2, 2023

Description

At the moment MlflowMetricsDataSet can only save an object which is a nested Dict. For example:

{
    "metric1": {"value": 1.1, "step": 1},
    "metric2": [{"value": 1.1, "step": 1}, {"value": 1.2, "step": 2}],
}

However, it cannot save an object like this:

{
    "metric1": 1.1,
    "metric2": 1.2,
}

Which is frequently used and e.g. mlflow's native log_metrics() API deals fine with it.

Context

Having this support would be great to:

  • Make MlflowMetricsDataSet more compatible with mlflow.log_metrics()
  • Allow users to save simple non-nested Dict, without the need to convert it to nested format.

Possible Implementation

Either add a new Dataset or handle this within existing MlflowMetricsDataSet.

@yury-fedotov
Copy link
Author

P.S. I read about flatten and recursive settings in mlflow.yml, but at least to my understanding those serve other purposes than the one I described above.

@Galileo-Galilei
Copy link
Owner

Hi, this is indeed really something needed and it's been on my to do liste for a long time. As for MlflowMetricDataSet we should likely modify MlflowMetricsDataSet to have suggested behaviour and move the existing behaviour to a new MlflowMetricsHistoryDataSet.

The reason why it is done like this currently is to maintain consistency between save and load method but I acknowledge that the user experience is a pain.

Feel free to open a PR to help this getting real ;)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants