Many algorithms provide a predict_proba
function indicating probability of a case to belong to that class (e.g. https://scikit-learn.org/stable/modules/generated/sklearn.svm.libsvm.predict_proba.html ).
Quoting from the answer by @Media at Explain Binary Classification with output 0.5 (True)
Suppose that you have a car classifier for distinguishing between white and blue cars. during training you had 100 images of blue car and 20 images of white car. During recall phase, if for an arbitrary image you have 50 percent for each class...
If blue cars accounted for 83% of training cases, and I get predict_proba
for a car to be blue to be 0.5, do I take the probability to be 0.5 or do I need to correct it by a factor of 0.83?
If I do need to correct, do I multiply the factor (0.5*0.83) or divide it (0.5/0.83) to get the correct probability?