10f51a7713242b65cd4c6ed89f644631fb5ef583,mir_eval/segment.py,,boundary_detection,#,15

Before Change



    // Convert intervals to boundaries
    reference_boundaries = util.intervals_to_boundaries(reference_intervals)[0]
    estimated_boundaries = util.intervals_to_boundaries(estimated_intervals)[0]

    // Suppress the first and last intervals
    if trim:
        reference_boundaries = reference_boundaries[1:-1]
        estimated_boundaries = estimated_boundaries[1:-1]

    // If we have no boundaries, we get no score.
    if len(reference_boundaries) == 0 or len(estimated_boundaries) == 0:
        return 0.0, 0.0, 0.0

    // Compute the hits
    dist        = np.abs( np.subtract.outer(reference_boundaries, estimated_boundaries)) <= window

    // Precision: how many estimated intervals were hits?
    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)

    return precision, recall, f_measure

After Change



    // Convert intervals to boundaries
    reference_boundaries = util.intervals_to_boundaries(reference_intervals)
    estimated_boundaries = util.intervals_to_boundaries(estimated_intervals)

    // Suppress the first and last intervals
    if trim:
        reference_boundaries = reference_boundaries[1:-1]
        estimated_boundaries = estimated_boundaries[1:-1]

    // If we have no boundaries, we get no score.
    if len(reference_boundaries) == 0 or len(estimated_boundaries) == 0:
        return 0.0, 0.0, 0.0

    // Compute the hits
    dist        = np.abs( np.subtract.outer(reference_boundaries, estimated_boundaries)) <= window

    // Precision: how many estimated intervals were hits?
    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)

    return precision, recall, f_measure
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 4

Non-data size: 3

Instances


Project Name: craffel/mir_eval
Commit Name: 10f51a7713242b65cd4c6ed89f644631fb5ef583
Time: 2014-03-29
Author: craffel@gmail.com
File Name: mir_eval/segment.py
Class Name:
Method Name: boundary_detection


Project Name: craffel/mir_eval
Commit Name: 10f51a7713242b65cd4c6ed89f644631fb5ef583
Time: 2014-03-29
Author: craffel@gmail.com
File Name: mir_eval/segment.py
Class Name:
Method Name: boundary_deviation