into accountit can be better measure than accuracy on imbalanced binary classification datasets let' run it on the predictions for the "nine vs restdataset that we computed earlier herewe will assume that the "nineclass is the positive class (it is labeled as true while the rest is labeled as false)so the positive class is the minority classin[ ]from sklearn metrics import _score print(" score most frequent{ }formatf _score(y_testpred_most_frequent))print(" score dummy{ }format( _score(y_testpred_dummy))print(" score tree{ }format( _score(y_testpred_tree))print(" score logistic regression{ }formatf _score(y_testpred_logreg))out[ ] score most frequent score dummy score tree score logistic regression we can note two things here firstwe get an error message for the most_frequent predictionas there were no predictions of the positive class (which makes the denominator in the -score zeroalsowe can see pretty strong distinction between the dummy predictions and the tree predictionswhich wasn' clear when looking at accuracy alone using the -score for evaluationwe summarized the predictive performance again in one number howeverthe -score seems to capture our intuition of what makes good model much better than accuracy did disadvantage of the -scorehoweveris that it is harder to interpret and explain than accuracy if we want more comprehensive summary of precisionrecalland -scorewe can use the classification_report convenience function to compute all three at onceand print them in nice formatin[ ]from sklearn metrics import classification_report print(classification_report(y_testpred_most_frequenttarget_names=["not nine""nine"]) model evaluation and improvement