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

Before Change



    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""

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)

        return np.mean(all_class_acc)

    else:
        raise ValueError("`method` must be "standard", "average""
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 6

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: biotite-dev/biotite
Commit Name: 1675e2873db77528ef1dee6fc49aaccfca9a369b
Time: 2020-11-27
Author: tom.mueller@beachouse.de
File Name: src/biotite/structure/dotbracket.py
Class Name:
Method Name: dot_bracket


Project Name: aertslab/pySCENIC
Commit Name: 6d6a32dd677aa6097c4e77b359f81989c3e949af
Time: 2018-04-05
Author: vandesande.bram@gmail.com
File Name: src/pyscenic/rnkdb.py
Class Name:
Method Name: build_rankings