You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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?
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>
.
Sorry, I didn't understand the usage. There is no warn_on_dtype parameter to check_pairwise_arrays, it only makes use of check_array's warn_on_dtype parameter. We would only need to remove its usage in check_pairwise_arrays and deprecate its acceptance in check_array.
I don't know whether the warning is useful in pairwise metrics. @amueller?
I don't know whether the warning is useful in pairwise metrics. @amueller?
Here's what I found:
check_pairwise_arrays is the only tool that makes use of the warn_on_dtype parameter of check_array. This is only the case when the dtype parameter of check_pairwise_arrays is not None.
The only call to check_pairwise_arrays with a non-None dtype is in pairwise_distances(), for these metrics only:
# These distances recquire boolean arrays, when using scipy.spatial.distancePAIRWISE_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.
raise DataConversionWarning in pairwise_distances, in case metric in PAIRWISE_BOOLEAN_FUNCTIONS and the dtype of the array isn't already bool:
The input data need to be converted to bool for boolean metric {metric}. This will create a copy. To remove this warning, explicitly convert the data using e.g. X = X.astype(np.bool) (same for Y if needed).
Activity
amueller commentedon Feb 28, 2019
Actually, it's still used in check_pairwise_array. Do we want to keep it there?
2sang commentedon Feb 28, 2019
Where could I find the function check_pairwise_array you mentioned?
jnothman commentedon Mar 1, 2019
fixed issue scikit-learn#13324 through removal of warn_on_dtype refer…
jnothman commentedon Mar 12, 2019
I'm not inspired by its use in pairwise... Happy to see it go. What would you change if you received that warning?
jnothman commentedon Mar 12, 2019
I suppose you'd consider casting your data first to avoid repeated recasting??
praths007 commentedon Mar 13, 2019
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?
jnothman commentedon Mar 13, 2019
praths007 commentedon Mar 13, 2019
should that be done in a different PR? Because it might involve updating test cases under /pairwise and /validation
jnothman commentedon Mar 17, 2019
Sorry, I didn't understand the usage. There is no
warn_on_dtypeparameter tocheck_pairwise_arrays, it only makes use ofcheck_array'swarn_on_dtypeparameter. We would only need to remove its usage incheck_pairwise_arraysand deprecate its acceptance incheck_array.I don't know whether the warning is useful in pairwise metrics. @amueller?
NicolasHug commentedon Mar 23, 2019
Here's what I found:
check_pairwise_arraysis the only tool that makes use of thewarn_on_dtypeparameter ofcheck_array. This is only the case when thedtypeparameter ofcheck_pairwise_arraysis not None.check_pairwise_arrayswith a non-None dtype is inpairwise_distances(), for these metrics only: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:
warn_on_dtypefromcheck_array(done in [MRG + 1] Remove "warn_on_dtype" from check_array #13382)check_pairwise_arrays(done in [MRG + 1] Remove "warn_on_dtype" from check_array #13382)pairwise_distances, in casemetric in PAIRWISE_BOOLEAN_FUNCTIONSand the dtype of the array isn't alreadybool:jnothman commentedon Mar 24, 2019
MohammedKhandwawala commentedon Mar 26, 2019
@amueller is anyone working on this? or can i take this issue.
NicolasHug commentedon Mar 26, 2019
@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
rth commentedon Jul 3, 2019
@NicolasHug This was fully fixed in #13382, right? Then we can also close #13434?
NicolasHug commentedon Jul 4, 2019
Yes, thanks for the reminder! Closing both issues