98d8f98800a76e6809c5ac43245bfe685a5cf436,mir_eval/structure.py,,pairwise,#,69

Before Change


    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)

After Change



    // Repeat for estimate
    agree_est   = np.equal.outer(y_est, y_est)
    n_agree_est = (agree_est.sum() - len(y_est)) / 2.0

    // Find where they agree
    matches     = np.logical_and(agree_ref, agree_est)
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 4

Instances


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


Project Name: UFAL-DSG/tgen
Commit Name: ec01f586b20cc3e9e15146e71d9248301ba277ae
Time: 2014-07-02
Author: odusek@ufal.mff.cuni.cz
File Name: tgen/rank.py
Class Name: PerceptronRanker
Method Name: _get_rival_candidates


Project Name: scikit-learn-contrib/lightning
Commit Name: 1c1b85686b9744f988d05ecdbaca20c198488e7b
Time: 2014-06-20
Author: mathieu@mblondel.org
File Name: lightning/impl/prank.py
Class Name: PRank
Method Name: predict