sklearn.utils.validation.has_fit_parameter
-
sklearn.utils.validation.has_fit_parameter(estimator, parameter)
[source] -
Checks whether the estimator’s fit method supports the given parameter.
- Parameters
-
-
estimatorobject
-
An estimator to inspect.
-
parameterstr
-
The searched parameter.
-
- Returns
-
- is_parameter: bool
-
Whether the parameter was found to be a named parameter of the estimator’s fit method.
Examples
>>> from sklearn.svm import SVC >>> has_fit_parameter(SVC(), "sample_weight") True
© 2007–2020 The scikit-learn developers
Licensed under the 3-clause BSD License.
https://scikit-learn.org/0.24/modules/generated/sklearn.utils.validation.has_fit_parameter.html