5

I'm using Estimator in Python3 based on Premade Estimator from example

(https://www.tensorflow.org/get_started/premade_estimators).

I normally train the network and then evaluate. As the result of classifier.evaluate(...) I get python dictionary, e.g.:

eval_result = {'loss': 14.673522, 'average_loss': 0.1470208, 'accuracy': 0.9460823, 'global_step': 1000}

But how can I get the accuracy of each output class from classifier? I need accuracy array e.g. like: class = [0.924012,0.89478,0.945123,0.685042]

Dee_wab
  • 1,171
  • 1
  • 10
  • 23
Martin Special
  • 141
  • 1
  • 7
  • In a canned estimator, like [`DNNClassifier`](https://www.tensorflow.org/api_docs/python/tf/estimator/DNNClassifier), the metrics are fixed and cannot be changed within the estimator (e.g. see `_MultiClassHeadWithSoftmaxCrossEntropyLoss`, method `_eval_metric_ops` in [`tensorflow/python/estimator/canned/head.py`](https://github.com/tensorflow/tensorflow/blob/r1.8/tensorflow/python/estimator/canned/head.py)). You can either make your own [`Estimator`](https://www.tensorflow.org/api_docs/python/tf/estimator/Estimator) from scratch or simply compute it yourself from the result of `predict`. – jdehesa May 11 '18 at 10:16

0 Answers0