Skip to content

Adding SMAPE and MAPE loss functions in Machine Learning #13311

@VedanshTyagi

Description

@VedanshTyagi

Feature Description

I would like to add SMAPE and MAPE loss functions to the loss_functions.py file in Machine Learning folder.

SMAPE

SMAPE (Symmetric Mean Absolute Percentage Error) measures forecast accuracy by comparing the absolute difference between predicted (𝐹t) and actual (At) values to their average.
It is given by:
$$SMAPE=\frac{100%}{​n} \sum_{t=1}^{n} \frac{|Ft - At|}{(|At| + |Ft|)/2} $$

MAPE

MAPE (Mean Absolute Percentage Error) measures forecast accuracy by expressing the average absolute difference between predicted (𝐹t) and actual (At) values as a percentage of the actual values.
It is given by:
$$SMAPE=\frac{100%}{​n} \sum_{t=1}^{n} |\frac{Ft - At}{At }| $$

Benefits

Machine learning models which predict continuous values like price of a house heavily use these loss functions to learn weights and biases.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementThis PR modified some existing files

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions