98d8f98800a76e6809c5ac43245bfe685a5cf436,mir_eval/structure.py,,pairwise,#Any#Any#Any#Any#Any#Any#,69
Before 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)
After Change
n_agree_ref = (agree_ref.sum() - len(y_ref)) / 2.0
// 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)
n_matches = (matches.sum() - len(y_ref)) / 2.0
In pattern: SUPERPATTERN
Frequency: 3
Non-data size: 6
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: deepchem/deepchem
Commit Name: 624dfb1a1263e5539d30112e2ba7344957b9b20f
Time: 2020-07-20
Author: peastman@stanford.edu
File Name: deepchem/feat/coulomb_matrices.py
Class Name: CoulombMatrix
Method Name: coulomb_matrix
Project Name: librosa/librosa
Commit Name: 7c9c265b4bb1fb8b7cd473dedee93afa868adc7e
Time: 2017-01-05
Author: brian.mcfee@nyu.edu
File Name: librosa/filters.py
Class Name:
Method Name: mel