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|
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 7

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: CellProfiler/CellProfiler
Commit Name: f3e6f09e2a915766454b6ab2a9b0e4cf73d4572e
Time: 2013-06-10
Author: leek@broadinstitute.org
File Name: cellprofiler/modules/identifytertiaryobjects.py
Class Name: IdentifyTertiaryObjects
Method Name: run


Project Name: rusty1s/pytorch_geometric
Commit Name: b2002a8ef80ecbecee09fd61b910c987648455c7
Time: 2020-08-26
Author: matthias.fey@tu-dortmund.de
File Name: torch_geometric/datasets/karate.py
Class Name: KarateClub
Method Name: __init__