meeliskull / prg

Software to create Precision-Recall-Gain curves and calculate area under the curve
38 stars 18 forks source link

replaced != with np.close to check for equality of floats to within a… #2

Closed annashcherbina closed 8 years ago

annashcherbina commented 8 years ago

replaced != with np.close to check for equality of floats to within epsilon precision.

meeliskull commented 8 years ago

Thanks for the proposed change! Could you please tell me what has caused numerical differences in scores that should be equal in your case? As the scores come from a single model they are usually either identical or if not then they are different for a reason. For instance, Naive Bayes can give you scores very close to zero, such as 1e-20 and 1e-30, and these are different for a reason, and they should not be treated as ties. Therefore, I would prefer not to check equality with an epsilon-thresholded absolute difference. Thanks again for raising this important issue!