Giter Club home page Giter Club logo

confound_prediction's Introduction

Confound Prediction

Confound_prediction is a Python module to control confound effect in a prediction or classification model.

Any successful prediction model may be driven by a confounding effect that is correlated with the effect of interest. It is important to control that detected associations are not driven by unwanted effects. It is common issue in in neuroscience, epidemiology, economy, agriculture, etc.

We introduce a non-parametric approach, named “confound-isolating cross-validation”, to control for a confounding effect in a predictive model. It is based on crafting a test set on which the effect of interest is independent from the confounding effect.

What expect from Confound_prediction?

Developed framework is based on anti mutual information sampling, a novel sampling approach to create a test set in which the effect of interest is independent from the confounding effect. The grafical illustration of classic and confound-isolating cross-validation:

How does it work?

You provide us

Variables:  

  • X - data with shape (n_samples, n_features)
  • y - target vector with shape (n_samples)
  • z - confound vector with shape (n_samples)

Optional parameters

  • min_sample_size - minimum sample size to be reached, default is 10% of the data
  • n_remove - number of the samples to be removed on each iteration of sampling, default is 4
  • prng - control the pseudo random number generator, default is None
  • cv_folds - number of folders in the cross validation, default is 10

We return you

Variables:

  • x_test, x_train, y_test, y_train, ids_test, ids_train - train and test of X, y and sampled indexes

Installing

Dependences

confound_prediction package requires:

  • Python (>= 3.5)
  • Scipy (>=1.1.0)
  • Scikit-learn (>=0.21.2)
  • Numpy (>=1.14.2)

Optional dependency:

  • Matplotlib (>=2.2.2) for example visualization

User installation

pip install TBD

Examples

Example: create train set and test set without confounding effect

python example/Example_get_testset.py

Example: compare prediction on data sampled with different deconfounding methods

python example/

Example: compare prediction on the data with different confound effect

python example/

Example: evolution of mutual information and correlation on each itteration of 'confound-isolation cross-validation' method

python example/Example_compare_mutual_info_correlation.py

Another methods

We also provide 2 state of the art in neuroscience deconfounding techniques:

  1. Out-of-sample deconfounding

  2. Deconfounding test and train jointly

References

[1] TBD

[2] D. Chyzhyk, G. Varoquaux, B. Thirion and M. Milham, "Controlling a confound in predictive models with a test set minimizing its effect," 2018 International Workshop on Pattern Recognition in Neuroimaging (PRNI), Singapore, 2018, pp. 1-4. doi: 10.1109/PRNI.2018.8423961 PDF

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.