Nixtla / utilsforecast

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

fix multiple models in mqloss #64

Closed AzulGarza closed 4 months ago

AzulGarza commented 4 months ago

this PR fixes the following bug. currently, if the unique_id column differs from values in range(n_ts), and more than one model is being evaluated, mqloss produces the following output:

image

the bug comes from this line: https://github.com/Nixtla/utilsforecast/blob/2ebf3725cb9627dc35da85c691844ec895151fdb/utilsforecast/losses.py#L477

since result is indexed by unique_id and res is a dataframe indexed by range(n_ts), the concatenation generally fails. the test in the base code works because result and res share the same index (the unique_id column has values in range(n_ts)).

dropping while resetting the index of result should fix the error since the unique_id is expected to share the same index across models.

review-notebook-app[bot] commented 4 months ago

Check out this pull request on  ReviewNB

See visual diffs & provide feedback on Jupyter Notebooks.


Powered by ReviewNB