Closed gossminn closed 4 years ago
What is the output of your model for a single example (both confidence and prediction)? Is it an np.array
of floats?
print(list(zip(preds, confs))[0])
gives array([1]), array([0., 1., 0.])
So pred is an array of np.int64
, conf is an array of floats
It seems from your snippet that each of your predictions is an array, rather than an integer. I.e., you have something like [array([1]), array([0]), array([2]), ...]
. visual_summary_table
fails when trying to convert it to json.
It should be easy to change your prediction function such that preds is an np.array of integers, rather than a list of np.arrays.
Thanks for the pointer, this was indeed the case!
When trying to use the visual summary functionality on a TestSuite, I ran into an issue with loading examples: I get the error message
ValueError: Can't clean for JSON: array([1.])
. I get this both when usingsuite.visual_summary_table()
orsuite.visual_summary_by_test()
.However, when I try
suite.summary()
it works fine and I get something like this:where the three numbers before every sample are the probability scores (in the case of my model, these are always 1.0 or 0.0).
Is this expected behavior (am I doing something wrong?) or is it a bug?
See traceback from the visualization widget below -- note that the error is raised not when initially loading the widget but only once example fails are being loaded.