from sklearn.metrics import confusion_matrix
tn, fp, fn, tp = confusion_matrix(y_true, y_predicted)
Note the rows and columns of the confusion matrix from sklearn
do not match those show on most websites.
Precision: The ratio of True Positives to all Predicted Positives: $\dfrac{TP}{TP+FP}$
$F_1$ Score: A balanced measure (0 to 1) that includes sensitity and recall: $\dfrac{2 TP}{2TP + FP + FN}$
from sklearn import metrics
fpr, tpr, thresholds = metrics.roc_curve(y_true, y_predict)
roc_auc = metrics.auc(fpr, tpr)
plt.plot(fpr, tpr)
Working with Pima Diabetes Database, which has problems (zeros for various entries). We have given you a cleaned data set on D2L (you will need to download it again!).
You can skip 2.1 and 2.2 today and go to 2.3; we will discuss how to clean that data after class.