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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mean Absolute Percentage Error (MAPE) #3198

Closed
aalbayrak394 opened this issue Feb 14, 2024 · 6 comments 路 Fixed by #3199
Closed

Mean Absolute Percentage Error (MAPE) #3198

aalbayrak394 opened this issue Feb 14, 2024 · 6 comments 路 Fixed by #3199

Comments

@aalbayrak394
Copy link
Contributor

馃殌 Feature

I'd like to implement the mean absolute percentage error (MAPE) in ignite/metrics.

It is a commonly used metric for regression problems and it would be really convenient to be able to use it directly with ignite evaluators.

For that, I would write a custom Metric class in a new file mean_absolute_percentage_error.py inheriting from the base Metric class in ignite/metrics/metric.py.

@vfdev-5
Copy link
Collaborator

vfdev-5 commented Feb 14, 2024

@aalbayrak394 thanks for asking, we have this metric in ignite contrib metrics: https://pytorch.org/ignite/v0.4.13/generated/ignite.contrib.metrics.regression.MedianAbsolutePercentageError.html

EDIT: sorry, misread mean vs median.

yes, let's add it into contrib/regression metrics

OK, MAPE is also MARE: https://pytorch.org/ignite/v0.4.13/generated/ignite.contrib.metrics.regression.MeanAbsoluteRelativeError.html#ignite.contrib.metrics.regression.MeanAbsoluteRelativeError

Let's make a shortcut and improve docs for better discovery.
What do you think ?

@vfdev-5 vfdev-5 added enhancement module: metrics Metrics module module: contrib Contrib module docs and removed module: metrics Metrics module module: contrib Contrib module labels Feb 14, 2024
@aalbayrak394
Copy link
Contributor Author

Sure, that would make more sense. Maybe adding ", also known as Mean Absolute Percentage Error" to the first line of the doc would do it?

@vfdev-5
Copy link
Collaborator

vfdev-5 commented Feb 14, 2024

Yeah, and also add "(MAPE)" and "(MARE)" like that:

Calculate Mean Absolute Relative Error (MARE), also known as Mean Absolute Percentage Error (MAPE).

@aalbayrak394
Copy link
Contributor Author

I created a PR #3199

@aalbayrak394
Copy link
Contributor Author

@vfdev-5 How comes that some CI tests are failing when I only changed a line in the docstring?

@vfdev-5
Copy link
Collaborator

vfdev-5 commented Feb 14, 2024

@aalbayrak394 some CI tests are flaky and some of them are broken right now.

For example, https://github.com/pytorch/ignite/actions/workflows/triage.yml, where I upgraded actions/labeler to v5 but they had a breaking change between v4 and v5. If you would like to help with it, you are very welcome!

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

Successfully merging a pull request may close this issue.

2 participants