a490a1e41a8d3a4547fa0a46e12cf0584431e520,mir_eval/structure.py,,pairwise,#Any#Any#Any#Any#Any#Any#,69
Before Change
agree_ref = np.equal.outer(y_ref, y_ref)
// Index just the triangle above the main diagonal
idx = np.triu_indices_from(agree_ref, k=1)
// Slice down to just the trignale
agree_ref = agree_ref[idx]
// Construct the frame label-agreement matrix (estimated)
agree_est = np.equal.outer(y_est, y_est)
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)
In pattern: SUPERPATTERN
Frequency: 10
Non-data size: 7
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: maldil/MLEditsTest
Commit Name: 58a97e365078690f28cb8901ffac2231cceabc2c
Time: 2021-02-15
Author: malinda.dilhara@gmail.com
File Name: test9.py
Class Name: Test6
Method Name: add_arrays
Project Name: maldil/MLEditsTest
Commit Name: 2e2dba412ddb9e0708ccdb057e1881496c99240a
Time: 2021-02-15
Author: malinda.dilhara@gmail.com
File Name: test11.py
Class Name: Test6
Method Name: add_arrays
Project Name: maldil/MLEditsTest
Commit Name: 0e756a0a518c5f44d80773eace0fc95223aa9ac0
Time: 2021-02-13
Author: malinda.dilhara@gmail.com
File Name: test7.py
Class Name: Test6
Method Name: add_arrays
Project Name: maldil/MLEditsTest
Commit Name: 475206923b76720bc5e9e52408b387cc65feec7a
Time: 2021-02-15
Author: malinda.dilhara@gmail.com
File Name: test8.py
Class Name: Test6
Method Name: add_arrays
Project Name: maldil/MLEditsTest
Commit Name: a8650518474c06aa59cf7e0ab535fd216656182b
Time: 2021-02-15
Author: malinda.dilhara@gmail.com
File Name: text10.py
Class Name: Test6
Method Name: add_arrays
Project Name: maldil/MLEditsTest
Commit Name: 1f94c4a3f1faac830b5c7a043d95b421ac04cedb
Time: 2021-02-13
Author: malinda.dilhara@gmail.com
File Name: test6.py
Class Name: Test6
Method Name: add_arrays
Project Name: maldil/MLEditsTest
Commit Name: 4e9c45386eb2b24346cb9741d9ae93eccae4e8e8
Time: 2021-02-13
Author: malinda.dilhara@gmail.com
File Name: text5.py
Class Name: Test1
Method Name: add_arrays
Project Name: maldil/MLEditsTest
Commit Name: dab8a919a7861c40a8a7e2fc259d82f563273a7e
Time: 2021-02-13
Author: malinda.dilhara@gmail.com
File Name: test3.py
Class Name: Test
Method Name: add_arrays
Project Name: scikit-image/scikit-image
Commit Name: dd17b42f452bc156f55e3400f8ebc84d58761e65
Time: 2019-12-30
Author: gregory.lee@cchmc.org
File Name: skimage/filters/_window.py
Class Name:
Method Name: window