Skip to content

Commit 297349d

Browse files
authored
NotInitializedError inherits from NotFittedError (#860)
This ensures that a user can catch the sklearn `NotFittedError`, just as they can with regular sklearn estimators. As discussed in [1]. [1] #859
1 parent 090ece0 commit 297349d

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

skorch/exceptions.py

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
11
"""Contains skorch-specific exceptions and warnings."""
22

3+
from sklearn.exceptions import NotFittedError
4+
35

46
class SkorchException(BaseException):
57
"""Base skorch exception."""
68

79

8-
class NotInitializedError(SkorchException):
10+
class NotInitializedError(SkorchException, NotFittedError):
911
"""Module is not initialized, please call the ``.initialize``
1012
method or train the model by calling ``.fit(...)``.
1113

0 commit comments

Comments
 (0)