Skip to content

Commit

Permalink
New metrics: Homogeneity, Completness, V-Measure (Lightning-AI#2053)
Browse files Browse the repository at this point in the history
Co-authored-by: Jirka Borovec <6035284+Borda@users.noreply.github.com>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
  • Loading branch information
3 people authored and matsumotosan committed Sep 17, 2023
1 parent c47bc69 commit 6c670ac
Show file tree
Hide file tree
Showing 10 changed files with 626 additions and 0 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

- `DunnIndex` ([#2049](https://github.com/Lightning-AI/torchmetrics/pull/2049))

- `HomogeneityScore` ([#2053](https://github.com/Lightning-AI/torchmetrics/pull/2053))

- `CompletenessScore` ([#2053](https://github.com/Lightning-AI/torchmetrics/pull/2053))

- `VMeasureScore` ([#2053](https://github.com/Lightning-AI/torchmetrics/pull/2053))

- `FowlkesMallowsIndex` ([#2066](https://github.com/Lightning-AI/torchmetrics/pull/2066))

- `AdjustedMutualInfoScore` ([#2058](https://github.com/Lightning-AI/torchmetrics/pull/2058))
Expand Down
21 changes: 21 additions & 0 deletions docs/source/clustering/completeness_score.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
.. customcarditem::
:header: Completeness Score
:image: https://pl-flash-data.s3.amazonaws.com/assets/thumbnails/default.svg
:tags: Clustering

.. include:: ../links.rst

##################
Completeness Score
##################

Module Interface
________________

.. autoclass:: torchmetrics.clustering.CompletenessScore
:exclude-members: update, compute

Functional Interface
____________________

.. autofunction:: torchmetrics.functional.clustering.completeness_score
21 changes: 21 additions & 0 deletions docs/source/clustering/homogeneity_score.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
.. customcarditem::
:header: Homogeneity Score
:image: https://pl-flash-data.s3.amazonaws.com/assets/thumbnails/default.svg
:tags: Clustering

.. include:: ../links.rst

#################
Homogeneity Score
#################

Module Interface
________________

.. autoclass:: torchmetrics.clustering.HomogeneityScore
:exclude-members: update, compute

Functional Interface
____________________

.. autofunction:: torchmetrics.functional.clustering.homogeneity_score
21 changes: 21 additions & 0 deletions docs/source/clustering/v_measure_score.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
.. customcarditem::
:header: V-Measure Score
:image: https://pl-flash-data.s3.amazonaws.com/assets/thumbnails/default.svg
:tags: Clustering

.. include:: ../links.rst

###############
V-Measure Score
###############

Module Interface
________________

.. autoclass:: torchmetrics.clustering.VMeasureScore
:exclude-members: update, compute

Functional Interface
____________________

.. autofunction:: torchmetrics.functional.clustering.v_measure_score
3 changes: 3 additions & 0 deletions docs/source/links.rst
Original file line number Diff line number Diff line change
Expand Up @@ -159,5 +159,8 @@
.. _fork of pycocotools: https://github.com/ppwwyyxx/cocoapi
.. _Adjusted Rand Score: https://en.wikipedia.org/wiki/Rand_index#Adjusted_Rand_index
.. _Dunn Index: https://en.wikipedia.org/wiki/Dunn_index
.. _V-Measure Score: https://www.aclweb.org/anthology/D07-1043.pdf
.. _Homogeneity Score: https://scikit-learn.org/stable/modules/generated/sklearn.metrics.homogeneity_score.html
.. _Completeness Score: https://scikit-learn.org/stable/modules/generated/sklearn.metrics.completeness_score.html
.. _Davies-Bouldin Score: https://en.wikipedia.org/wiki/Davies%E2%80%93Bouldin_index
.. _Fowlkes-Mallows Index: https://scikit-learn.org/stable/modules/generated/sklearn.metrics.fowlkes_mallows_score.html#sklearn.metrics.fowlkes_mallows_score
8 changes: 8 additions & 0 deletions src/torchmetrics/clustering/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,11 @@
from torchmetrics.clustering.davies_bouldin_score import DaviesBouldinScore
from torchmetrics.clustering.dunn_index import DunnIndex
from torchmetrics.clustering.fowlkes_mallows_index import FowlkesMallowsIndex
from torchmetrics.clustering.homogeneity_completeness_v_measure import (
CompletenessScore,
HomogeneityScore,
VMeasureScore,
)
from torchmetrics.clustering.mutual_info_score import MutualInfoScore
from torchmetrics.clustering.normalized_mutual_info_score import NormalizedMutualInfoScore
from torchmetrics.clustering.rand_score import RandScore
Expand All @@ -25,10 +30,13 @@
"AdjustedMutualInfoScore",
"AdjustedRandScore",
"CalinskiHarabaszScore",
"CompletenessScore",
"DaviesBouldinScore",
"DunnIndex",
"FowlkesMallowsIndex",
"HomogeneityScore",
"MutualInfoScore",
"NormalizedMutualInfoScore",
"RandScore",
"VMeasureScore",
]
Loading

0 comments on commit 6c670ac

Please sign in to comment.