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 d95a841

Browse filesBrowse files
MAINT Parameters validation for sklearn.metrics.cluster.entropy (#26162)
1 parent b58f448 commit d95a841
Copy full SHA for d95a841

File tree

2 files changed

+6
-0
lines changed
Filter options

2 files changed

+6
-0
lines changed

‎sklearn/metrics/cluster/_supervised.py

Copy file name to clipboardExpand all lines: sklearn/metrics/cluster/_supervised.py
+5Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1203,6 +1203,11 @@ def fowlkes_mallows_score(labels_true, labels_pred, *, sparse=False):
12031203
return np.sqrt(tk / pk) * np.sqrt(tk / qk) if tk != 0.0 else 0.0
12041204

12051205

1206+
@validate_params(
1207+
{
1208+
"labels": ["array-like"],
1209+
}
1210+
)
12061211
def entropy(labels):
12071212
"""Calculate the entropy for a labeling.
12081213

‎sklearn/tests/test_public_functions.py

Copy file name to clipboardExpand all lines: sklearn/tests/test_public_functions.py
+1Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -176,6 +176,7 @@ def _check_function_param_validation(
176176
"sklearn.metrics.classification_report",
177177
"sklearn.metrics.cluster.adjusted_mutual_info_score",
178178
"sklearn.metrics.cluster.contingency_matrix",
179+
"sklearn.metrics.cluster.entropy",
179180
"sklearn.metrics.cluster.fowlkes_mallows_score",
180181
"sklearn.metrics.cluster.homogeneity_completeness_v_measure",
181182
"sklearn.metrics.cluster.normalized_mutual_info_score",

0 commit comments

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