Skip to content

Commit

Permalink
add install note
Browse files Browse the repository at this point in the history
  • Loading branch information
SkafteNicki committed Oct 12, 2024
1 parent dcdd1dd commit 9090b36
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/torchmetrics/clustering/cluster_accuracy.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,11 @@ class ClusterAccuracy(Metric):
- ``acc_score`` (:class:`~torch.Tensor`): A tensor with the Cluster Accuracy score
.. note:: This metric requires you to have `torch_linear_assignment` package installed for solving the
linear sum assignment problem. You can install it directly from source with the following command:
``pip install git+https://github.com/ivan-chai/torch-linear-assignment`` or install it with
``pip install torchmetrics[clustering]``.
Args:
num_classes: number of classes
kwargs: Additional keyword arguments, see :ref:`Metric kwargs` for more info.
Expand Down
5 changes: 5 additions & 0 deletions src/torchmetrics/functional/clustering/cluster_accuracy.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,11 @@ def _cluster_accuracy_compute(confmat: Tensor) -> Tensor:
def cluster_accuracy(preds: Tensor, target: Tensor, num_classes: int) -> Tensor:
"""Computes the clustering accuracy between the predicted and target clusters.
.. note:: This metric requires you to have `torch_linear_assignment` package installed for solving the
linear sum assignment problem. You can install it directly from source with the following command:
``pip install git+https://github.com/ivan-chai/torch-linear-assignment`` or install it with
``pip install torchmetrics[clustering]``.
Args:
preds: predicted cluster labels
target: ground truth cluster labels
Expand Down

0 comments on commit 9090b36

Please sign in to comment.