Skip to main content

dRFEtools - dynamic Recursive Feature Elimination

dRFEtools is a package for dynamic recursive feature elimination with scikit-learn.

Authors: Apuã Paquola, Kynon Jade Benjamin, and Tarun Katipalli

Package developed in Python 3.11+.

In addition to scikit-learn, dRFEtools is also built with NumPy, SciPy, Pandas, matplotlib, plotnine, and statsmodels. Currently, dynamic RFE supports models with coef_ or feature_importances_ attribute.

This package provides several functions to run dynamic recursive feature elimination (dRFE) for random forest and linear model classifier and regression models. For random forest workflows, dRFEtools assumes Out-of-Bag (OOB) scoring is enabled. Linear-model workflows build a developmental split internally. For both classification and regression, three measurements are calculated for feature selection:

Classification:

  1. Normalized mutual information
  2. Accuracy
  3. Area under the curve (AUC) ROC curve

Regression:

  1. R2 (this can be negative if model is arbitrarily worse)
  2. Explained variance
  3. Mean squared error

Package structure

The repository is organized into focused modules to match the runtime architecture:

  • dRFEtools.py – core interfaces for random-forest and developmental-set elimination workflows.
  • scoring/ – metric implementations for developmental splits and random-forest OOB scoring.
  • lowess/ – helpers for smoothing elimination curves and extracting optimal feature counts.
  • metrics/ – feature ranking utilities used during elimination.
  • plotting.py – visualization helpers re-exported from the top-level package.
  • cli.py – command-line entry points for running full dRFE pipelines.
  • utils.py – shared helpers for normalizing results and persisting plots.

Table of Contents

  1. Citation
  2. Installation
  3. Tutorials
  4. Reference Manual
    1. Core elimination functions
    2. Ranking and scoring utilities
    3. LOWESS helpers
    4. Plotting functions
    5. Utilities and CLI

Citation

If using please cite the following:

Kynon J M Benjamin, Tarun Katipalli, Apuã C M Paquola, dRFEtools: dynamic recursive feature elimination for omics, Bioinformatics, Volume 39, Issue 8, August 2023, btad513, https://doi.org/10.1093/bioinformatics/btad513

PMID: 37632789

DOI: 10.1093/bioinformatics/btad513.

Installation

pip install --user dRFEtools

Tutorials

We have two tutorials for optimization and classification that align with the 0.4.x API documented on Read the Docs.

In addition to this, we have example code used in the manuscript for scikit-learn simulation, biological simulation, and BrainSEQ Phase 1 at the link below.

https://github.com/LieberInstitute/dRFEtools_manuscript

Reference Manual

Core elimination functions

  • rf_rfe – Runs random-forest feature elimination and returns a pair of standardized dictionaries: the full history keyed by feature count and the first elimination step. Each entry contains n_features, a metrics mapping appropriate for the task, the original indices, and the indices of surviving features.
  • dev_rfe – Performs the same elimination loop for estimators that rely on a developmental split, yielding the same standardized result structure as rf_rfe.

Ranking and scoring utilities

  • features_rank_fnc – Ranks features during elimination and optionally persists the ranking table for each fold.
  • Developmental-set metrics (dev_score_*) live under dRFEtools.scoring.dev.
  • Random-forest OOB metrics (oob_score_*) live under dRFEtools.scoring.random_forest.

LOWESS helpers

  • extract_max_lowess – Identifies the optimal feature count from the LOWESS-smoothed elimination curve.
  • extract_peripheral_lowess – Detects the inflection point associated with peripheral features.
  • optimize_lowess_plot – Visualizes the LOWESS curve with annotations about the selected feature counts.

Plotting functions

Plotting helpers are defined in dRFEtools.plotting and re-exported from the top-level package:

  • plot_metric – Render elimination trajectories for individual metrics.
  • plot_with_lowess_vline – Overlay LOWESS-derived selection cutoffs on the metric trajectory plot.

Utilities and CLI

  • normalize_rfe_result, get_feature_importances, and save_plot_variants are available under dRFEtools.utils and support the standardized dictionary-based API. ensure_path is provided to safely normalize user-supplied file paths.
  • The command-line interface in dRFEtools.cli wraps the same workflows for CSV inputs: run python -m dRFEtools.cli --help to explore available commands, including custom metric selection and development-split sizing.

Metadata

Release files for dRFEtools 0.4.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for dRFEtools 0.4.1
File Size Uploaded Provenance
drfetools-0.4.1.tar.gz 27.1 kB With provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for dRFEtools 0.4.1
File Interpreter ABI Platform
drfetools-0.4.1-py3-none-any.whl Python 3 none any Details

Total release size: 58.5 kB

Release files / drfetools-0.4.1.tar.gz

Download URL drfetools-0.4.1.tar.gz
Size 27.1 kB
Tags Source
SHA-256 checksum
How to use checksums
1bef60bd549033ede9f6b0f4ab8ec74785e94d3b6492220fa7782114431b2bf5
BLAKE2b-256 checksum
How to use checksums
0d76a1562766602a1e42a4249ebc3f81e23cf4ba69203ced2f2f68ff8ea92c03
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 23, 2026.

Transparency log

Release files / drfetools-0.4.1-py3-none-any.whl

Download URL drfetools-0.4.1-py3-none-any.whl
Size 31.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
d15530c516fada16d1c8a3b36e0358b8b29249206960a87b80e565f9542e72de
BLAKE2b-256 checksum
How to use checksums
98b3fa3b129d7deccff49135b135d075f2d80fe8464a6a585d0a3ba9001a42eb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 23, 2026.

Transparency log

Security for dRFEtools 0.4.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

All 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for drfetools-0.4.1.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 23, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.4.1 This release

2 release files Full provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page