I built ganfs: A Python package that uses GANs to automate feature selection for high-dimensional datasets. (No domain expert required) [P] [R]
Mirrored from r/MachineLearning for archival readability. Support the source by reading on the original site.
Hey everyone,
I recently open-sourced a new Python package called ganfs (Generative Adversarial Network Feature Selection), and I wanted to share it with the community.
The Problem: Selecting the best features in high-dimensional datasets is often a massive bottleneck. Traditional methods (like filter, wrapper, or embedded methods) usually struggle with scalability, miss complex nonlinear relationships, or require a domain expert to manually identify what matters.
The Solution (ganfs): I wanted to automate this process using adversarial learning. ganfs trains a Generative Adversarial Network on your dataset. Once the GAN learns the underlying data distribution, the algorithm applies a perturbation strategy to the Discriminator.
By analyzing how the Discriminator reacts to these perturbations, ganfs automatically ranks the features based on which ones are "hardest to fake." Essentially, it learns the patterns and extracts the most informative features without any domain-specific supervision.
I originally developed this algorithm during my research on large-scale DDoS detection (where identifying the right network features is critical), but the package is designed to be domain-agnostic.
How to use it: You can install it directly via pip: pip install ganfs
The API is designed to be simple and similar to standard scikit-learn transformers.
Links:
- PyPI: https://pypi.org/project/ganfs/
- GitHub/Docs: https://github.com/patelharsh15/GANFS-GAN-based-feature-selection
- The Math/Research (arXiv): https://arxiv.org/abs/2504.18566
Right now, I am actively working on optimizing the GPU memory consumption for smaller datasets, but it is fully functional.
I’d love for people to test it out on their datasets and give me feedback on the architecture, the code structure, or any bugs you run into. Happy to answer any questions about the math or the implementation!
[link] [comments]
More from r/MachineLearning
-
A collision-entropy floor for watermark/retrieval AI-text detection. Looking for a sanity check before I take this further [D]
Aug 14
-
Are supervised and unsupervised learning still relevant today? [D]
Aug 14
-
TMLR Relevance and Prestige [D]
Aug 13
-
Reproducible canvas-aligned low-level patterns in somerandomllm-generated images and their possible relation to iterative editing artifacts [D]
Aug 13
Discussion (0)
Sign in to join the discussion. Free account, 30 seconds — email code or GitHub.
Sign in →No comments yet. Sign in and be the first to say something.