Centralised input validation with validate_data#7816
Draft
betatim wants to merge 5 commits intorapidsai:mainfrom
Draft
Centralised input validation with validate_data#7816betatim wants to merge 5 commits intorapidsai:mainfrom
validate_data#7816betatim wants to merge 5 commits intorapidsai:mainfrom
Conversation
|
Auto-sync is disabled for draft pull requests in this repository. Workflows must be run manually. Contributors can view more details about this message here. |
Member
Author
|
/ok to test c36b55c |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This is a PR that tries to move cuml towards using a central
validate_datafunction that performs the conversion to a cuml array and applies various checks that catch cases where users pass in invalid inputs.The goal is to make cuml a more robust library that provides helpful error messages to users when they make a mistake. It also reduces the number of xfailed checks in the scikit-learn compat test suite.
The main effort right now is towards
check_fit1d,check_fit2d_predict1d,check_estimators_unfitted,check_requires_y_none.check_supervised_y_no_nanis also getting addresses but I need to benchmark this to see how big the penalty is (same forcheck_estimators_nan_inf). You could argue that if we can't handle these inputs we need to check for them and that comparing to a version that incorrectly does not check for this isn't the right comparison to make. Status quo, things just crash if you pass nan or inf.The main idea of
validate_datais to centralise the checking ,exception raising, etc. It works quite well, but there are quite a few estimators that behave different to the majority. For example performing input validation inside the solver or accepting sparse input. Still working on what the right balance is between makingvalidate_datamore configurable and duplicating a few checks in these special estimators.Early WIP to discuss with @jcrist
Closes #7428