MCPcopy
hub / github.com/scikit-learn/scikit-learn / NotFittedError

Class NotFittedError

sklearn/exceptions.py:46–65  ·  view source on GitHub ↗

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. Examples -------- >>> from sklearn.svm import LinearSVC >>> from sklearn.exceptions import N

Source from the content-addressed store, hash-verified

44
45
46class NotFittedError(ValueError, AttributeError):
47 """Exception class to raise if estimator is used before fitting.
48
49 This class inherits from both ValueError and AttributeError to help with
50 exception handling and backward compatibility.
51
52 Examples
53 --------
54 >>> from sklearn.svm import LinearSVC
55 >>> from sklearn.exceptions import NotFittedError
56 >>> try:
57 ... LinearSVC().predict([[1, 2], [2, 3], [3, 4]])
58 ... except NotFittedError as e:
59 ... print(repr(e))
60 NotFittedError("This LinearSVC instance is not fitted yet. Call 'fit' with
61 appropriate arguments before using this estimator."...)
62
63 .. versionchanged:: 0.18
64 Moved from sklearn.utils.validation.
65 """
66
67
68class ConvergenceWarning(UserWarning):

Callers 10

_fitMethod · 0.90
check_is_fittedFunction · 0.90
_get_support_maskMethod · 0.90
fitMethod · 0.90
partial_fitMethod · 0.90
inverse_transformMethod · 0.90
_check_vocabularyMethod · 0.90
idf_Method · 0.90
predict_probaMethod · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…