Skip to content
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

New metrics: Homogeneity, Completness, V-Measure #2053

Merged
merged 26 commits into from
Sep 15, 2023
Merged
Show file tree
Hide file tree
Changes from 22 commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
ef77758
getting started
SkafteNicki Aug 30, 2023
2b36bed
getting started
SkafteNicki Aug 30, 2023
bf0d850
Merge branch 'master' into newmetric/homogeneity
SkafteNicki Sep 1, 2023
e381b8d
convert to same file
SkafteNicki Sep 1, 2023
c6ff4ae
Merge branch 'master' into newmetric/homogeneity
SkafteNicki Sep 4, 2023
81aad79
add tests
SkafteNicki Sep 4, 2023
77327bb
Merge branch 'master' into newmetric/homogeneity
SkafteNicki Sep 4, 2023
0781213
working
SkafteNicki Sep 4, 2023
71c106f
doc fixes
SkafteNicki Sep 4, 2023
b2fe87b
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Sep 4, 2023
a02d87f
add doc pages
SkafteNicki Sep 4, 2023
e12c234
Merge branch 'newmetric/homogeneity' of https://github.com/PyTorchLig…
SkafteNicki Sep 4, 2023
01c2bfc
Merge branch 'master' into newmetric/homogeneity
SkafteNicki Sep 6, 2023
bbafede
changelog
SkafteNicki Sep 6, 2023
cfc5b9f
fix import
SkafteNicki Sep 6, 2023
b857184
fix doctests
SkafteNicki Sep 6, 2023
6620a0c
Merge branch 'master' into newmetric/homogeneity
SkafteNicki Sep 7, 2023
51d4ac2
Merge branch 'master' into newmetric/homogeneity
SkafteNicki Sep 7, 2023
ab43dca
Merge branch 'master' into newmetric/homogeneity
SkafteNicki Sep 8, 2023
caf9600
replace lambda with partial
SkafteNicki Sep 8, 2023
9323850
Merge branch 'master' into newmetric/homogeneity
SkafteNicki Sep 11, 2023
b82fbf8
Merge branch 'master' into newmetric/homogeneity
SkafteNicki Sep 11, 2023
9ea66ac
Update CHANGELOG.md
SkafteNicki Sep 12, 2023
e37948d
Update src/torchmetrics/functional/clustering/homogeneity_completenes…
SkafteNicki Sep 12, 2023
80c7d7c
Merge branch 'master' into newmetric/homogeneity
SkafteNicki Sep 15, 2023
fecf5f2
Merge branch 'master' into newmetric/homogeneity
Borda Sep 15, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +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))

- `FowlkesMallowsIndex` ([#2066](https://github.com/Lightning-AI/torchmetrics/pull/2066))
- `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))

SkafteNicki marked this conversation as resolved.
Show resolved Hide resolved

### Changed

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 @@ -158,4 +158,7 @@
.. _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
.. _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 @@ -15,16 +15,24 @@
from torchmetrics.clustering.calinski_harabasz_score import CalinskiHarabaszScore
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

__all__ = [
"AdjustedRandScore",
"CalinskiHarabaszScore",
"CompletenessScore",
"DunnIndex",
"FowlkesMallowsIndex",
"HomogeneityScore",
"MutualInfoScore",
"NormalizedMutualInfoScore",
"RandScore",
"VMeasureScore",
]
Loading
Loading