Orange Forum • View topic - Bug in orngStat.NPV

Bug in orngStat.NPV

Report bugs (or imagined bugs).
(Archived/read-only, please use our ticketing system for reporting bugs and their discussion.)
Forum rules
Archived/read-only, please use our ticketing system for reporting bugs and their discussion.

Bug in orngStat.NPV

Postby bgbg » Tue May 25, 2010 17:11

This is the code in orngStat.NPV:
Code: Select all
def NPV(confm):
    """Return negative predictive value over the given confusion matrix."""
    if type(confm) == list:
        return [NPV(cm) for cm in confm]
    else:
        tot = confm.TP+confm.TN
        if tot < 1e-6:
            import warnings
            warnings.warn("Can't compute NPV: one or both classes have no instances")
            return -1
        return confm.TP/tot


according to this code, NPV = TP/(TP + TN)

According to the Wikipedia (http://en.wikipedia.org/wiki/Negative_predictive_value), NPV = TN / (FN + TN), which is not quite the same

Postby Ales » Wed May 26, 2010 9:43

Thanks. The fix has been commited to the svn.


Return to Bugs