April 2019
Intermediate to advanced
426 pages
11h 13m
English
A precision score is the ratio of correctly predicted positive observations to the total number of predicted positive observations, and can be written as follows:

This gives a precision score between 0 and 1, with 1 as the best value indicating that the model classifies correctly all the time. The precision_score function of the sklearn.metrics module calculates this score for us with the following code:
In [ ]: from sklearn.metrics import precision_score print('precision_score:', precision_score(actual, predicted))Out[ ]: precision_score: 0.5147058823529411
The precision score suggests that our model is able to predict a classification ...
Read now
Unlock full access