-
-
Notifications
You must be signed in to change notification settings - Fork 25.8k
DOC improve conventions used in MAPE #30012
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
DOC improve conventions used in MAPE #30012
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here, a couple of feedbacks
sklearn/metrics/_regression.py
Outdated
MAPE output is a relative measure of error that does not have an upper bound, unlike typical percentages. | ||
It can return values greater than 1 (e.g., 2 representing a 200% error). For example, an error of 1 | ||
represents a 100% deviation from the true value. Read more in the | ||
:ref:`User Guide <mean_absolute_percentage_error>`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The first sentence is incorrect: typical percentage can exceed 100%. Also you need to make sure to not have more than 88 characters per line and no trailing space.
This is the reason for the linter CI to raise error.
Here is my suggestion to keep the docstring short.
MAPE output is a relative measure of error that does not have an upper bound, unlike typical percentages. | |
It can return values greater than 1 (e.g., 2 representing a 200% error). For example, an error of 1 | |
represents a 100% deviation from the true value. Read more in the | |
:ref:`User Guide <mean_absolute_percentage_error>`. | |
Note that we are not using the common "percentage" definition: the percentage | |
in the range [0, 100] is converted to a relative value in the range [0, 1] | |
by dividing by 100. Thus, an error of 200% corresponds to a relative error of 2. | |
Read more in the :ref:`User Guide <mean_absolute_percentage_error>`. |
doc/modules/model_evaluation.rst
Outdated
For example, if the true value is 1 and the predicted value is 2, the MAPE will be 1 (or 100% error). | ||
Similarly, if the true value is 1 and the predicted value is 3, the MAPE will be 2 (or 200% error). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should not document it here. Instead we should amend the note below (this is currently incorrect).
You can reuse part of my other suggestion to amend it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure @glemaitre, I will implement this fix.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I pushed a fix. The rendering looks good.
Enabling auto-merge.
Thanks @Rachit23110261 |
Co-authored-by: Guillaume Lemaitre <guillaume@probabl.ai>
Reference Issues/PRs
Fixes #30008.
What does this implement/fix? Explain your changes.
This pull request addresses an issue in the documentation related to the Mean Absolute Percentage Error (MAPE) formula. The following changes have been made:
These changes aim to improve user understanding and align the documentation with the intended use of the MAPE metric.
Any other comments?
Please feel free to reach out if there are any questions or if further adjustments are required. I appreciate your time and attention to this contribution.