'How to get precision and recall for multiclass image classification
Solution 1:[1]
Usually it can be done like this:
model.compile(... , metrics=[tf.keras.metrics.Recall(), tf.keras.metrics.Precision()])
UPD Also you can try use this package https://pypi.org/project/keras-metrics/
import keras_metrics
model.compile(optimizer='adam',
loss=tf.keras.losses.SparseCategoricalCrossentropy(from_logits=False),
metrics=['accuracy', keras_metrics.precision(), keras_metrics.recall() ])
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 |
