Spec-Zone.ru › scikit-learn

NotFittedError

exceptionsklearn.exceptions.NotFittedError[исходный код]

Класс исключения, вызываемого при использовании оценщика до его обучения.

Этот класс наследуется одновременно от ValueError и AttributeError, чтобы упростить обработку исключений и обеспечить обратную совместимость.

Примеры

>>> 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."...)

Изменено в версии 0.18: Перенесено из sklearn.utils.validation.

© 2007–2026 The scikit-learn developers
Licensed under the 3-clause BSD License.
https://scikit-learn.org/1.9/modules/generated/sklearn.exceptions.NotFittedError.html

Spec-Zone.ru

Настройки Оффлайн Что нового Помощь О нас
Spec-Zone .ru
спецификации, руководства, описания, API