• Stars
    star
    408
  • Rank 105,946 (Top 3 %)
  • Language
    Python
  • License
    MIT License
  • Created about 8 years ago
  • Updated almost 2 years ago

Reviews

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

Repository Details

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

Master status: Master Build Status Master Code Health Master Coverage Status

Development status: Development Build Status Development Code Health Development Coverage Status

Package information: Python 2.7 Python 3.5 License PyPI version

scikit-rebate

This package includes a scikit-learn-compatible Python implementation of ReBATE, a suite of Relief-based feature selection algorithms for Machine Learning. These Relief-Based algorithms (RBAs) are designed for feature weighting/selection as part of a machine learning pipeline (supervised learning). Presently this includes the following core RBAs: ReliefF, SURF, SURF*, MultiSURF*, and MultiSURF. Additionally, an implementation of the iterative TuRF mechanism and VLSRelief is included. It is still under active development and we encourage you to check back on this repository regularly for updates.

These algorithms offer a computationally efficient way to perform feature selection that is sensitive to feature interactions as well as simple univariate associations, unlike most currently available filter-based feature selection methods. The main benefit of Relief algorithms is that they identify feature interactions without having to exhaustively check every pairwise interaction, thus taking significantly less time than exhaustive pairwise search.

Certain algorithms require user specified run parameters (e.g. ReliefF requires the user to specify some 'k' number of nearest neighbors).

Relief algorithms are commonly applied to genetic analyses, where epistasis (i.e., feature interactions) is common. However, the algorithms implemented in this package can be applied to almost any supervised classification data set and supports:

  • Feature sets that are discrete/categorical, continuous-valued or a mix of both

  • Data with missing values

  • Binary endpoints (i.e., classification)

  • Multi-class endpoints (i.e., classification)

  • Continuous endpoints (i.e., regression)

Built into this code, is a strategy to 'automatically' detect from the loaded data, these relevant characteristics.

Of our two initial ReBATE software releases, this scikit-learn compatible version primarily focuses on ease of incorporation into a scikit learn analysis pipeline. This code is most appropriate for scikit-learn users, Windows operating system users, beginners, or those looking for the most recent ReBATE developments.

An alternative 'stand-alone' version of ReBATE is also available that focuses on improving run-time with the use of Cython for optimization. This implementation also outputs feature names and associated feature scores as a text file by default.

License

Please see the repository license for the licensing and usage information for scikit-rebate.

Generally, we have licensed scikit-rebate to make it as widely usable as possible.

Installation

scikit-rebate is built on top of the following existing Python packages:

  • NumPy

  • SciPy

  • scikit-learn

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, and scikit-learn can be installed in Anaconda via the command:

conda install numpy scipy scikit-learn

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

pip install skrebate

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

Usage

We have designed the Relief algorithms to be integrated directly into scikit-learn machine learning workflows. For example, the ReliefF algorithm can be used as a feature selection step in a scikit-learn pipeline as follows.

import pandas as pd
import numpy as np
from sklearn.pipeline import make_pipeline
from skrebate import ReliefF
from sklearn.ensemble import RandomForestClassifier
from sklearn.model_selection import cross_val_score

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

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

clf = make_pipeline(ReliefF(n_features_to_select=2, n_neighbors=100),
                    RandomForestClassifier(n_estimators=100))

print(np.mean(cross_val_score(clf, features, labels)))
>>> 0.795

For more information on the Relief algorithms available in this package and how to use them, please refer to our usage documentation.

Contributing to scikit-rebate

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

Please refer to our contribution guidelines prior to working on a new feature or bug fix.

Citing scikit-rebate

If you use scikit-rebate in a scientific publication, please consider citing the following paper:

Ryan J. Urbanowicz, Randal S. Olson, Peter Schmitt, Melissa Meeker, Jason H. Moore (2017). Benchmarking Relief-Based Feature Selection Methods. arXiv preprint, under review.

BibTeX entry:

@misc{Urbanowicz2017Benchmarking,
    author = {Urbanowicz, Ryan J. and Olson, Randal S. and Schmitt, Peter and Meeker, Melissa and Moore, Jason H.},
    title = {Benchmarking Relief-Based Feature Selection Methods},
    year = {2017},
    howpublished = {arXiv e-print. https://arxiv.org/abs/1711.08477},
}

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

Aliro

Aliro: AI-Driven Data Science
JavaScript
224
star
5

tpot2

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

ClinicalDataSources

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

scikit-mdr

A sklearn-compatible Python implementation of Multifactor Dimensionality Reduction (MDR) for feature construction.
Python
125
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