1 Answers

3
votes

It simply indicates how much each smaple affects the metric. Look at this example:

With below y_true and y_pred the accuracy_score would be 0.6666666:

y_true = [0, 0, 1]
y_pred = [0, 1, 1]

accuracy_score(y_true, y_pred) # 0.6666666666666666

But if second sample is more important to us than other two, we can enforce it's significance with sample_weight:

accuracy_score(y_true, y_pred, sample_weight=[1, 2, 1]) # 0.5