from sklearn metrics import confusion_matrix output [ ]accuracy it may be defined as the number of correct predictions made by our ml model we can easily calculate it by confusion matrix with the help of following formulaaccuracy tp tn tp fp fn tn for above built binary classifiertp tn + and tp+fp+fn+tn + + + = henceaccuracy / which is same as we have calculated after creating our binary classifier precision precisionused in document retrievalsmay be defined as the number of correct documents returned by our ml model we can easily calculate it by confusion matrix with the help of following formulaprecision tp tp fp for the above built binary classifiertp and tp+fp + henceprecision / recall or sensitivity recall may be defined as the number of positives returned by our ml model we can easily calculate it by confusion matrix with the help of following formularecall tp tp fn