Skip to content

Commit fa51080

Browse files
authored
fix: error in calculation of precision recall f1
The `true positive`, `false positive` and `false negative` values are all equal to 1 which was not the case in the equation
1 parent 426ef51 commit fa51080

File tree

1 file changed

+3
-3
lines changed
  • articles/cognitive-services/language-service/custom-named-entity-recognition/concepts

1 file changed

+3
-3
lines changed

articles/cognitive-services/language-service/custom-named-entity-recognition/concepts/evaluation-metrics.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -68,9 +68,9 @@ The model would have the following entity-level evaluation, for the *city* entit
6868
| False Positive | 1 | *Forrest* was incorrectly predicted as *city* while it should have been *person*. |
6969
| False Negative | 1 | *Frederick* was incorrectly predicted as *person* while it should have been *city*. |
7070

71-
* **Precision** = `#True_Positive / (#True_Positive + #False_Positive)` = `2 / (2 + 1) = 0.67`
72-
* **Recall** = `#True_Positive / (#True_Positive + #False_Negatives)` = `2 / (2 + 1) = 0.67`
73-
* **F1 Score** = `2 * Precision * Recall / (Precision + Recall)` = `(2 * 0.67 * 0.67) / (0.67 + 0.67) = 0.67`
71+
* **Precision** = `#True_Positive / (#True_Positive + #False_Positive)` = `1 / (1 + 1) = 0.5`
72+
* **Recall** = `#True_Positive / (#True_Positive + #False_Negatives)` = `1 / (1 + 1) = 0.5`
73+
* **F1 Score** = `2 * Precision * Recall / (Precision + Recall)` = `(2 * 0.5 * 0.5) / (0.5 + 0.5) = 0.5`
7474

7575
### Model-level evaluation for the collective model
7676

0 commit comments

Comments
 (0)