alexa

I want to get the specific prediction of my Deep-Learning- CNN-model to a probability in python ?

I want to get the specific prediction of my Deep-Learning- CNN-model to a probability in python ?

First of all there are 8 categories. Secondly the output of the prediction has shape (1,8) which is technically a list of a single list(a row of column data) so by passing in model.predict(img_data) you are going to get back the row. What you need to do is max(model.predict(img_data)[0]) to get the highest value.

To get the class name, that has to do with the method of encoding used on your labels.

Also, if you want, as you stated, your probabilities of each class to be in this form, 90% class1 and 80% class2 ...etc, you should use sigmoid instead of softmax as your activation function in the output layer.


242 0
7

Write a Comments


* Be the first to Make Comment

GoodFirms Badge
GoodFirms Badge

Fix Your Meeting With Our SEO Consultants in India To Grow Your Business Online

Facebook
Twitter
LinkedIn
Instagram
Whatsapp
Call Now
Quick Inquiry