contrib.learn.NotFittedError

tf.contrib.learn.NotFittedError

class tf.contrib.learn.NotFittedError

Defined in tensorflow/contrib/learn/python/learn/estimators/_sklearn.py.

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 NotFittedError try: ... LinearSVC().predict([[1, 2], [2, 3], [3, 4]]) ... except NotFittedError as e: ... print(repr(e)) ... # doctest: +NORMALIZE_WHITESPACE +ELLIPSIS NotFittedError('This LinearSVC instance is not fitted yet',)

Copied from https://github.com/scikit-learn/scikit-learn/master/sklearn/exceptions.py

© 2017 The TensorFlow Authors. All rights reserved.
Licensed under the Creative Commons Attribution License 3.0.
Code samples licensed under the Apache 2.0 License.
https://www.tensorflow.org/api_docs/python/tf/contrib/learn/NotFittedError

在线笔记
App下载
App下载

扫描二维码

下载编程狮App

公众号
微信公众号

编程狮公众号

意见反馈
返回顶部