Made compatible with sklearn 0.13