Nixtla / utilsforecast

https://nixtlaverse.nixtla.io/utilsforecast
Apache License 2.0
40 stars 6 forks source link

Smape shows only half of its value if Mord than one unique_ID is available. #49

Closed mkrech closed 8 months ago

mkrech commented 8 months ago

Hi, thank you for your fantastic library.

Smape shows only half of its value if more than one unique_ID is available.

Perhaps the scale could be divide with 2.

In losses.py ... scale = df[models].abs().add(df[target_col].abs(), axis=0).......div(2)

regards Michael

jmoralez commented 8 months ago

Hey @mkrech, thanks for using utilsforecast. We use the third equation here:

$$\text{SMAPE}= \frac{100}{n} \sum{t=1}^{n} \frac{|F{t}-A{t}|}{|A{t}|+|F_{t}|}$$

without multiplying by 100, so the SMAPE is between 0 and 1 (0% and 100%).

mkrech commented 8 months ago

Thank you, that solves my problem.