Model Pipeline - Classification reports
This pipeline trains a simple neural network to classify images into categories. After training, it evaluates the model using a classification report that shows precision, recall, and F1-score for each class.
This pipeline trains a simple neural network to classify images into categories. After training, it evaluates the model using a classification report that shows precision, recall, and F1-score for each class.
Loss
0.5 |****
0.4 |****
0.3 |***
0.2 |**
0.1 |*
+---------
1 2 3 4 5 Epochs| Epoch | Loss ↓ | Accuracy ↑ | Observation |
|---|---|---|---|
| 1 | 0.45 | 0.85 | Model starts learning, accuracy improves quickly |
| 2 | 0.30 | 0.91 | Loss decreases, accuracy continues to improve |
| 3 | 0.22 | 0.94 | Model converges with good accuracy |
| 4 | 0.18 | 0.95 | Loss decreases slightly, accuracy stabilizes |
| 5 | 0.15 | 0.96 | Final epoch shows best performance |
from sklearn.metrics import classification_report true_labels = [0, 1, 0, 1] pred_labels = [0, 0, 0, 1] print(classification_report(true_labels, pred_labels))
from sklearn.metrics import classification_report true = [1, 0, 1] pred = [1, 0] print(classification_report(true, pred))
precision recall f1-score support
cat 0.90 0.95 0.92 100
dog 0.70 0.60 0.65 100
rabbit 0.50 0.40 0.44 100
accuracy 0.68 300
macro avg 0.70 0.65 0.67 300
weighted avg 0.70 0.68 0.68 300
What should you focus on to improve your model?Pass the test and this pattern moves unknown