def wracc(rule):
    nX = rule.coverage
    N = len(rule.kb.examples)
    nXY = rule.distribution[rule.target]
    nY = rule.kb.distribution[rule.target]
    if nX:
        return nX / float(N) * (nXY/float(nX) - nY/float(N))
    else:
        return 0
dataset/ETHPy150Open anzev/hedwig/hedwig/stats/scorefunctions.py/wracc/original