Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit a1545e5

Browse filesBrowse files
jcaineyjeremiedbb
andcommitted
MAINT Fix typo in error message when attempting to cluster with more clusters than items (#29242)
Co-authored-by: Jérémie du Boisberranger <jeremie@probabl.ai>
1 parent 6def43b commit a1545e5
Copy full SHA for a1545e5

File tree

1 file changed

+1
-2
lines changed
Filter options

1 file changed

+1
-2
lines changed

‎sklearn/cluster/_agglomerative.py

Copy file name to clipboardExpand all lines: sklearn/cluster/_agglomerative.py
+1-2Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -755,8 +755,7 @@ def _hc_cut(n_clusters, children, n_leaves):
755755
if n_clusters > n_leaves:
756756
raise ValueError(
757757
"Cannot extract more clusters than samples: "
758-
"%s clusters where given for a tree with %s leaves."
759-
% (n_clusters, n_leaves)
758+
f"{n_clusters} clusters were given for a tree with {n_leaves} leaves."
760759
)
761760
# In this function, we store nodes as a heap to avoid recomputing
762761
# the max of the nodes: the first element is always the smallest

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.