622b310cb082f9e41f6d27d5c750a5032bc5b6e2,nilearn/regions/tests/test_parcellations.py,,test_fit_transform,#,213

Before Change


    confounds = rng.randn(*(10, 3))
    confounds_list = [confounds, confounds, confounds]

    if LooseVersion(sklearn.__version__) >= LooseVersion("0.15"):
        for method in ["kmeans", "ward", "complete", "average"]:
            parcellator = Parcellations(method=method, n_parcels=5)
            signals = parcellator.fit_transform(fmri_imgs)
            assert_true(parcellator.labels_img_ is not None)
            if method != "kmeans":
                assert_true(parcellator.connectivity_ is not None)
            assert_true(parcellator.masker_ is not None)
            // fit_transform with confounds
            signals = parcellator.fit_transform(fmri_imgs,
                                                confounds=confounds_list)
            assert_true(isinstance(signals, list))
            assert_equal(signals[0].shape, (10, 5))


def test_inverse_transform():
    rng = np.random.RandomState(0)
    data = np.ones((10, 11, 12, 10))
    data[6, 7, 8] = 2

After Change


    confounds = rng.randn(*(10, 3))
    confounds_list = [confounds, confounds, confounds]

    for method in ["kmeans", "ward", "complete", "average"]:
        parcellator = Parcellations(method=method, n_parcels=5)
        signals = parcellator.fit_transform(fmri_imgs)
        assert_true(parcellator.labels_img_ is not None)
        if method != "kmeans":
            assert_true(parcellator.connectivity_ is not None)
        assert_true(parcellator.masker_ is not None)
        // fit_transform with confounds
        signals = parcellator.fit_transform(fmri_imgs,
                                            confounds=confounds_list)
        assert_true(isinstance(signals, list))
        assert_equal(signals[0].shape, (10, 5))


def test_inverse_transform():
    rng = np.random.RandomState(0)
    data = np.ones((10, 11, 12, 10))
    data[6, 7, 8] = 2
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 5

Non-data size: 10

Instances


Project Name: nilearn/nilearn
Commit Name: 622b310cb082f9e41f6d27d5c750a5032bc5b6e2
Time: 2018-03-08
Author: dkamalakarreddy@gmail.com
File Name: nilearn/regions/tests/test_parcellations.py
Class Name:
Method Name: test_fit_transform


Project Name: nilearn/nilearn
Commit Name: 622b310cb082f9e41f6d27d5c750a5032bc5b6e2
Time: 2018-03-08
Author: dkamalakarreddy@gmail.com
File Name: nilearn/regions/tests/test_parcellations.py
Class Name:
Method Name: test_parcellations_transform_multi_nifti_images


Project Name: nilearn/nilearn
Commit Name: f3a2c1c56b56f28f88963db869377036f01af831
Time: 2018-08-04
Author: kc.insight.pi@gmail.com
File Name: nilearn/connectome/group_sparse_cov.py
Class Name: GroupSparseCovarianceCV
Method Name: fit


Project Name: nilearn/nilearn
Commit Name: 622b310cb082f9e41f6d27d5c750a5032bc5b6e2
Time: 2018-03-08
Author: dkamalakarreddy@gmail.com
File Name: nilearn/regions/tests/test_parcellations.py
Class Name:
Method Name: test_parcellations_fit_on_single_nifti_image


Project Name: nilearn/nilearn
Commit Name: 622b310cb082f9e41f6d27d5c750a5032bc5b6e2
Time: 2018-03-08
Author: dkamalakarreddy@gmail.com
File Name: nilearn/regions/tests/test_parcellations.py
Class Name:
Method Name: test_inverse_transform