-
-
Notifications
You must be signed in to change notification settings - Fork 25.9k
Remove "warn_on_dtype" from check_array #13324
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
Comments
Actually, it's still used in check_pairwise_array. Do we want to keep it there? |
Where could I find the function check_pairwise_array you mentioned? |
sklearn/metrics/pairwise.py. called check_pairwise_arrays actually.
|
…ences in pairwise.py
I'm not inspired by its use in pairwise... Happy to see it go. What would you change if you received that warning? |
I suppose you'd consider casting your data first to avoid repeated recasting?? |
Assuming that no warnings should be issued for datatype changes in arrays. If warn_on_dtype were to be removed from check_pairwise_array, shouldn't the parameter be removed from check_array (under /validation) as well? Because apart from check_pairwise_array no other method passes warn_on_dtype parameter to it. Or is the assumption wrong and this feature of issuing warnings on type changes will be required going forward? |
Yes, if we deprecate from `check_pairwise_array` we should probably
deprecate from `check_array`.
…On Thu, 14 Mar 2019 at 00:06, Prathmesh Savale ***@***.***> wrote:
Assuming that no warnings should be issued for datatype changes in arrays.
If warn_on_dtype were to be removed from check_pairwise_array, shouldn't
the parameter be removed from check_array (under /validation) as well?
Because apart from check_pairwise_array no other method passes
warn_on_dtype parameter to it.
Or is the assumption wrong and this feature of issuing warnings on type
changes will be required going forward?
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#13324 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAEz66oF8Emc5Enx6PbWgpsOo6R_aZIlks5vWPe7gaJpZM4bWSg7>
.
|
should that be done in a different PR? Because it might involve updating test cases under /pairwise and /validation |
Sorry, I didn't understand the usage. There is no I don't know whether the warning is useful in pairwise metrics. @amueller? |
Here's what I found:
# These distances recquire boolean arrays, when using scipy.spatial.distance
PAIRWISE_BOOLEAN_FUNCTIONS = [
'dice',
'jaccard',
'kulsinski',
'matching',
'rogerstanimoto',
'russellrao',
'sokalmichener',
'sokalsneath',
'yule',
] This was introduced in #6932. We need this because scipy computations are wrong if the arrays are floats: see #4523 (comment) for a summary. May I propose the following:
|
Yes, I suppose warn_on_dtype is useful for this unsafe downcast.
Your approach certainly sounds more explicit! Let's do it :)
|
@amueller is anyone working on this? or can i take this issue. |
@MohammedKhandwawala you can see in the feed here things like Someone referenced this issue xx days ago these are often pull requests addressing the issue (but not always). Sorry, we're not good at updating labels |
@NicolasHug This was fully fixed in #13382, right? Then we can also close #13434? |
Yes, thanks for the reminder! Closing both issues |
We're not using warn_on_dtype any more (see #13306) and so we should deprecate it.
The text was updated successfully, but these errors were encountered: