Skip to main content

This repository is dedicated to implementing the methodologies from the 2015 paper "False Discovery Rate via Knockoffs". It provides code for generating knockoff features and applying selection procedures. The aim is to help users understand and apply the knockoff method for feature selection. Please refer to the original paper for a complete understanding.

Project description

🔍 KnockoffOrigins: An Implementation of "CONTROLLING THE FALSE DISCOVERY RATE VIA KNOCKOFFS (2015)"

This repository hosts the implementation of the knockoff filter method for controlled variable selection, based on the "Controlling the False Discovery Rate via Knockoffs" paper from 2015. The method is designed for high-dimensional data settings to effectively control the false discovery rate while preserving statistical power.

Note: Much of this implementation was crafted either from scratch or without relying on high-level libraries. This approach was chosen primarily for educational purposes (mostly self-educational purposes), allowing for a deeper understanding and exploration of the underlying algorithms. While this method involves some "reinventing the wheel," it might have some educational value. Future development may include the integration of more specialized libraries to enhance functionality and performance.

Table of Content

Features

  • Implementation of the knockoff filter method for feature selection.
  • Synthetic and GWAS-like data generators for evaluation and testing.
  • Lasso regression integration for feature importance assessment.

Installation

KnockoffOrigins is available on PyPI and can be installed using either pip or Poetry.

Using Pip

You can install KnockoffOrigins directly using pip:

pip install KnockoffOrigins

This command will download and install the latest version of KnockoffOrigins along with its dependencies. Using Poetry

Using Poetry

If you are using Poetry for your project, you can add KnockoffOrigins to your project as follows:

poetry add KnockoffOrigins

This will handle the installation and also update your pyproject.toml and poetry.lock files to reflect the change.

From Source

If you prefer to install from source or want to contribute to the package, first ensure Poetry dependency management is installed:

pip install poetry

Then clone the repository and install the dependencies:

git clone https://github.com/jrazi/KnockoffOrigins.git
cd KnockoffOrigins
poetry install

Usage

Here is a quick example of how to generate data and apply the knockoff filter:

from KnockOffOrigins.data_gen import SyntheticDataGenerator, GWASDataGenerator

# Initialize the data generator
base_generator = SyntheticDataGenerator(n=10000, p=100, noise_variance=1.0)

# Generate data and apply the knockoff filter
X, y = base_generator.generate_data()

Contributing

Contributions are welcome, and appreciated!

License

This project is licensed under the MIT License.

TODO

  • Implement test statistics for feature evaluation.
  • Develop FDR control mechanisms as outlined in the original study.
  • Implement Lasso feature selection using lower-level libraries.
  • Address some of the bugs and implementation issues.
  • Create example notebooks demonstrating package usage.
  • Replicate experiments from the original 2015 knockoff paper.
  • Develop visualization methods for feature selection analysis.
  • Implement the KnockOff+ method for enhanced feature selection.

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

knockofforigins-0.1.0.tar.gz (8.1 kB view details)

Uploaded Source

Built Distribution

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

knockofforigins-0.1.0-py3-none-any.whl (9.0 kB view details)

Uploaded Python 3

File details

Details for the file knockofforigins-0.1.0.tar.gz.

File metadata

  • Download URL: knockofforigins-0.1.0.tar.gz
  • Upload date:
  • Size: 8.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.4.0 CPython/3.11.7 Linux/6.8.0-31-generic

File hashes

Hashes for knockofforigins-0.1.0.tar.gz
Algorithm Hash digest
SHA256 da1ca3b18f164438f5e560026833a3c7db2cb55cd1a2497e572ae1c1f4c01e33
MD5 abab3a14726fad0a4240461bf16856db
BLAKE2b-256 f4c666e80d7ee2f7017285eb597b37e1e662141be7ee20293dd73cb1c298012a

See more details on using hashes here.

File details

Details for the file knockofforigins-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: knockofforigins-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 9.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.4.0 CPython/3.11.7 Linux/6.8.0-31-generic

File hashes

Hashes for knockofforigins-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 fb7f29bed5e47223649bdb02cb0f935b4bd7afa86246ed80d198838d84c131b7
MD5 2b8b6aca46dd337a55dcbc920d3020c3
BLAKE2b-256 30a32ad888f8b4c2a5b64f2922bc8f5b42971a16e0e2dccbc85b269857e90b5e

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