Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix/median performance #20

Merged
merged 9 commits into from
Apr 9, 2024

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
1 check passed
@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.

2 participants