-
Notifications
You must be signed in to change notification settings - Fork 177
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Question] Why is true negative represented by 'n' in the classification matrix? #62
Comments
That's not the confusion matrix. N is the total number of that class in the test set. It doesn't show the true negatives because in multiclass settings it would give a misleading looking number. True negatives aren't found in a confusion matrix anyway, confusion matrices have the possible labels as both axes. True negatives aren't used by precision, recall, f1 or accuracy. |
Thanks for the explanation. In that case, it would be good to have a legend describing what each of the Classification metrics mean i.e. n = number of classes, tp = true positive, etc... I think the current layout (without a legend) would confuse some of the others as it has confused me. |
How is the accuracy calculations from Tribuo different than those explained here https://en.wikipedia.org/wiki/Precision_and_recall? |
On an unrelated discussion, |
Another question:
if N = number of observations per class, and |
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
|
So here's my suggestion since so many things will change with the library as you get feedback from us:
|
👍 This is good information, in fact, may other resources do NOT make such details clear. So I would suggest, in the For e.g. something like this would help:
and in case of binary:
Even though it may appear obvious because we are printing all the classes in the output. |
This printing thing you mention could give rise to |
Sure we can expand the classification tutorial with an evaluation metrics section. We had that in an earlier version and it got cut to try and compress the tutorial a little (because it's already too long for the first thing that we point people at), but it could easily go back in.
I'm not clear that pointing at the notebooks for all doc related needs is ideal, but we could link to Wikipedia or some other reference for a more detailed treatment of basic ML topics (either from the notebooks or from other pages in the docs). Our aim for the moment is that Tribuo's docs teach people about using Tribuo, and not necessarily teach them all of the ML knowledge that they could need to use Tribuo. The latter is a much larger documentation effort than the former, and we don't have anyone on our team to devote to such a task.
We could expand the acronyms, I'll see what would fit as I don't want the tables to get much wider. For the record
Well, the two formulations are equivalent (as in the binary case a true negative is just a true "positive" for the negative class, and in a binary task
Sure, that's definitely something we could consider. At the moment we have the formatted string output, and a html string output (which exists because we found it useful to paste into wiki pages). Refactoring the evaluations to take some kind of output printer class would be interesting, though it would require a bit of designing to make sufficiently flexible and useful. As I said earlier, we don't actually print all the metrics that are available on |
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. |
Feels related to #121 |
Describe the bug
In the confusion matrix:
The title/label for True negative is shown as
n
instead oftn
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).
The text was updated successfully, but these errors were encountered: