sepandhaghighi / pycm

Multi-class confusion matrix library in Python
http://pycm.io
MIT License
1.45k stars 124 forks source link

Refactoring #517

Closed tosemml closed 1 year ago

tosemml commented 1 year ago

Reference Issues/PRs

This is a Refactoring

What does this implement/fix? Explain your changes.

This involves leveraging numpy operations for efficient computation of sums and dot products, enhancing the conciseness.

tosemml commented 1 year ago

CHANGELOG.md and AUTHORS.md are updated. Thank you!

tosemml commented 1 year ago

thank you. changes are done.

alirezazolanvari commented 1 year ago

@tosemml Thanks for your efforts. I also think the refactored lines are inefficient. Especially for cases where the problem contains millions of class labels. For-loop overload cannot be compensated for by NumPy's efficiency in those cases. So, I'll close this PR, and if you have any other solutions for refactoring this part in an efficient way, please open a new PR.

BTW, it is so nice to see you've dived into the details of PyCM's source code. For sure there are many parts of the code that you can help us to improve in terms of both readability and efficiency.