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

feat: ibis_ml.metrics #174

Open
IndexSeek opened this issue Nov 16, 2024 · 1 comment
Open

feat: ibis_ml.metrics #174

IndexSeek opened this issue Nov 16, 2024 · 1 comment

Comments

@IndexSeek
Copy link
Member

Explore adding a metrics module to support computing classification metrics such as accuracy, precision, recall, and f1_score, as well as regression metrics such as MSE, RMSE, MAE, and MAPE.

This was brought up in ibis-project/ibis#10501.

A challenge with this implementation, at least for classification, is that calculating these metrics individually may be less performant, as it likely requires reshaping the data first for each one. Even with this being the case, we would likely still get pretty good performance, and if the backend supports result caching, it would be even better in those instances.

@zilto
Copy link

zilto commented Dec 5, 2024

To add: torchmetrics.functional has a lot of metrics implemented for PyTorch tensors in functional form. The typical input is metric(predicted, true, **kwargs), which maps to table columns.

A challenge with this implementation, at least for classification, is that calculating these metrics individually may be less performant, as it likely requires reshaping the data first for each one

Some metrics are implemented modularly with an _update() and a _compute() function. update derives relevant values from the predicted and true inputs and compute produces the metric. (example)

Notes

  • ibis-ml.metrics implementations could be tested against torchmetrics (or scikit-learn) itself
  • some metrics can be "accumulated", which means that we can update the metric value for a single new pair (predicted, true)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: backlog
Development

No branches or pull requests

2 participants