b2a33bb95c72610411541b5aedb202f20b3349d3,tests/post-build/test_vectors.py,,test_l2_normalize_rows,#Any#,95

Before Change


    vectors = l2_normalize_rows(vectors)

    lengths = np.sqrt(np.sum(np.power(vectors, 2), axis="columns"))
    ok_(all(isclose(length, 1.0, rel_tol=1e-04) for length in lengths))

    // Check if a data frame of all zeroes will be normalized to NaN
    frame = pd.DataFrame(np.zeros(shape=(1, 10)))

After Change



    lengths = np.sqrt(np.sum(np.power(vectors, 2), axis="columns"))
    for length in lengths:
        assert_almost_equal(length, 1.0, places=4)

    // Check if a data frame of all zeroes will be normalized to NaN
    frame = pd.DataFrame(np.zeros(shape=(1, 10)))
    frame = l2_normalize_rows(frame)
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 3

Instances


Project Name: commonsense/conceptnet5
Commit Name: b2a33bb95c72610411541b5aedb202f20b3349d3
Time: 2017-05-16
Author: rob@luminoso.com
File Name: tests/post-build/test_vectors.py
Class Name:
Method Name: test_l2_normalize_rows


Project Name: commonsense/conceptnet5
Commit Name: b2a33bb95c72610411541b5aedb202f20b3349d3
Time: 2017-05-16
Author: rob@luminoso.com
File Name: tests/post-build/test_vectors.py
Class Name:
Method Name: test_shrink_and_sort


Project Name: geomstats/geomstats
Commit Name: cdd7ca5632d3466ea02efcd6696420c18a32e9ae
Time: 2021-03-17
Author: nicolas.guigui@inria.fr
File Name: tests/test_stiefel.py
Class Name: TestStiefel
Method Name: test_log_vectorization_shape