-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
/
exceptions.py
41 lines (28 loc) · 1.27 KB
/
exceptions.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
#!/usr/bin/env python3 -u
# copyright: sktime developers, BSD-3-Clause License (see LICENSE file)
"""Custom exceptions and warnings."""
__author__ = ["mloning"]
__all__ = ["NotEvaluatedError", "NotFittedError", "FitFailedWarning"]
class NotEvaluatedError(ValueError, AttributeError):
"""NotEvaluatedError.
Exception class to raise if evaluator is used before having evaluated any metric.
"""
class NotFittedError(ValueError, AttributeError):
"""Exception class to raise if estimator is used before fitting.
This class inherits from both ValueError and AttributeError to help with
exception handling and backward compatibility.
References
----------
.. [1] Based on scikit-learn's NotFittedError
"""
class FitFailedWarning(RuntimeWarning):
"""Warning class used if there is an error while fitting the estimator.
This Warning is used in meta estimators GridSearchCV and RandomizedSearchCV
and the cross-validation helper function cross_val_score to warn when there
is an error while fitting the estimator.
FitFailedWarning('Estimator fit failed. The score on this train-test
partition for these parameters will be set to 0.000000').
References
----------
.. [1] Based on scikit-learn's FitFailedWarning
"""