kunaldahiya / pyxclib

Tools for multi-label classification problems.
MIT License
126 stars 36 forks source link

Might be a bug when calculating precision #5

Closed Odaimoko closed 4 years ago

Odaimoko commented 4 years ago

In methods precision(link), the indices returned by _setup_metric is the indices of top k labels, with scores sorted ascendingly. But when calculating precision@k, we want to use cumsum when scores in eval_flags are sorted descendingly. The same is to psprecision since it uses precision as a subroutine.

I just add change indices to indices[:, ::-1] in _get_top_k. Guess it is just a workaround.

anshumitts commented 4 years ago

@Odaimoko Thank you for pointing this out. Please let us know if the issue has been resolved.