[Question] Why is true negative represented by 'n' in the classification matrix?
See original GitHub issueDescribe the bug
In the confusion matrix:
Class n tp fn fp recall prec f1
Iris-versicolor 16 15 1 0 0.938 1.000 0.968
Iris-virginica 15 15 0 1 1.000 0.938 0.968
Iris-setosa 14 14 0 0 1.000 1.000 1.000
Total 45 44 1 1
The title/label for True negative is shown as n
instead of tn
Expected behaviour
Most documentations, on confusion matrix I have seen so far, represent it as tn
.
It might lead to doubts by those who may be aware of the standard representations. Especially the dependent metrics like recall, precision, f1, accuracy etc… are made up these base metrics (and True negative is one of them).
Issue Analytics
- State:
- Created 3 years ago
- Reactions:1
- Comments:12 (12 by maintainers)
Top Results From Across the Web
Classification: True vs. False and Positive vs. Negative
True Negative (TN): A true positive is an outcome where the model correctly predicts the positive class. Similarly, a true negative is an ......
Read more >Simple guide to confusion matrix terminology - Data School
true negatives (TN): We predicted no, and they don't have the disease. false positives (FP): We predicted yes, but they don't actually have...
Read more >Understanding Confusion Matrix | by Sarang Narkhede
True Negative: Interpretation: You predicted negative and it's true. You predicted that a man is not pregnant and he actually is not. False ......
Read more >Confusion matrix - Wikipedia
Two, if the actual classification is positive and the predicted classification is negative (1,0), this is called a false negative result because the...
Read more >Confusion Matrix for Machine Learning - Analytics Vidhya
A Confusion matrix is an N x N matrix used for evaluating the ... two values: Positive or Negative; The columns represent the...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
This is the output of the toFormattedString method. We could add another method that emits a legend String, or modify the toFormattedString output. I’d prefer the former (or some kind of documentation change) as pretty soon the legend would be irrelevant noise to anyone using Tribuo for any length of time. What kind of other information would you want in it?
That’s the binary classification accuracy. Tribuo treats every classification problem as if it’s multiclass, and in multiclass problems accuracy is the sum of the true positives divided by the total number of test examples. We decided early on to not allow any special casing for binary problems, as it made it difficult for things like moving from two class sentiment (positive/negative) to three class sentiment (positive/negative/neutral) as all the code paths would change.
The methods & lambdas Tribuo uses to calculate the various metrics are here and here.
We provide the false negatives row wise as it’s hard to break down where the misclassifications are without it. However in that case it’s probably best to print the confusion matrix and look at it directly.
This particular formatted string is the output we use as it’s what our data science team wanted to show in their reports, and it’s easy to pull out the relevant information without it taking up too much space. All the metrics we’ve discussed are calculated and can be accessed on the
Evaluation
object, including the true negatives, so others are welcome to generate their own reporting output. If there are metrics we aren’t calculating we’re happy to take PRs to add them to theLabelEvaluation
, but I think it’s a slightly higher bar to get them into thetoFormattedString
output as every additional metric increases the clutter.N = tp + fn
. It’s the total number of elements of that class, so it’s the true positives (i.e. the things we correctly predicted as that class) plus the false negatives (i.e. the things we incorrectly predicted as members of another class) which is the denominator of the recall).In the 4.1 release we updated the classification tutorial to discuss the formatted output and generally improved the docs. I’m going to close this issue and make a separate one to track the addition of formatter/printer classes for evaluations.