Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
4 changes: 2 additions & 2 deletions sklearn/exceptions.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,8 @@ class ConvergenceWarning(UserWarning):
... [1, 0],
... [1, 0]]) # last point is duplicated
>>> with warnings.catch_warnings(record=True) as w:
... km = KMeans(n_clusters=4).fit(X)
... print(w[-1].message)
... km = KMeans(n_clusters=4).fit(X)
... print(w[-1].message)
Number of distinct clusters (3) found smaller than n_clusters (4).
Possibly due to duplicate points in X.

Expand Down
4 changes: 2 additions & 2 deletions sklearn/utils/_testing.py
Original file line number Diff line number Diff line change
Expand Up @@ -276,8 +276,8 @@ def ignore_warnings(obj=None, category=Warning):
... warnings.warn('buhuhuhu')

>>> def nasty_warn():
... warnings.warn('buhuhuhu')
... print(42)
... warnings.warn('buhuhuhu')
... print(42)

>>> ignore_warnings(nasty_warn)()
42
Expand Down