a490a1e41a8d3a4547fa0a46e12cf0584431e520,mir_eval/structure.py,,pairwise,#,69

Before Change


    agree_est   = agree_est[idx]

    // Find the pairs in agreement
    matches     = float((agree_ref & agree_est).sum())
    precision   = matches / agree_est.sum()
    recall      = matches / agree_ref.sum()
    f_measure   = util.f_measure(precision, recall, beta=beta)

After Change


    matches     = 0.0
    n_agree_ref = 0.0
    n_agree_est = 0.0
    for i in xrange(len(y_ref)):
        for j in xrange(i + 1, len(y_ref)):
            // Do i and j match in reference?
            ref_match = (y_ref[i] == y_ref[j])
            n_agree_ref += ref_match

            // Or in estimate?
            est_match = (y_est[i] == y_est[j])
            n_agree_est += est_match

            // If both, we have agreement
            matches += (ref_match & est_match)
            
    precision   = matches / n_agree_est
    recall      = matches / n_agree_ref
    f_measure   = util.f_measure(precision, recall, beta=beta)
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 6

Instances


Project Name: craffel/mir_eval
Commit Name: a490a1e41a8d3a4547fa0a46e12cf0584431e520
Time: 2014-04-17
Author: brm2132@columbia.edu
File Name: mir_eval/structure.py
Class Name:
Method Name: pairwise


Project Name: interactiveaudiolab/nussl
Commit Name: 6ad8b3a6d6e98dda6f83390c6f7935377788d2bc
Time: 2015-07-31
Author: fpishdadian@u.northwestern.edu
File Name: KAM.py
Class Name: Kernel
Method Name: sim


Project Name: layumi/Person_reID_baseline_pytorch
Commit Name: 6b672ac6a0c6bbc41f89d3e4bc528b937363e032
Time: 2019-06-02
Author: zdzheng12@gmail.com
File Name: test.py
Class Name:
Method Name: extract_feature