Model Pipeline - ROC and AUC curves
This pipeline shows how a model learns to separate two classes and how ROC and AUC curves help us understand its performance by measuring true and false positive rates.
This pipeline shows how a model learns to separate two classes and how ROC and AUC curves help us understand its performance by measuring true and false positive rates.
Epochs 1 |*************** | Loss:0.65 2 |******************** | Loss:0.52 3 |*********************** | Loss:0.43 4 |************************| Loss:0.38 5 |************************| Loss:0.34
| Epoch | Loss ↓ | Accuracy ↑ | Observation |
|---|---|---|---|
| 1 | 0.65 | 0.60 | Model starts learning, loss high, accuracy low |
| 2 | 0.52 | 0.72 | Loss decreases, accuracy improves |
| 3 | 0.43 | 0.80 | Model learns better separation |
| 4 | 0.38 | 0.84 | Loss continues to decrease, accuracy rises |
| 5 | 0.34 | 0.87 | Training converges with good accuracy |
import tensorflow as tf labels = [0, 0, 1, 1] predictions = [0.1, 0.4, 0.35, 0.8] auc_metric = tf.keras.metrics.AUC() auc_metric.update_state(labels, predictions) print(round(auc_metric.result().numpy(), 2))
import tensorflow as tf labels = [0, 1, 0, 1] predictions = [0.2, 0.8, 0.4, 0.6] auc = tf.keras.metrics.AUC() auc.update_state(predictions, labels) print(auc.result().numpy())
Pass the test and this pattern moves unknown