REF: Integrate symmetrization in _weighted_percentile to avoid double sorting#30894
REF: Integrate symmetrization in _weighted_percentile to avoid double sorting#30894arjun-sundar3363 wants to merge 1 commit intoscikit-learn:mainfrom arjun-sundar3363:refactor/weighted-percentile-symmetrization
Conversation
❌ Linting issuesThis PR is introducing linting issues. Here's a summary of the issues. Note that you can avoid having linting issues by enabling You can see the details of the linting issues under the
|
|
Thanks for the PR. Before reviewing it, I would like to wait for the finalization of #29034 that is nearly ready to be merged and rebase this on top of |
|
Thanks for the update. I’ll wait for #29034 to be finalized and will rebase my branch onto main as soon as it’s merged to resolve any conflicts. Let me know if there’s anything else you need from me in the meantime. |
… sorting - Add a parameter to _weighted_percentile to compute the averaged weighted percentile. - Update _averaged_weighted_percentile to use the new symmetrization functionality. - This refactor avoids sorting the input array twice while preserving all existing functionality.
REF: Integrate symmetrization in _weighted_percentile to avoid double sorting
Description
This pull request refactors the computation of weighted percentiles by integrating symmetrization directly into the
_weighted_percentilefunction. With this change, we avoid sorting the input array twice when computing the averaged weighted percentile. The following changes have been made:symmetrizeparameter to_weighted_percentilethat, when enabled, computes the averaged weighted percentile using both positive and negative arrays._averaged_weighted_percentileto leverage the new symmetrization functionality.This refactor improves efficiency without altering the external API or behavior.
Please review and let me know if any adjustments are required.