10000 Correct Typo with Gael comment · scikit-learn/scikit-learn@9b08b13 · GitHub
[go: up one dir, main page]

Skip to content

Commit 9b08b13

Browse files
committed
Correct Typo with Gael comment
1 parent e916008 commit 9b08b13

File tree

2 files changed

+21
-20
lines changed

2 files changed

+21
-20
lines changed

sklearn/metrics/cluster/supervised.py

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,8 @@ def contingency_matrix(labels_true, labels_pred, eps=None, max_n_classes=5000):
6060
matrix. This helps to stop NaN propagation.
6161
If ``None``, nothing is adjusted.
6262
63-
max_n_classes: int
64-
Maximal number of classes handled for contingency_matrix.
63+
max_n_classes : int, optional (default=5000)
64+
Maximal number of classeses handled for contingency_matrix.
6565
This help to avoid Memory error with regression target
6666
for mutual_information.
6767
@@ -132,8 +132,8 @@ def adjusted_rand_score(labels_true, labels_pred, max_n_classes=5000):
132132
labels_pred : array, shape = [n_samples]
133133
Cluster labels to evaluate
134134
135-
max_n_classes : int
136-
Maximal number of class handled by the adjusted_rand_score
135+
max_n_classes: int, optional (default=5000)
136+
Maximal number of classes handled by the adjusted_rand_score
137137
metric. Setting it too high can lead to MemoryError or OS
138138
freeze
139139
@@ -246,8 +246,8 @@ def homogeneity_completeness_v_measure(labels_true, labels_pred,
246246
labels_pred : array, shape = [n_samples]
247247
cluster labels to evaluate
248248
249-
max_n_classes : int
250-
Maximal number of class handled by the adjusted_rand_score
249+
max_n_classes: int, optional (default=5000)
250+
Maximal number of classes handled by the adjusted_rand_score
251251
metric. Setting it too high can lead to MemoryError or OS
252252
freeze
253253
@@ -315,8 +315,8 @@ def homogeneity_score(labels_true, labels_pred, max_n_classes=5000):
315315
labels_pred : array, shape = [n_samples]
316316
cluster labels to evaluate
317317
318-
max_n_classes : int
319-
Maximal number of class handled by the adjusted_rand_score
318+
max_n_classes: int, optional (default=5000)
319+
Maximal number of classes handled by the adjusted_rand_score
320320
metric. Setting it too high can lead to MemoryError or OS
321321
freeze
322322
@@ -395,8 +395,8 @@ def completeness_score(labels_true, labels_pred, max_n_classes=5000):
395395
labels_pred : array, shape = [n_samples]
396396
cluster labels to evaluate
397397
398-
max_n_classes : int
399-
Maximal number of class handled by the adjusted_rand_score
398+
max_n_classes: int, optional (default=5000)
399+
Maximal number of classes handled by the adjusted_rand_score
400400
metric. Setting it too high can lead to MemoryError or OS
401401
freeze
402402
@@ -475,8 +475,8 @@ def v_measure_score(labels_true, labels_pred, max_n_classes=5000):
475475
labels_pred : array, shape = [n_samples]
476476
cluster labels to evaluate
477477
478-
max_n_classes : int
479-
Maximal number of class handled by the adjusted_rand_score
478+
max_n_classes: int, optional (default=5000)
479+
Maximal number of classes handled by the adjusted_rand_score
480480
metric. Setting it too high can lead to MemoryError or OS
481481
freeze
482482
@@ -589,8 +589,8 @@ def mutual_info_score(labels_true, labels_pred, contingency=None,
589589
If value is ``None``, it will be computed, otherwise the given value is
590590
used, with ``labels_true`` and ``labels_pred`` ignored.
591591
592-
max_n_classes : int
593-
Maximal number of class handled by the mutual_info_score
592+
max_n_classes: int, optional (default=5000)
593+
Maximal number of classes handled by the mutual_info_score
594594
metric. Setting it too high can lead to MemoryError or OS
595595
freeze
596596
@@ -659,8 +659,8 @@ def adjusted_mutual_info_score(labels_true, labels_pred, max_n_classes=5000):
659659
labels_pred : array, shape = [n_samples]
660660
A clustering of the data into disjoint subsets.
661661
662-
max_n_classes : int
663-
Maximal number of class handled by the adjusted_rand_score
662+
max_n_classes: int, optional (default=5000)
663+
Maximal number of classes handled by the adjusted_rand_score
664664
metric. Setting it too high can lead to MemoryError or OS
665665
freeze
666666
@@ -758,8 +758,8 @@ def normalized_mutual_info_score(labels_true, labels_pred, max_n_classes=5000):
758758
labels_pred : array, shape = [n_samples]
759759
A clustering of the data into disjoint subsets.
760760
761-
max_n_classes : int
762-
Maximal number of class handled by the adjusted_rand_score
761+
max_n_classes: int, optional (default=5000)
762+
Maximal number of classes handled by the adjusted_rand_score
763763
metric. Setting it too high can lead to MemoryError or OS
764764
freeze
765765

sklearn/metrics/cluster/tests/test_supervised.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -203,8 +203,9 @@ def test_v_measure_and_mutual_information(seed=36):
203203

204204

205205
def test_max_n_classes():
206-
labels_true = np.random.random(53)
207-
labels_pred = np.random.random(53)
206+
rng = np.random.RandomState(seed=0)
207+
labels_true = rng.random(53)
208+
labels_pred = rng.random(53)
208209
labels_zero = np.zeros(53)
209210
labels_true[:2] = 0
210211
labels_zero[:3] = 1

0 commit comments

Comments
 (0)
0