cec517350d259a4f49a58a769db784c248cfffa8,mlxtend/evaluate/accuracy.py,,accuracy_score,#Any#Any#Any#Any#Any#,17

Before Change


        return _compute_metric(target_temp, predicted_temp, normalize)

    elif method == "average":
        return sum([_compute_metric(np.where(target_temp != l, 1, 0),
                    np.where(predicted_temp != l, 1, 0))
                    for l in unique_labels]) / float(unique_labels.shape[0])

    else:
        raise ValueError("`method` must be "standard", "average""
                         "or "binary". Got "%s"." % method)

After Change



    elif method == "average":
        all_class_acc = []
        for c in np.unique(y_target):
            positive_labels = (y_target == c)
            class_acc = np.mean((y_predicted == c)[positive_labels])
            all_class_acc.append(class_acc)
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 3

Instances


Project Name: rasbt/mlxtend
Commit Name: cec517350d259a4f49a58a769db784c248cfffa8
Time: 2021-01-08
Author: mail@sebastianraschka.com
File Name: mlxtend/evaluate/accuracy.py
Class Name:
Method Name: accuracy_score


Project Name: datascienceinc/Skater
Commit Name: 5601c4bb909b4146327fa68c6d5b668f997baaff
Time: 2017-03-21
Author: aikramer2@gmail.com
File Name: pyinterpret/data/dataset.py
Class Name: DataSet
Method Name: _build_metastore


Project Name: snorkel-team/snorkel
Commit Name: 8b16baea2be04c171893108aeae7fc2edfc08967
Time: 2017-09-20
Author: rogergoldman@gmail.com
File Name: snorkel/utils.py
Class Name:
Method Name: matrix_conflicts