-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Simplify InputValidator: Allows pandas frame to directly reach the pipeline #1135
Simplify InputValidator: Allows pandas frame to directly reach the pipeline #1135
Conversation
franchuterivera
commented
Apr 23, 2021
- Moves the encoder that translates pandas dataframes to numpy into the pipeline
- Enhances Auto-Sklearn to work with pandas internally, rather than numpy
- Feature type list is internally translated to a dictionary of column->data type to be robust against different pandas column ordering
- Adds extra check to make sure a pandas frame can produce a pipeline (in order words, this new set of checks make sure that A- a pandas frame reaches the base pipeline without being translated to numpy, and that - we can fit the pipeline with a pandas frame)
Codecov Report
@@ Coverage Diff @@
## development #1135 +/- ##
===============================================
+ Coverage 85.83% 85.96% +0.13%
===============================================
Files 137 138 +1
Lines 10625 10703 +78
===============================================
+ Hits 9120 9201 +81
+ Misses 1505 1502 -3
Continue to review full report at Codecov.
|
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.
Sorry, just a few high-level comments so far. I'll do my best to give more comments in a timely manner.
autosklearn/pipeline/components/data_preprocessing/imputation/categorical_imputation.py
Show resolved
Hide resolved
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.
I can't add anything to the comment about the OrdinalEncoder, but according to the docs it can handle NaN: https://scikit-learn.org/stable/modules/generated/sklearn.preprocessing.OrdinalEncoder.html
autosklearn/pipeline/components/data_preprocessing/rescaling/none.py
Outdated
Show resolved
Hide resolved
autosklearn/pipeline/components/data_preprocessing/rescaling/none.py
Outdated
Show resolved
Hide resolved
autosklearn/pipeline/components/data_preprocessing/rescaling/abstract_rescaling.py
Outdated
Show resolved
Hide resolved
autosklearn/pipeline/components/data_preprocessing/rescaling/abstract_rescaling.py
Outdated
Show resolved
Hide resolved
autosklearn/pipeline/components/data_preprocessing/rescaling/__init__.py
Outdated
Show resolved
Hide resolved
autosklearn/pipeline/components/data_preprocessing/categorical_encoding/one_hot_encoding.py
Outdated
Show resolved
Hide resolved
autosklearn/pipeline/components/data_preprocessing/rescaling/robust_scaler.py
Outdated
Show resolved
Hide resolved
autosklearn/pipeline/components/data_preprocessing/rescaling/standardize.py
Outdated
Show resolved
Hide resolved
autosklearn/pipeline/components/data_preprocessing/variance_threshold/variance_threshold.py
Outdated
Show resolved
Hide resolved
autosklearn/pipeline/components/data_preprocessing/variance_threshold/variance_threshold.py
Outdated
Show resolved
Hide resolved
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.
Alright, just checked everything that's not a test.
autosklearn/pipeline/components/data_preprocessing/data_preprocessing.py
Outdated
Show resolved
Hide resolved
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.
And the last part.
Could you please also check whether we need to unit test the meta-feature calculation (i.e. add a new set of checks for pandas in addition to the current tests which check for sparse and ndarray)?
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.
Finished the review of the changes. I'll now think a bit more whether we can include more tests for obscure datasets.
autosklearn/pipeline/components/data_preprocessing/categorical_encoding/no_encoding.py
Show resolved
Hide resolved
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.
Hey, I just took the liberty to debug and change the metafeature calculation, I hope that's okay.
I do have two minor questions left :)
Thanks a lot for the help, that makes a lot of sense. Since yesterday I was thinking why KNN will care about the order of the columns and it was just a dumb error. Sorry about that. |
No worries, I was looking at DT for which it also makes sense that it depends at the order; but then I realized that the numbers are crazy different so I thought there must be something else to it. |