1cc277630f2381f2ba0f01dcf833801a830f5c3b,skimage/metrics/_contingency_table.py,,contingency_table,#,7

Before Change



    im_test_r = im_test.ravel()
    im_true_r = im_true.ravel()
    ignored = np.zeros(im_true_r.shape, np.bool)
    for label in ignore_labels:
        ignored[im_true_r == label] = True
    data = np.ones(im_true_r.shape)
    data[ignored] = 0

After Change


        ignore_labels = []
    im_test_r = im_test.reshape(-1)
    im_true_r = im_true.reshape(-1)
    data = np.isin(im_true_r, ignore_labels, invert=True).astype(float)
    if normalize:
        data /= np.count_nonzero(data)
    cont = sparse.coo_matrix((data, (im_true_r, im_test_r))).tocsr()
    return cont
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 4

Instances


Project Name: scikit-image/scikit-image
Commit Name: 1cc277630f2381f2ba0f01dcf833801a830f5c3b
Time: 2020-08-04
Author: rfezzani@gmail.com
File Name: skimage/metrics/_contingency_table.py
Class Name:
Method Name: contingency_table


Project Name: scikit-learn/scikit-learn
Commit Name: 1801c4b27479d82a95a49a17a06edeb1c15fff39
Time: 2020-02-12
Author: 34657725+jeremiedbb@users.noreply.github.com
File Name: sklearn/decomposition/_nmf.py
Class Name:
Method Name: _initialize_nmf


Project Name: luispedro/mahotas
Commit Name: 93663c2cc8c0c8bc3c6f28c27679707305948c80
Time: 2010-05-11
Author: lpc@cmu.edu
File Name: tests/test_texture.py
Class Name:
Method Name: test_cooccurence