NotFittedError#
- Ausnahme sklearn.exceptions.NotFittedError[Quelle]#
Ausnahmeklasse, die ausgelöst wird, wenn ein Schätzer vor der Anpassung verwendet wird.
Diese Klasse erbt sowohl von ValueError als auch von AttributeError, um die Ausnahmsbehandlung und die Abwärtskompatibilität zu unterstützen.
Beispiele
>>> from sklearn.svm import LinearSVC >>> from sklearn.exceptions import NotFittedError >>> try: ... LinearSVC().predict([[1, 2], [2, 3], [3, 4]]) ... except NotFittedError as e: ... print(repr(e)) NotFittedError("This LinearSVC instance is not fitted yet. Call 'fit' with appropriate arguments before using this estimator."...)
Geändert in Version 0.18: Verschoben von sklearn.utils.validation.