-
-
Notifications
You must be signed in to change notification settings - Fork 25.8k
MAINT Use memoryviews in _expected_mutual_info_fast #25575
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
MAINT Use memoryviews in _expected_mutual_info_fast #25575
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @OmarManzoor, thanks for the PR :)
In this case, I wonder if memoryviews are justified since we only use the underlying buffers and return np.array
through np.log
or gammaln
. WDYT?
I think we can just make use of cnp arrays here. However we are indexing arrays later in the code. |
This is what I am referring to. scikit-learn/sklearn/metrics/cluster/_expected_mutual_info_fast.pyx Lines 58 to 69 in 872a084
|
I don't understand your point; could you give more details? |
#24794 is the PR @Vincent-Maladiere mentioned. |
Looking at the PR I think that if there is work being done in this file then we can revisit this PR after that work is finalized. What do you think? |
This is the best approach I think. I would prioritize making all the C extensions use the latest NumPy C API as mentioned in #24875. |
Reference Issues/PRs
Towards: #25484
What does this implement/fix? Explain your changes.
Any other comments?
CC: @Vincent-Maladiere @jjerphan @adam2392