dd7c34ea3480f2ffd8843171676aaa22b1777bd8,nilearn/decomposition/tests/test_canica.py,,test_canica_square_img,#,8

Before Change


    indices = range(4)

    for i in range(4):
        map = np.abs(maps[i]) > np.abs(maps[i]).max() * 0.95
        for j in indices:
            ref_map = components[j].ravel() != 0
            if np.all(map.ravel() == ref_map):
                indices.remove(j)

After Change


    // FIXME: This could be done more efficiently, e.g. thanks to hungarian
    // Find pairs of matching components
    // compute the cross-correlation matrix between components
    K = np.corrcoef(components, maps.reshape(4, 400))[4:, :4]
    // K should be a permutation matrix, hence its coefficients 
    // should all be close to 0 1 or -1
    K_abs = np.abs(K)
    assert_true(np.sum(K_abs > .9) == 4)
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 4

Instances


Project Name: nilearn/nilearn
Commit Name: dd7c34ea3480f2ffd8843171676aaa22b1777bd8
Time: 2014-05-28
Author: bertrand.thirion@inria.fr
File Name: nilearn/decomposition/tests/test_canica.py
Class Name:
Method Name: test_canica_square_img


Project Name: scikit-learn/scikit-learn
Commit Name: e52e9c8d7536b6315da655164951060642a52707
Time: 2019-09-18
Author: tom.dupre-la-tour@m4x.org
File Name: sklearn/manifold/tests/test_t_sne.py
Class Name:
Method Name: test_binary_perplexity_stability


Project Name: ilastik/ilastik
Commit Name: 64bd668d4cc4ce43dbf42091ba9d87be5187ae02
Time: 2013-06-13
Author: webmaster@burgerdev.de
File Name: lazyflow/operators/opInterpMissingData.py
Class Name:
Method Name: _histogramIntersectionKernel