• Stars
    star
    125
  • Rank 286,335 (Top 6 %)
  • Language
    Python
  • License
    MIT License
  • Created over 8 years ago
  • Updated over 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

A sklearn-compatible Python implementation of Multifactor Dimensionality Reduction (MDR) for feature construction.

Master status: Build Status Code Health Coverage Status

Development status: Build Status Code Health Coverage Status

Package information: Python 2.7 Python 3.6 License PyPI version

Join the chat at https://gitter.im/EpistasisLab/scikit-mdr

MDR

A scikit-learn-compatible Python implementation of Multifactor Dimensionality Reduction (MDR) for feature construction. This project is still under active development and we encourage you to check back on this repository regularly for updates.

MDR is an effective feature construction algorithm that is capable of modeling higher-order interactions and capturing complex patterns in data sets.

MDR currently only works with categorical features and supports both binary classification and regression problems. We are working on expanding the algorithm to cover more problem types and provide more convenience features.

License

Please see the repository license for the licensing and usage information for the MDR package.

Generally, we have licensed the MDR package to make it as widely usable as possible.

Installation

MDR is built on top of the following existing Python packages:

  • NumPy

  • SciPy

  • scikit-learn

  • matplotlib

All of the necessary Python packages can be installed via the Anaconda Python distribution, which we strongly recommend that you use. We also strongly recommend that you use Python 3 over Python 2 if you're given the choice.

NumPy, SciPy, scikit-learn, and matplotlib can be installed in Anaconda via the command:

conda install numpy scipy scikit-learn matplotlib

Once the prerequisites are installed, you should be able to install MDR with a pip command:

pip install scikit-mdr

Please file a new issue if you run into installation problems.

Examples

MDR has been coded with a scikit-learn-like interface to be easy to use. The typical fit, transform, and fit_transform methods are available for every feature construction algorithm. For example, MDR can be used to construct a new feature composed from two existing features:

from mdr import MDR
import pandas as pd

genetic_data = pd.read_csv('https://github.com/EpistasisLab/scikit-mdr/raw/development/data/GAMETES_Epistasis_2-Way_20atts_0.4H_EDM-1_1.tsv.gz', sep='\t', compression='gzip')

features = genetic_data.drop('class', axis=1).values
labels = genetic_data['class'].values

my_mdr = MDR()
my_mdr.fit(features, labels)
my_mdr.transform(features)
>>>array([[1],
>>>       [1],
>>>       [1],
>>>       ...,
>>>       [0],
>>>       [0],
>>>       [0]])

You can also use MDR as a classifier, and evaluate the quality of the constructed feature with the score function:

from mdr import MDRClassifier
import pandas as pd

genetic_data = pd.read_csv('https://github.com/EpistasisLab/scikit-mdr/raw/development/data/GAMETES_Epistasis_2-Way_20atts_0.4H_EDM-1_1.tsv.gz', sep='\t', compression='gzip')

features = genetic_data.drop('class', axis=1).values
labels = genetic_data['class'].values

my_mdr = MDRClassifier()
my_mdr.fit(features, labels)
my_mdr.score(features, labels)
>>>0.998125

If you want to use MDR for regression problems, use ContinuousMDR:

from mdr import ContinuousMDR
import pandas as pd

genetic_data = pd.read_csv('https://github.com/EpistasisLab/scikit-mdr/raw/development/data/GAMETES_Epistasis_2-Way_continuous_endpoint_a_20s_1600her_0.4__maf_0.2_EDM-2_01.tsv.gz', sep='\t', compression='gzip')
features = genetic_data[['M0P0', 'M0P1']].values
targets = genetic_data['Class'].values

my_cmdr = ContinuousMDR()
my_cmdr.fit(features, targets)
my_cmdr.transform(features)
>>>array([[0],
>>>       [1],
>>>       [1],
>>>       ...,
>>>       [0],
>>>       [1],
>>>       [1]])

Contributing to MDR

We welcome you to check the existing issues for bugs or enhancements to work on. If you have an idea for an extension to the MDR package, please file a new issue so we can discuss it.

Having problems or have questions about MDR?

Please check the existing open and closed issues to see if your issue has already been attended to. If it hasn't, file a new issue on this repository so we can review your issue.

Citing MDR

If you use this software in a publication, please consider citing it. You can cite the repository directly with the following DOI:

[blank for now]

Support for MDR

The MDR package was developed in the Computational Genetics Lab with funding from the NIH. We're incredibly grateful for their support during the development of this project.

More Repositories

1

tpot

