From affc3655808a31f0eb8c98bc9c117aa140cbdf5a Mon Sep 17 00:00:00 2001 From: Rishit Dagli Date: Mon, 24 May 2021 13:39:57 +0000 Subject: [PATCH] Add intro about confusion matrix --- Regression/4-Logistic/README.md | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/Regression/4-Logistic/README.md b/Regression/4-Logistic/README.md index 020f3fba5..73130b289 100644 --- a/Regression/4-Logistic/README.md +++ b/Regression/4-Logistic/README.md @@ -169,7 +169,12 @@ Predicted labels: [0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 1 0 1 0 0 1 0 0 0 1 0] ``` -Let's unpack some of those [terms](https://scikit-learn.org/stable/modules/generated/sklearn.metrics.classification_report.html?highlight=classification_report#sklearn.metrics.classification_report): +Let's unpack some of those [terms](https://scikit-learn.org/stable/modules/generated/sklearn.metrics.classification_report.html?highlight=classification_report#sklearn.metrics.classification_report) with a confusion matrix to help us measure the performance of our mdoel: + +```python +from sklearn.metrics import confusion_matrix +confusion_matrix(y_test, predictions) +``` 🎓 Precision: The fraction of relevant instances among the retrieved instances (e.g. which labels were well-labeled)