I have written a sequential classifier script using Keras, Tensorflow. Its a binary image classifier that predicts the class, given the directory path of a sample image.
I want to implement a probability feature in my script, where including the class, the correctness probability of my classifier's prediction is given too. for eg:
img = image.load_img('dataset/test/sample/fff.jpeg', target_size = (img_width, img_height)) img = image.img_to_array(img) img = np.expand_dims(img, axis = 0) prediction = model.predict(img)
OUTPUT (something like)
Prediction: 80% seems like it being Class A
In other words, I want to display my classifiers accuracy for that particular image.
P.S I am sorry if the question seems a little abrupt. I have tried asking it elsewhere too but either It gets closed due to lack of information, Or its misunderstood as "Classifier training accuracy" by google as its hard for me to frame it.