Model Pipeline - Evaluation and confusion matrix
This pipeline shows how a computer vision model is evaluated using a confusion matrix. It helps us understand how well the model predicts different classes by comparing predictions to true labels.
Jump into concepts and practice - no test required
This pipeline shows how a computer vision model is evaluated using a confusion matrix. It helps us understand how well the model predicts different classes by comparing predictions to true labels.
Loss
1.2 |*
0.9 | *
0.7 | *
0.5 | *
0.4 | *
+---------
1 2 3 4 5 Epochs
| Epoch | Loss ↓ | Accuracy ↑ | Observation |
|---|---|---|---|
| 1 | 1.2 | 0.45 | Model starts learning, accuracy low |
| 2 | 0.9 | 0.60 | Loss decreases, accuracy improves |
| 3 | 0.7 | 0.72 | Model learns better features |
| 4 | 0.5 | 0.80 | Good improvement in accuracy |
| 5 | 0.4 | 0.85 | Model converges with good accuracy |
from sklearn.metrics import confusion_matrix y_true = [0, 1, 0, 1, 0, 1, 1] y_pred = [0, 0, 0, 1, 0, 1, 1] cm = confusion_matrix(y_true, y_pred) print(cm)
from sklearn.metrics import confusion_matrix cm = confusion_matrix(y_pred, y_true) print(cm)What is the likely cause of the error?
[[5 2 0] [1 7 1] [0 2 6]]What is the precision for class B?