July 2019
Beginner to intermediate
740 pages
16h 52m
English
When our classes are roughly equal in size, we can use accuracy, which will give us the percentage of correctly classified values:

The accuracy_score() function in sklearn.metrics will calculate the accuracy as per the formula; however, the score() method of our model will also give us the accuracy (this isn't always the case, as we will see with grid search in Chapter 10, Making Better Predictions – Optimizing Models):
>>> red_quality_lr.score(r_X_test, r_y_test)0.775
Since accuracy is the percent we correctly classified (our success rate), it follows that our error rate (the percent we got wrong) can be calculated ...
Read now
Unlock full access