Comments (5)
Hi! thanks for your contribution!, great first issue!
from torchmetrics.
So I guess the more usefull expected behavior would be the Multi-Label Confusion Matrix output like sklearn.metrics.multilabel_confusion_matrix
where the output is (n_outputs, 2, 2)
. It appears like torchmetrics
is kind of doing this but extending the 2x2 matrix to the size of num_classes
where the multi-label confusion matrix occupies the first two rows and columns. pytorchmetrics
is also then summing along the first axis and only returning the overall matrix instead of class-wise.
from torchmetrics.
I'm in the same case as you.
The docstring of confusion_matrix
says that it works for multi-label targets.
It calculates the confusion matrix in a binary way. Using num_classes > 2
or num_classes=2
gives the same result except for the additional rows and colums (all zeros) for the additional classes.
I don't expect the same output as you. In my opinion the output should be a list/Tensor of binary confusion matrices of length num_classes like in this sklearn example
Personally I iterate over the the predictions and targets as _auroc_compute
does:
[confusion_matrix(class_preds[:, idx], y_true[:, idx], num_classes=2)
for idx in range(class_preds.shape[-1])]
from torchmetrics.
Thanks for the response! Yeah I look in to sklearn and understand what I should be getting now. I am doing what you suggested to get the response now. confusion_matrix
should match sklearn
's if it was performing correctly right?
from torchmetrics.
IMO yes if the philosophy is to create a pytorch optimised sklearn.
from torchmetrics.
Related Issues (20)
- SSIM has values larger than 1 HOT 8
- `BinaryPrecisionRecallCurve` computes wrong value if used with logits, even though the docstring says this is supported HOT 1
- Broken source links in documentation of `1.3.0.post0` HOT 2
- RuntimeError: indices should be either on cpu or on the same device as the indexed tensor (cpu) HOT 2
- High memory usage of Perplexity metric HOT 2
- `MultitaskWrapper` still cannot be logged HOT 1
- usage consistency on GPU between `MetricCollection` and `FeatureShare` HOT 1
- MeanAveragePrecision doesn't work as expected when using `max_detection_thresholds != [1, 10, 100]` HOT 3
- Custom callable is ignored in retrieval metric aggregation HOT 1
- Explicitly initializing tensors in `float32` in MeanMetric goes against `torch.set_default_dtype`, leading to numerical errors HOT 6
- Add an option to switch distributions order in the KLDivergence. HOT 2
- MetricWrapper for Target Binarization HOT 3
- Total sum of squares formula HOT 3
- Add Support for SQ and RQ in Panoptic Quality HOT 5
- MPS uninitialized memory(?) causing errors in `StatScores` (which cascade to other locations) HOT 1
- Importing torchmetrics causes segmentation fault with other dependencies HOT 2
- `MetricCollection` did not copy inner state of metric in `ClasswiseWrapper` when computing groups metrics HOT 1
- Wrong aggregation of Precision\Recall\F1-Score HOT 2
- Typing error for detection metrics in MultitaskWrapper HOT 2
- Can't access metrics in a MetricCollection via keys returned in MetricCollection.keys
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from torchmetrics.