1872ec1a1359fc4486f244b7e6e561cbbba10882,nilearn/decomposition/tests/test_canica.py,,test_component_sign,#,84

Before Change



    // have some +1"s (so things are not degenerate), but still have more -1"s
    // than +1"s
    for mp in components:
        mp[rng.randn(*mp.shape) > .8] *= -.5
        assert_less_than(mp.max(), -mp.min())

    // fit run CanICA at different times of the day
    canica = CanICA(n_components=4, random_state=rng, mask=mask_img)
    for _ in range(3):
        canica.fit(data)
        maps = canica.masker_.inverse_transform(canica.components_).get_data()

After Change


    // BF for issue /맒

    // make data (SVD)
    rng = np.random.RandomState(0)
    shape = (20, 10, 1)
    affine = np.eye(4)
    components = _make_canica_components(shape)

    // make more de-activations than activations
    for mp in components:
        mp[rng.randn(*mp.shape) > .8] *= -1.
        assert_less_than(mp.max(), -mp.min())  // goal met ?
    data = _make_data_from_components(components, affine, shape,
                                      rng=rng, n_subjects=2)

    // synthesize data with given components
    data = _make_data_from_components(components, affine, shape, rng=rng,
                                      n_subjects=2)
    mask_img = nibabel.Nifti1Image(np.ones(shape, dtype=np.int8), affine)

    // fit run CanICA at different times of the day
    canica = CanICA(n_components=4, random_state=rng, mask=mask_img)
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 4

Instances


Project Name: nilearn/nilearn
Commit Name: 1872ec1a1359fc4486f244b7e6e561cbbba10882
Time: 2015-05-08
Author: elvis.dohmatob@inria.fr
File Name: nilearn/decomposition/tests/test_canica.py
Class Name:
Method Name: test_component_sign


Project Name: GPflow/GPflow
Commit Name: cc5e7d00a6696a8cf6e40686455e7e034fbf26ff
Time: 2017-09-28
Author: art.art.v@gmail.com
File Name: testing/test_kerns.py
Class Name: TestSlice
Method Name: test_asymm


Project Name: elfi-dev/elfi
Commit Name: 0df5ed4aa1fd4a41c959909e9823566b9f3ce970
Time: 2017-03-01
Author: jarno.lintusaari@aalto.fi
File Name: elfi/loader.py
Class Name: RandomStateLoader
Method Name: load