Remove unused feature type inference to stick with one way of doing it#231
Merged
Conversation
|
Check out this pull request on See visual diffs & provide feedback on Jupyter Notebooks. Powered by ReviewNB |
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.
Add
binary_asparameter toinfer_feature_typesSummary
binary_asparameter toed.infer_feature_typesthat controls whether binary (0/1) features are classified as categorical or numeric.ed.infer_feature_typesconsiders now integer series 0, ... , n as numeric, and not as categorical_infer_numerical_column_indiceshas been removed which has previously been used in some imputation functions from ehrapy (Remove_infer_numerical_column_indicesehrapy#1014)Fixes #214
Motivation
Binary 0/1 variables are ambiguous: they can represent true categorical labels (e.g., male/female) or numeric indicators (e.g., presence/absence of a diagnosis used in downstream arithmetic). Previously,
infer_feature_typesalways classified them as categorical. This made it cumbersome when a dataset has many binary indicator columns that should be treated numerically — users had to manually correct each one withed.replace_feature_types.Change
infer_feature_types(and the internal_detect_feature_type) now accept a keyword argument:"categorical"(default): binary 0/1 features are classified as categorical — no change in behavior."numeric": binary 0/1 features are classified as numeric instead.Usage