@@ -335,17 +335,35 @@ def adjusted_rand_score(labels_true, labels_pred):
335
335
Parameters
336
336
----------
337
337
labels_true : int array, shape = [n_samples]
338
- Ground truth class labels to be used as a reference
338
+ Ground truth class labels to be used as a reference.
339
339
340
340
labels_pred : array-like of shape (n_samples,)
341
- Cluster labels to evaluate
341
+ Cluster labels to evaluate.
342
342
343
343
Returns
344
344
-------
345
345
ARI : float
346
346
Similarity score between -0.5 and 1.0. Random labelings have an ARI
347
347
close to 0.0. 1.0 stands for perfect match.
348
348
349
+ See Also
350
+ --------
351
+ adjusted_mutual_info_score : Adjusted Mutual Information.
352
+
353
+ References
354
+ ----------
355
+ .. [Hubert1985] L. Hubert and P. Arabie, Comparing Partitions,
356
+ Journal of Classification 1985
357
+ https://link.springer.com/article/10.1007%2FBF01908075
358
+
359
+ .. [Steinley2004] D. Steinley, Properties of the Hubert-Arabie
360
+ adjusted Rand index, Psychological Methods 2004
361
+
362
+ .. [wk] https://en.wikipedia.org/wiki/Rand_index#Adjusted_Rand_index
363
+
364
+ .. [Chacon] :doi:`Minimum adjusted Rand index for two clusterings of a given size,
365
+ 2022, J. E. Chacón and A. I. Rastrojo <10.1007/s11634-022-00491-w>`
366
+
349
367
Examples
350
368
--------
351
369
Perfectly matching labelings have a score of 1 even
@@ -379,25 +397,6 @@ def adjusted_rand_score(labels_true, labels_pred):
379
397
380
398
>>> adjusted_rand_score([0, 0, 1, 1], [0, 1, 0, 1])
381
399
-0.5
382
-
383
- References
384
- ----------
385
- .. [Hubert1985] L. Hubert and P. Arabie, Comparing Partitions,
386
- Journal of Classification 1985
387
- https://link.springer.com/article/10.1007%2FBF01908075
388
-
389
- .. [Steinley2004] D. Steinley, Properties of the Hubert-Arabie
390
- adjusted Rand index, Psychological Methods 2004
391
-
392
- .. [wk] https://en.wikipedia.org/wiki/Rand_index#Adjusted_Rand_index
393
-
394
- .. [Chacon] :doi:`Minimum adjusted Rand index for two clusterings of a given size,
395
- 2022, J. E. Chacón and A. I. Rastrojo <10.1007/s11634-022-00491-w>`
396
-
397
-
398
- See Also
399
- --------
400
- adjusted_mutual_info_score : Adjusted Mutual Information.
401
400
"""
402
401
(tn , fp ), (fn , tp ) = pair_confusion_matrix (labels_true , labels_pred )
403
402
# convert to Python integer types, to avoid overflow or underflow
0 commit comments