feature-engine / feature_engine

Feature engineering package with sklearn like functionality
https://feature-engine.trainindata.com/
BSD 3-Clause "New" or "Revised" License
1.8k stars 304 forks source link

refactor logic to remove variables from list if not in dataframe for selection classes #717

Closed solegalli closed 5 months ago

solegalli commented 6 months ago

We have the function _filter_out_variables_not_in_dataframe which is used by the selection transformers within self._confirm_variables(X).

The current logic is unreadable and convoluted.

We need to think:

  1. if we want to expose the filter out function (probably not), and
  2. what is the best design of that function to use if from the transformers.

Probably just to remove the variables, and, more importantly, it should not allow None as argument, because if variables is None, then there is nothing to filter out.