TFlearn evaluate method results meaning

304 views Asked by At

I thought that TFlearn's evaluate method returns the accuracy of the model (0 to 1) but after training my model model.evaluate(test_x, test_y) returns a value > 1 (1.003626), so now I'm not sure I understand exactly what it returns.

Can anyone explain?

1

There are 1 answers

0
Baltimore On

The evaluate method returns a dict, so the call would be

model.evaluate(test_x, test_y)['accuracy']

but I'm guessing that's not the problem. If you are doing classification, the test labels have to be integers for this to work. Other than that, without seeing more of your code, it's hard to debug.

Comments from the source code for evaluate:

Args: x: Matrix of shape [n_samples, n_features...] or dictionary of many matrices containing the input samples for fitting the model. Can be iterator that returns arrays of features or dictionary of array of features. If set,input_fnmust beNone. y: Vector or matrix [n_samples] or [n_samples, n_outputs] containing the label values (class labels in classification, real numbers in regression) or dictionary of multiple vectors/matrices. Can be iterator that returns array of targets or dictionary of array of targets. If set, input_fn must beNone. Note: For classification, label values must be integers representing the class index (i.e. values from 0 to n_classes-1).