-
Notifications
You must be signed in to change notification settings - Fork 86
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
To find probability or confidence score of model output, #22
Comments
Hey, sorry for not being so active here.
So actually we have a confidence per character of the input, and not of the output as a whole. You could come up with some quality metric by taking the product of the highest class probability for each character. This would tell you the probability of all characters together being the correct class (probability multiplication rule). But the result might look a little misleading, because the product of probabilities will get smaller and smaller with the increasing length of the string. It's not nice to have a number that shrinks proportionally to the length of the address. You could also take the average confidence of the predicted class for each letter. This would tell you that, on average, each letter was predicted with a confidence of x. It will not diminish with the string length, so might be more comparable between predictions. |
Thank you so much @jasonrig for actively replying. |
The softmax is already applied here: address-net/addressnet/model.py Line 31 in 28e7c2d
So you should be able to access the values here: address-net/addressnet/predict.py Line 143 in 28e7c2d
|
Just be aware that the value you calculate can't be interpreted as the confidence that the address is correct. |
Thank you so much @jasonrig for detailed explanation, before I got chance to see your last reply, i had already applied and followed the same you explained. And yeah, you are right . What i am getting is probability of each character. Doesn't look like confidence score. Initially i was getting array of character falling in class component, found out value have maximum value from array matrix. Of course, i have already tested on some real word actual data and using which I tried finding out accuracy. Where accuracy=precision=recall. My aim is just to confirm, for ex, out of 1000 sample real world addresses, X% have high accuracy/confidence score/probability above some threshold of being true predicted. So that I don't need to check every sample address if it's predicted correctly or not. Thanks |
Hello @jasonrig @Stallon-niranjan ,
I was working on retraining of addressnet. I did it successfully, now i want to find the confidence score / probability of model. Like how much my model is confidence (86% confident of address result generated)
For which I tried using tf.nn.softmax but it's throwing an error.
Value error:- "Truth value of an array with more than one element is ambiguous. Use a.any or a.all".
Is there any way if you guys can help me out to find out confidence score, probability function which helps me out to use addressnet over millions of addresses.
Any help would be appreciated.
Thanks & Regards
Aj.
The text was updated successfully, but these errors were encountered: