Skip to content
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

[WIP] Support pandas DataFrames and feature names in ExhaustiveFeatureSelector #380

Merged
merged 4 commits into from
May 7, 2018

Conversation

rasbt
Copy link
Owner

@rasbt rasbt commented May 6, 2018

Description

Adds support for a feature names and pandas DataFrames in the ExhaustiveFeatureSelector. In particular, the EFS methods (fit, transform, etc.) now support pandas DataFrames in addition to NumPy(-like) arrays. Also, the feature names will be recorded in self.k_feature_names_ as well as self.subsets_['feature_names']. If a pandas DataFrame is provided as input, these feature names are correspond to the column names. Otherwise, the column indices as string representation will be used as a placeholder.

Finally, an optional feature_names parameter is added to the ExhaustiveFeatureSelector constructor, which allows users to pass custom feature names corresponding to column indices to improve the interpretability of the selected feature subsets via self.subsets_['feature_names'] and self.k_feature_names_. Note that user-provided feature names have precedence over feature names based on column indices or pandas DataFrame columns but are only used for labeling purposes.

Related issues or pull requests

Pull Request Checklist

  • Added a note about the modification or contribution to the ./docs/sources/CHANGELOG.md file (if applicable)
  • Added appropriate unit test functions in the ./mlxtend/*/tests directories (if applicable)
  • Modify documentation in the corresponding Jupyter Notebook under mlxtend/docs/sources/ (if applicable)
  • Ran nosetests ./mlxtend -sv and make sure that all unit tests pass (for small modifications, it might be sufficient to only run the specific test file, e.g., nosetests ./mlxtend/classifier/tests/test_stacking_cv_classifier.py -sv)
  • Checked for style issues by running flake8 ./mlxtend

@coveralls
Copy link

coveralls commented May 6, 2018

Coverage Status

Coverage increased (+0.08%) to 91.157% when pulling e922687 on exh-featsele into 3b9dfa9 on master.

@rasbt rasbt merged commit 10a7d6b into master May 7, 2018
@rasbt rasbt deleted the exh-featsele branch May 12, 2018 22:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants