def precision(rule):
    nX = rule.coverage
    nXY = rule.distribution[rule.target]
    if nX:
        return nXY/float(nX)
    else:
        return 0
dataset/ETHPy150Open anzev/hedwig/hedwig/stats/scorefunctions.py/precision/original