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)
return np.mean(all_class_acc)
else:
raise ValueError("`method` must be "standard", "average""
In pattern: SUPERPATTERN
Frequency: 3
Non-data size: 4
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: bokeh/bokeh
Commit Name: 1c0433bcd6928e55ee70e582fd538c3bc854d04e
Time: 2017-01-09
Author: bryanv@continuum.io
File Name: examples/embed/widget.py
Class Name:
Method Name: update_pyramid
Project Name: bokeh/bokeh
Commit Name: 1c0433bcd6928e55ee70e582fd538c3bc854d04e
Time: 2017-01-09
Author: bryanv@continuum.io
File Name: examples/models/population_server.py
Class Name:
Method Name: update_pyramid