Skip to content

Conversation

@MothNik
Copy link
Contributor

@MothNik MothNik commented Apr 9, 2024

This pull request tackles a serious performance issue caused by sorting the complete x in the new median-function.
This increases the computation time unnecessarily because efficient algorithms exist that rely only on targeted sorting.
For the ordinary median, np.median is used for simplicity.
For even sample size, the low and high median can also be acquired by targeted sorting using np.partition.

Besides, a tiny test is added to cover all different combinations that median could encounter.

@deepak7376 deepak7376 merged commit 08d2a01 into deepak7376:master Apr 9, 2024
@deepak7376
Copy link
Owner

Thanks @MothNik, for the fix !!

@MothNik MothNik deleted the fix/median_performance branch April 9, 2024 16:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

None yet

2 participants