Compute the MulticlassEER metric — provided by torchmetrics. Use when the user has predictions and ground-truth and needs to compute MulticlassEER, or asks how to score with MulticlassEER.
Scanned 9/11/2026
Install to Claude Code
npx -y skills add qhjqhj00/research-skills-pool --skill multiclasseer --agent claude-codeInstalls into .claude/skills of the current project.
Are you the author of Multiclasseer?
Add the live security badge to your README — it updates automatically with every re-scan.
[](https://www.skillsdirectory.com/skills/qhjqhj00-multiclasseer)More formats (shields.io, HTML) on the badges page.
---
name: multiclasseer
description: Compute the MulticlassEER metric — provided by torchmetrics. Use when the user has predictions and ground-truth and needs to compute MulticlassEER, or asks how to score with MulticlassEER.
metadata:
skill_kind: metric
source_lib: torchmetrics
import_path: torchmetrics.classification.MulticlassEER
source: library_introspection
---
# multiclasseer
> Metric `MulticlassEER` from `torchmetrics` (torchmetrics.classification.MulticlassEER)
## When to invoke this skill
The user has predictions + ground truth and asks to evaluate with MulticlassEER, or
mentions `torchmetrics.classification.MulticlassEER` directly, or wants the standard torchmetrics implementation.
## Reference signature
```python
from torchmetrics.classification import MulticlassEER
# MulticlassEER(num_classes: int, thresholds: Union[int, list[float], torch.Tensor, NoneType] = None, average: Optional[Literal['micro', 'macro']] = None, ignore_index: Optional[int] = None, validate_args: bool = True, **kwargs: Any) -> None
```
## Library docstring
```
Compute Equal Error Rate (EER) for multiclass classification task.
.. math::
\text{EER} = \frac{\text{FAR} + (1 - \text{FRR})}{2}, \text{where} \min_t abs(FAR_t-FRR_t)
The Equal Error Rate (EER) is the point where the False Positive Rate (FPR) and True Positive Rate (TPR) are
equal, or in practise minimized. A lower EER value signifies higher system accuracy.
As input to ``forward`` and ``update`` the metric accepts the following input:
- ``preds`` (:class:`~torch.Tensor`): A float tensor of shape ``(N, C, ...)`` containing probabilities or logits
for each observation. If preds has values outside [0,1] range we consider the input to be logits and will auto
apply softmax per sample.
- ``target`` (:class:`~torch.Tensor`): An int tensor of shape ``(N, ...)`` containing ground truth labels, and
therefore only contain values in the [0, n_classes-1] range (except if `ignore_index` is specified).
As output to ``forward`` and ``compute`` the metric returns the following output:
- ``mc_eer`` (:class:`~torch.Tensor`): If `average=None` then a 1d tensor of shape (n_classes, ) will
be returned with eer score per class. If `average="macro"|"micro"` then a single scalar will be returned.
Additional dimension ``...`` will be flattened into the batch dimension.
The implementation both supports calculating the metric in a non-binned but accurate version and a
binned version that is less accurate but more memory efficient. Setting the `thresholds` argument to `None` will
activate the non-binned version that uses memory of size :math:`\mathcal{O}(n_{samples})` whereas setting the
`thresholds` argument to either an integer, list or a 1d tensor will use a binned version that uses memory of
size :math:`\mathcal{O}(n_{thresholds} \times n_{classes})` (constant memory).
Args:
num_classes: Integer specifying the number of classes
thresholds: Can be one of:
- If set to `None`, will use a non-binned approach where thresholds are dynamically calculated from
all the data. Most accurate but also most memory consuming approach.
- If set to an `int` (larger than 1), will use that number of thresholds linearly s
```
## Quick recipe
```python
import torchmetrics.classification as _m
score = _m.MulticlassEER(y_true, y_pred)
```
## Don'ts
- Don't reimplement when the library version handles edge cases (NaN, ties, empty inputs) better than a hand-rolled formula.
- Always check the library version's argument order — sklearn is `(y_true, y_pred)` while torchmetrics is `(preds, target)`.
Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.
No comments yet. Be the first to comment!