A Python Automated Machine Learning tool that optimizes machine learning pipelines using genetic programming.
Python
9,638
star
2

pmlb

PMLB: A large, curated repository of benchmark datasets for evaluating supervised machine learning algorithms.
Python
802
star
3

KRAGEN

Software to implement GoT with a weviate vectorized database
Python
577
star
4

scikit-rebate

A scikit-learn-compatible Python implementation of ReBATE, a suite of Relief-based feature selection algorithms for Machine Learning.
Python
408
star
5

Aliro

Aliro: AI-Driven Data Science
JavaScript
224
star
6

tpot2

A Python Automated Machine Learning tool that optimizes machine learning pipelines using genetic programming.
Jupyter Notebook
181
star
7

ClinicalDataSources

Open or Easy Access Clinical Data Sources for Biomedical Research
168
star
8

ReBATE

Relief Based Algorithms of ReBATE implemented in Python with Cython optimization. This repository is no longer being updated. Please see scikit-rebate.
Python
32
star
9

MIMIC_trajectories

Jupyter Notebook
30
star
10

digen

Diverse and generative ML benchmarks
Jupyter Notebook
14
star
11

ml-analyst

Analysis pipeline for quick ML analyses.
Python
11
star
12

3DHeatmap

3D Heatmap tool in Unity3D. Inst. for Biomed. Informatics, Univ. of PA
C#
10
star
13

imputation

https://www.biorxiv.org/content/early/2017/07/24/167858
Jupyter Notebook
9
star
14

interpret_ehr

Interpretation of machine learning predictions for patient outcomes in electronic health records
Jupyter Notebook
9
star
15

AlzKB

Python
8
star
16

hibachi

Data simulation software that creates data sets with particular characteristics
Python
8
star
17

autoqtl

Automated Quantitative Trait Locus Analysis (AutoQTL)
Python
8
star
18

EBIC.jl

EBIC - a biclustering algorithm in Julia
Julia
7
star
19

EpistasisLab.github.io

Identifying the complex genetic architectures of disease
6
star
20

qsar-gnn

TeX
6
star
21

SAFE

The SAFE Algorithm: Solution and Fitness Evolution
Python
4
star
22

DTox

A knowledge-guided deep learning model for prediction and interpretation of drug toxicity
HTML
4
star
23

regens

Recombines real genomic segments to simulate whole genomes
Python
4
star
24

rebate-benchmark

A centralized repository to benchmark ReBATE performance across a variety of parameter settings and datasets.
Jupyter Notebook
4
star
25

gecco2017-new-benchmarking-standards

Pages for workshops run by Epistasis Lab members
3
star
26

evolved-stats

A research project using genetic programming to discover and optimize statistical tests.
Jupyter Notebook
3
star
27

penn-lpc-scripts

Scripts that I wrote for use on the Penn LPC
Python
2
star
28

LPC

Documentation and informational resources for LPC use
2
star
29

tpot-kaggle

tpot applications on kaggle datasets
Jupyter Notebook
2
star
30

OMNIREP

The OMNIREP algorithm: Coevolving encodings and representations
Python
2
star
31

SimpleModelView

A Unity package for a simplified model-view system to help with code<->UI management.
ShaderLab
2
star
32

epistasis_detection

Implementation of an efficient algorithm to compute linear regression models for epistasis that permit varied genetic encodings (penetrance functions) of the interactions of loci and provide statistical evidence for epistasis.
Jupyter Notebook
2
star
33

GPT4_and_Review

Using GPT-4 to write a scientific review article: a pilot evaluation study
Python
2
star
34

STAR_outliers

Python
1
star
35

regens-analysis

Shell
1
star
36

PICV

Proportional instance cross validation
1
star
37

PennAI-Ed

Materials for PennAI-Ed - an initiative to enhance AI and data science education built on PennAI
Shell
1
star
38

TINY

Tiny Genetic Algorithm (GA) and Tiny Genetic Programming (GP)
Python
1
star
39

escargot

Python
1
star
40

AlzKB-updates

Jupyter Notebook
1
star
41

EVE

ENSEMBL VEP on EC2
1
star
42

Conservation-Machine-Learning

Conservation Machine Learning
Python
1
star
43

pennai-arm64-deps

Pre-compiled dependencies for building PennAI Docker images on 64-bit ARM OSs (e.g., raspberry pi)
1
star
44

latent_phenotype_project

Python
1
star
45

PAGER

Python
1
star
46

VEPDB_populator

Population utilities for the VEPDB distributed annotation database, with an annotator written in Python
Python
1
star