Deep learning for NeuroImaging in Python.
Note
This page is a reference documentation. It only explains the function signature, and not how to use it. Please refer to the gallery for the big picture.
- nidl.utils.validation.check_is_fitted(estimator, msg: str | None = None)[source]¶
Checks if the estimator is fitted by verifying the presence of fitted attributes (ending with a trailing underscore) and otherwise raises an Exception with the given message.
- Parameters:
estimator : estimator instance
Estimator instance for which the check is performed.
msg : str, default=None
The default error message is, “This %(name)s instance is not fitted yet. Call ‘fit’ with appropriate arguments before using this estimator.” For custom messages if “%(name)s” is present in the message string, it is substituted for the estimator name. Eg. : “Estimator, %(name)s, must be fitted before sparsifying”.
- Raises:
TypeError
If the estimator is a class or not an estimator instance.
Exception
If the fittted attribute is not found.
Follow us