sktime / skpro

A unified framework for tabular probabilistic regression, time-to-event prediction, and probability distributions in python
https://skpro.readthedocs.io/en/latest
BSD 3-Clause "New" or "Revised" License
250 stars 46 forks source link

[BUG] test_methods_p not handling getattr after shifting #380

Closed ShreeshaM07 closed 5 months ago

ShreeshaM07 commented 5 months ago

Expected behavior

when the shuffled is true while the testing happens in the test_all_distrs.py and it tests the test_methods_p it will shuffle the distribution and store the shuffled distribution's object instance in d.

The output from getattr(object_instance,method)(p) will give the output before the distribution is shuffled but when it is checking the output format if indices and columns are matching it is calling _check_output_format(res, d, method).

Solution res=getattr(object_instance,method)(p) to be replaced with res = getattr(d, method)(p) as this will account for the object_instance after shifting the distribution. This will ensure the outputs are checked with the shifted distribution's instance.