Skip to main content

Implements multiple type of filter methods and heuristics for the feature selection problem in machine learning as well as a new one: tournament in differential evolution

Project description

TiDE: Tournament in Differential Evolution for Feature Selection

License: BSD-3-Clause Build

TiDE (Tournament in Differential Evolution) is a Python package that provides a comprehensive benchmark of filter-based, greedy, and metaheuristic wrapper methods for feature selection in machine learning. It also introduces a novel adaptive strategy based on Differential Evolution, capable of adjusting its mutation, initialization, and crossover policies according to the data.

This project was developed as part of a research study evaluating the robustness, performance, and extensibility of feature selection methods under various data conditions (noise, redundancy, imbalance, high-dimensionality). It is particularly suited for binary classification problems in high-dimensional settings.

🚀 Key Features

  • A unified framework for evaluating feature selection methods.
  • Integrated filter methods: ANOVA, MRMR, SURF.
  • Greedy wrappers: Sequential Forward and Backward Floating Selection.
  • Metaheuristics:
    • Local search: Hill Climbing, Tabu Search
    • Population-based: Genetic Algorithm, PBIL, DE, MBDE
  • TiDE: A novel adaptive variant of Differential Evolution.

📦 Installation

Clone the repository and install in editable mode:

git clone https://github.com/thibaultanani/TiDE.git
cd TiDE
pip install -e .

Dependencies are listed in setup.py and will be automatically installed. These include:

  • numpy
  • pandas
  • scikit-learn
  • scipy
  • openpyxl
  • psutil
  • skrebate

You can also create a virtual environment beforehand:

python -m venv .venv
source .venv/bin/activate  # or .venv\Scripts\activate on Windows
pip install -e .

📂 Project Structure

TiDE/
├── feature_selections/
│   ├── filters/
│   ├── heuristics/
│   ├── utils/
├── experiments/
├── setup.py
├── README.md
└── ...

🧪 Usage Example

import pandas as pd
from sklearn.datasets import load_breast_cancer
from sklearn.metrics import balanced_accuracy_score
from sklearn.model_selection import train_test_split, KFold
from sklearn.naive_bayes import GaussianNB
from sklearn.pipeline import Pipeline
from sklearn.preprocessing import StandardScaler

from feature_selections.heuristics import Tide

if __name__ == '__main__':
    # Load the dataset
    data = load_breast_cancer()
    X, y = pd.DataFrame(data.data, columns=data.feature_names), pd.Series(data.target, name='target')
    # Divide data into training and test sets
    X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.2, random_state=42)
    # Divide the training set into training and validation sets
    X_train, X_val, y_train, y_val = train_test_split(X_train, y_train, test_size=0.25, random_state=42)
    # Create DataFrames
    train_df, train_df['target'] = X_train.copy(), y_train
    val_df, val_df['target'] = X_val.copy(), y_val
    test_df, test_df['target'] = X_test.copy(), y_test
    # Create scikit-learn pipeline
    model = GaussianNB()
    scoring = balanced_accuracy_score
    pipeline = Pipeline([('scaler', StandardScaler()), ('clf', model)])
    # Example of the use of a feature selection method
    tide = Tide(name="n1", target='target', train=train_df, test=val_df, scoring=scoring, pipeline=pipeline,
                Tmax=60, verbose=True, output="test")
    tide.start(pid=1)
    # It is also possible to only use training data as input for cross validation
    cv = KFold(n_splits=5, shuffle=True, random_state=42)
    tide_kfold = Tide(name="n2", target='target', train=train_df, cv=cv, scoring=scoring, pipeline=pipeline,
                      Tmax=60, verbose=True, output="test")
    tide_kfold.start(pid=2)
    # The results are automatically saved in the output "test" directory

🧠 Scientific Background

This package was developed as part of a research study investigating the robustness and adaptability of feature selection strategies across diverse data challenges. The proposed method TiDE dynamically adapts its mutation and crossover mechanisms according to the data characteristics, making it highly competitive compared to classical DE and other metaheuristics.

The full study is detailed in the accompanying manuscript:

Anani, T., Delbot, F., & Pradat-Peyre, J.-F. (2025). Tournament in Differential Evolution for Robust Feature Selection. Currently being submitted.

📊 Citation

@article{anani2025tide,
  author = {Anani, Thibault and Delbot, François and Pradat-Peyre, Jean-François},
  title = {Tournament in Differential Evolution for Robust Feature Selection},
  journal = { },
  year = {2025},
  note = {Submitted}
}

🛠 Contributing

Contributions, ideas and bug reports are welcome! Please open an issue or a pull request.

📄 License

This project is licensed under the BSD 3-Clause License.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

tide_feature_selection-1.1.0.tar.gz (22.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

tide_feature_selection-1.1.0-py3-none-any.whl (36.5 kB view details)

Uploaded Python 3

File details

Details for the file tide_feature_selection-1.1.0.tar.gz.

File metadata

  • Download URL: tide_feature_selection-1.1.0.tar.gz
  • Upload date:
  • Size: 22.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.3

File hashes

Hashes for tide_feature_selection-1.1.0.tar.gz
Algorithm Hash digest
SHA256 db33fb283663b3c9e89a64af51b2eb6d48b8720b6ac63f3ef9624f450a263fef
MD5 d431e59008862a68bc1c097c8f2b883a
BLAKE2b-256 f56bb031acc8e484e89f25259e5d36c7cec6e53e293097bdd8c2f6f9aa153605

See more details on using hashes here.

File details

Details for the file tide_feature_selection-1.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for tide_feature_selection-1.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 de50d5d3590aa83dc5d37ed54f7f505be1f71903f82803a8521d605beef77cc8
MD5 180cdff31e434eabd05d10a40146787f
BLAKE2b-256 31ab155881776b8f9ead26bc1684406b94065ef3dcb88d01e2c460a945c067ea

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page