0d78d2a33bb152be3ba5d49dad3433472b0cf9f1,mir_eval/boundary.py,,detection,#Any#Any#Any#Any#Any#,46

Before Change


    precision   = np.mean(dist.max(axis=0))

    // Recall: how many of the intervals did we catch?
    recall      = np.mean(dist.max(axis=1))

    // And the f-measure
    f_measure   = util.f_measure(precision, recall, beta=beta)

After Change



    n_ref, n_est = len(reference_boundaries), len(estimated_boundaries)
    
    skew_adjacency  = np.zeros((n_ref + n_est, n_ref + n_est), dtype=np.int32)
    window_match    = np.abs(np.subtract.outer(reference_boundaries, estimated_boundaries)) <= window
    window_match    = window_match.astype(int)
    
    // L. Lovasz On determinants, matchings and random algorithms. 
    // In L. Budach, editor, Fundamentals of Computation Theory, pages 565-574. Akademie-Verlag, 1979.
    //
    // If we build the skew-symmetric adjacency matrix 
    // D[i, n_ref+j] = 1 <=> ref[i] within window of est[j]
    // D[n_ref + j, i] = -1 <=> same
    //
    // then rank(D) = 2 * maximum matching
    //
    skew_adjacency[:n_ref, n_ref:] = window_match
    skew_adjacency[n_ref:, :n_ref] = -window_match.T
    
    matching_size = np.linalg.matrix_rank(skew_adjacency) / 2.0
    
    // Precision = |matching| / |// predictions|
    // Recall    = |matching| / |// annotations|
    
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 9

Instances


Project Name: craffel/mir_eval
Commit Name: 0d78d2a33bb152be3ba5d49dad3433472b0cf9f1
Time: 2014-04-15
Author: brm2132@columbia.edu
File Name: mir_eval/boundary.py
Class Name:
Method Name: detection


Project Name: LxMLS/lxmls-toolkit
Commit Name: eabf2d7ea984e75cc898326317be8cc3b5e13183
Time: 2013-07-09
Author: ramon@astudillo.com
File Name: code/classifiers/gaussian_naive_bayes.py
Class Name: GaussianNaiveBayes
Method Name: train


Project Name: tyarkoni/pliers
Commit Name: b3cf6fd0c65394a97c2dbcff6dd835de5006e10f
Time: 2016-10-12
Author: tyarkoni@gmail.com
File Name: featurex/extractors/audio.py
Class Name: STFTExtractor
Method Name: _extract