Skip to main content

FeatureFlex: An AutoML Project with Advanced Feature Selection

PyPI - Version PyPI - Python Version GitHub - License GitHub - Issues GitHub - Forks

Overview

FeatureFlex is an AutoML project that provides a comprehensive suite of machine learning capabilities. It includes advanced preprocessing, feature selection, model optimization, and evaluation functionalities, making it a robust choice for tackling classification tasks with large and complex datasets.

This package is particularly suited for tasks requiring feature selection and comparison across multiple methods, including SHAP, Boruta, SelectKBest, and more.


Features

  • Advanced Feature Selection:

    • Boruta
    • SelectKBest
    • SHAP-based feature selection
    • ReliefF (via scikit-rebate)
  • Dynamic Model Optimization:

    • Grid search
    • Random search
    • Bayesian optimization
  • Evaluation Metrics:

    • AUC, Accuracy, Precision, Recall, F1-score
    • Confusion Matrix
    • ROC and Precision-Recall Curves
  • Comparison Tool:

    • Compare feature selection methods based on model performance.

Installation

Install FeatureFlex via PyPI:

pip install FeatureFlex

Usage

Preprocessing Data

FeatureFlex includes a DataPreprocessor for preprocessing data with missing values, scaling, and encoding.

from preprocessing import DataPreprocessor

data = ...  # Load your dataset
preprocessor = DataPreprocessor()
X, y, _ = preprocessor.preprocess(data, target_column="click")

Feature Selection

FeatureFlex allows you to use various feature selection techniques:

from feature_selector import EnhancedFeatureSelector

# Using SHAP-based feature selection
selector = EnhancedFeatureSelector(input_dim=X.shape[1])
top_features = selector.select_via_shap(X, y, n_features=10)

Model Optimization

Optimize models using dynamic, grid, random, or Bayesian search:

from model_optimizer import ModelOptimizer

optimizer = ModelOptimizer()
best_model, best_score = optimizer.optimize_model(X, y, method="bayesian")

Comparison of Feature Selection Methods

Compare different feature selection methods using the provided comparison script:

from comparison import compare_feature_selectors

results = compare_feature_selectors(data, target_column="click", n_features=10)

Evaluation

Evaluate your model with various metrics and generate reports:

from evaluation import ModelEvaluator

metrics = ModelEvaluator.evaluate(model, X_test, y_test, output_format="html")

Example Dataset

The package includes utilities tested with datasets such as:

For more information on the dataset's context, see:


Comparison with Existing Packages

FeatureFlex distinguishes itself from existing feature selection packages:

Method FeatureFlex Boruta SelectKBest SHAP ReliefF
Multi-method support ✔ ✘ ✘ ✘ ✘
Dynamic optimization ✔ ✘ ✘ ✘ ✘
Scalable to large datasets ✔ ✔ ✔ ✔ ✔
Integrated evaluation ✔ ✘ ✘ ✘ ✘

Full Comparison Script

Here is an example script to compare various feature selection techniques:

from comparison import compare_feature_selectors, save_results_and_plots
import pandas as pd

# Load dataset
data = pd.read_csv("path/to/dataset.csv")
results = compare_feature_selectors(data, target_column="click", n_features=10)

# Save results to CSV and generate plots
save_results_and_plots(results)

Dependencies

FeatureFlex depends on the following libraries:

  • Core:

    • numpy, pandas, scikit-learn
    • matplotlib, shap, optuna
  • Feature Selection:

    • BorutaPy
    • scikit-rebate
  • Optimization:

    • optuna

Refer to the requirements.txt file for the full list of dependencies.


Project Links


License

This project is licensed under the MIT License.


Contact

For queries or suggestions, contact the author at info@itsharppro.com.


Changelog

FeatureFlex uses a dynamic versioning system. The current version is updated automatically at build time.


Contribution

Contributions are welcome! Feel free to fork the repository and submit a pull request.

Metadata

Release files for FeatureFlex 0.1.65

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

Source distribution (sdist)

Source distribution for FeatureFlex 0.1.65
File Size Uploaded
featureflex-0.1.65.tar.gz 18.9 kB Details

Release files / featureflex-0.1.65.tar.gz

Download URL featureflex-0.1.65.tar.gz
Size 18.9 kB
Tags Source
SHA-256 checksum
How to use checksums
6fe5a5dc75b764b4e8cbff357c69fd7d9522a9edbb6584f77bd9f0ea5216376a
BLAKE2b-256 checksum
How to use checksums
2e346fa4e02d9c177e7a7b54e5d6b1924a332c13729fda16965dbdea77aeab45
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.0.1 CPython/3.9.21

Release history Release notifications | RSS feed

0.1.67

1 release file

This release

0.1.65 This release

1 release file

0.1.62

1 release file

0.1.58

1 release file

0.1.53

1 release file

0.1.49

1 release file

0.1.44

1 release file

0.1.40

1 release file

0.1.35

1 release file

0.1.34

1 release file

0.1.31

1 release file

0.1.30

1 release file

0.1.25

1 release file

0.1.21

2 release files

0.1.20

1 release file

0.1.19

1 release file

0.1.18

1 release file

0.1.16

1 release file

0.1.14

1 release file

0.1.12

1 release file

0.1.10

1 release file

0.1.8

1 release file

0.1.6

1 release file

0.1.4

1 release file

0.1.2

1 release file

0.1.0

2 release files

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