Skip to content

speed-up correlation selection transformers, make them deterministic - #721

Merged
solegalli merged 31 commits into
mainfrom
speedup-correlation
Feb 18, 2024
Merged

speed-up correlation selection transformers, make them deterministic#721
solegalli merged 31 commits into
mainfrom
speedup-correlation

Conversation

@solegalli

@solegalli solegalli commented Jan 16, 2024

Copy link
Copy Markdown
Collaborator

closes #619
closes #648
closes #633
closes #612
closes #446
closes #684
closes #570
closes #703

FYI @dlaprins @glevv

Sorts variables alphabetically to avoid different results.
Adds adaptation of @dlaprins numpy implementation to speed search.

I'd like to keep the brute force correlation plain simple. And then we add the ordering per cardinality, etc to the smart correlation, which sort of has it already.

  • speed up search in smartcorrelationselection
  • check ordering implementation in smartcorrelationselection
  • take care of transitivity in smart corr selection
  • add tests for find_single_features
  • fix tests for smart correlation selection - need to create specific dfs to control for variance, cardinality and missing data
  • sort out unrelated error (newer versions of some libraries)
  • update correlation documentation (rst files in user_guide)
  • expand user guide on smart correlation selection
  • improve tests for recursive feature elimination (they are failing at the moment)
  • check python 3.11 and 3.12 images on circle ci
  • check check_classification_targets and why it fails for decision tree encoder

The unrelated error is in the recursive feature selectors. Something change in the estimators, or random state or something that now the values are different. Need to make that deterministic somehow.

Comment thread feature_engine/selection/drop_correlated_features.py Outdated
@solegalli

Copy link
Copy Markdown
Collaborator Author

Observations:

I could take the opportunity to speed up the selection tests for the recursive feature elimination, those are the ones failing.

The documentation for the smart correlation selector, could also be improved by showcasing the other methodologies.

Comment thread .circleci/config.yml
Comment thread .circleci/config.yml
@codecov

codecov Bot commented Feb 18, 2024

Copy link
Copy Markdown

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (3571426) 98.16% compared to head (f6163cf) 98.31%.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #721      +/-   ##
==========================================
+ Coverage   98.16%   98.31%   +0.15%     
==========================================
  Files         103      103              
  Lines        3930     3928       -2     
  Branches      771      764       -7     
==========================================
+ Hits         3858     3862       +4     
+ Misses         26       23       -3     
+ Partials       46       43       -3     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@solegalli
solegalli merged commit 1a090ba into main Feb 18, 2024
@solegalli
solegalli deleted the speedup-correlation branch February 18, 2024 17:24
Morgan-Sell pushed a commit to Morgan-Sell/feature_engine that referenced this pull request Mar 2, 2024
…eature-engine#721)

* change implementation to numpy for speed

* add sorted to make deterministic

* improve coverage

* create abstraction for finding correlated features

* add attribute with dictionary

* make initial edits of smart corr transformer

* initial rearrangement of the smart corr functionality

* refactor smart correlation selection

* add test for single_feature_selection function

* rename file

* fix several bugs in smart correlation

* expand and fix tests smart correlation

* fix error version 1.4 sklearn

* fix typos

* minor text edits

* fix pandas deprecation

* fix errors in yeoohnson

* fix style

* update docs

* update docs

* fix variable type deprecation

* fix all unrelated errors'

* remove support for python 3.8

* comment out break with new sklearn version

* add newer python versions to circleci tests'

* change python images circleci

* attempt to fix the correlation test error

* add environments to tox ini

* expand docs

* add changelog

* add changelog to index
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

3 participants