how come accuracy_score recognizes the positive label and precision_score does not?
Accuracy is symmetric in the naming of positive/negative classes, but precision is not: for accuracy, it doesn't matter which class is &quot;positive.&quot;  So accuracy_score doesn't have a parameter pos_label, and will error if you try to pass that parameter; meanwhile precision_score has default pos_label=1, so if your labels don't include 1 and you leave the parameter to the default, you'll get an error.