8000 DOC Ensures that `pair_confusion_matrix` passes numpydoc validation (… · scikit-learn/scikit-learn@076442c · GitHub
[go: up one dir, main page]

Skip to content

Commit 076442c

Browse files
DOC Ensures that pair_confusion_matrix passes numpydoc validation (#24094)
Co-authored-by: Guillaume Lemaitre <g.lemaitre58@gmail.com>
1 parent 98a826b commit 076442c

File tree

2 files changed

+10
-11
lines changed

2 files changed

+10
-11
lines changed

sklearn/metrics/cluster/_supervised.py

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ def contingency_matrix(
159159

160160

161161
def pair_confusion_matrix(labels_true, labels_pred):
162-
"""Pair confusion matrix arising from two clusterings.
162+
"""Pair confusion matrix arising from two clusterings [1]_.
163163
164164
The pair confusion matrix :math:`C` computes a 2 by 2 similarity matrix
165165
between two clusterings by considering all pairs of samples and counting
@@ -188,9 +188,15 @@ def pair_confusion_matrix(labels_true, labels_pred):
188188
189189
See Also
190190
--------
191-
rand_score: Rand Score
192-
adjusted_rand_score: Adjusted Rand Score
193-
adjusted_mutual_info_score: Adjusted Mutual Information
191+
rand_score: Rand Score.
192+
adjusted_rand_score: Adjusted Rand Score.
193+
adjusted_mutual_info_score: Adjusted Mutual Information.
194+
195+
References
196+
----------
197+
.. [1] :doi:`Hubert, L., Arabie, P. "Comparing partitions."
198+
Journal of Classification 2, 193–218 (1985).
199+
<10.1007/BF01908075>`
194200
195201
Examples
196202
--------
@@ -211,12 +217,6 @@ def pair_confusion_matrix(labels_true, labels_pred):
211217
[0, 2]]...
212218
213219
Note that the matrix is not symmetric.
214-
215-
References
216-
----------
217-
.. L. Hubert and P. Arabie, Comparing Partitions, Journal of
218-
Classification 1985
219-
https://link.springer.com/article/10.1007%2FBF01908075
220220
"""
221221
labels_true, labels_pred = check_clusterings(labels_true, labels_pred)
222222
n_samples = np.int64(labels_true.shape[0])

sklearn/tests/test_docstrings.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,6 @@
3939
"sklearn.metrics.cluster._supervised.adjusted_rand_score",
4040
"sklearn.metrics.cluster._supervised.entropy",
4141
"sklearn.metrics.cluster._supervised.fowlkes_mallows_score",
42-
"sklearn.metrics.cluster._supervised.pair_confusion_matrix",
4342
"sklearn.metrics.cluster._supervised.rand_score",
4443
"sklearn.metrics.cluster._supervised.v_measure_score",
4544
"sklearn.metrics.pairwise.pairwise_distances_chunked",

0 commit comments

Comments
 (0)
0