I just got back from an excellent conference which was organised by the Simons foundation, Eric Alm’s lab and the Bonneau lab. It was mainly about the technical details of microbiome data analysis and the statistical challenges this kind of data presents us with. We heard some amazing talks about how to deal with compositional data (almost all microbiome data is inherently compositional due the sampling procedure), …

## Newton’s method with 10 lines of Python

I’m starting a new series of blog posts, called “XY in less than 10 lines of Python“. This first one is about Newton’s method, which is an old numerical approximation technique that could be used to find the roots of complex polynomials and any differentiable function. Let’s say we have a complicated polynomial: and we want to find its roots. Unfortunately we know from the Galois …

## Solving “real world” problems with SymPy

SymPy is an amazing library for symbolic mathematics in Python. It’s like Mathematica, and its online shell version along with SymPy Gamma is pretty much like Wolfram Alpha (WA). OK, I know you can ask WA some pretty cool questions, but let’s face it, most of use just want to find the derivative of a function, or simplify an expression, and not …

## MIFS – parallelized Mutual Information based Feature Selection module

TL,DR: I wrapped up three mutual information based feature selection methods in a scikit-learn like module. You can find it on my GitHub. It is very easy to use, you can run the example.py or import it into your project and apply it to your data like any other scikit-learn method.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 |
import pandas as pd import mifs # load X and y X = pd.read_csv('my_X_table.csv', index_col=0).values y = pd.read_csv('my_y_vector.csv', index_col=0).values # define MI_FS feature selection method feat_selector = mifs.MutualInformationFeatureSelector() # find all relevant features feat_selector.fit(X, y) # check selected features feat_selector.support_ # check ranking of features feat_selector.ranking_ # call transform() on X to filter it down to selected features X_filtered = feat_selector.transform(X) |

Mutual information based filter methods The following bit is adopted …