Limit the level of class inherintance to two.

Open
#616 2 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
5/5
Estimated time
Over a week
Newbie friendliness
15/100
Issue type
Refactor
Clarity
Mostly clear
Activity status
Stale

Research direction

The inheritance chain runs through BaseSelector and BaseRecursiveSelector down to RecursiveFeatureAddition, with the shared base classes in the _base_transformer section. Start by mapping every class that sits more than two levels below BaseEstimator, TransformerMixin and GetFeatureNamesOutMixin. Done means a design agreed in the thread that brings each class within two levels, with the existing tests still passing.

Written by the indexing model from the issue text.

Description

Is your feature request related to a problem? Please describe.
Currently, some feature-engine classes have more than two levels of inheritance, e.g. classes that are derived from the BaseRecursiveSelector() class.

BaseEstimator(), TransformerMixin(), and GetFeatureNamesOutMixin() --> BaseSelector() --> BaseRecursiveSelector() --> RecursiveFeatureAddition()

This many levels of abstraction significantly increase the difficulty for people to contribute.

Describe the solution you'd like
Let's limit the codebase to two levels of inheritance. There can be multiple base transformers in the _base_transformer section than each other section - e.g., discretisation, encoding, and timeseries - are limited to one base transformer.

Describe alternatives you've considered
feature-engine currently applies an alternative, i.e., more than 2 levels of inheritance, and we see the challenges that it is causing.

Dominant language
Python
Stars
2.3k
Forks
391
Avg merge
11h 34m
Merged PRs (30d)
11

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from feature-engine/feature_engine

All issues in feature-engine/feature_engine

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.