Skip to content

Commit d40943a

Browse files
authored
DOC Ensures that function passes numpydoc validation: has_fit_parameter (#21590)
1 parent 2368132 commit d40943a

File tree

2 files changed

+2
-4
lines changed

2 files changed

+2
-4
lines changed

maint_tools/test_docstrings.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,6 @@
218218
"sklearn.utils.validation.check_memory",
219219
"sklearn.utils.validation.check_random_state",
220220
"sklearn.utils.validation.column_or_1d",
221-
"sklearn.utils.validation.has_fit_parameter",
222221
]
223222
FUNCTION_DOCSTRING_IGNORE_LIST = set(FUNCTION_DOCSTRING_IGNORE_LIST)
224223

sklearn/utils/validation.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1159,7 +1159,7 @@ def check_random_state(seed):
11591159

11601160

11611161
def has_fit_parameter(estimator, parameter):
1162-
"""Checks whether the estimator's fit method supports the given parameter.
1162+
"""Check whether the estimator's fit method supports the given parameter.
11631163
11641164
Parameters
11651165
----------
@@ -1171,7 +1171,7 @@ def has_fit_parameter(estimator, parameter):
11711171
11721172
Returns
11731173
-------
1174-
is_parameter: bool
1174+
is_parameter : bool
11751175
Whether the parameter was found to be a named parameter of the
11761176
estimator's fit method.
11771177
@@ -1181,7 +1181,6 @@ def has_fit_parameter(estimator, parameter):
11811181
>>> from sklearn.utils.validation import has_fit_parameter
11821182
>>> has_fit_parameter(SVC(), "sample_weight")
11831183
True
1184-
11851184
"""
11861185
return parameter in signature(estimator.fit).parameters
11871186

0 commit comments

Comments
 (0)