Closed
Description
Due to changes proposed in #10404, it seems that check_array
as currently a main limitation. force_all_finite
will force both NaN
and inf
to be rejected. If preprocessing methods (whenever this is possible) should let pass NaN
, this argument is not enough permissive.
Before to implement anything, I think it could be good to have some feedback on the way to go. I see the following solutions:
force_all_finite
could still accept a bool to preserve the behaviour. Additionally, it could accept anstr
to filter onlyinf
.- [MRG] ENH Permit NaN while allowing to filter out inf in validation tools. #7892 proposes to have an additional argument
allow_nan
. @amueller was worried that it makescheck_array
to complex. - make a private function
_assert_finite_or_nan
(similarly to this proposal removing the numpy version checking) in thedata.py
which can be shared between the preprocessing methods.
They are the solutions that I have in mind for the moment but anything else is welcomed.
@jnothman @agramfort @amueller @lesteve @ogrisel @GaelVaroquaux I would be grateful for any insight.
Metadata
Metadata
Assignees
Labels
No labels