def lift(rule):
    nX = float(rule.coverage)
    N = float(len(rule.kb.examples))
    nXY = rule.distribution[rule.target]
    nY = rule.kb.distribution[rule.target]

    if nX != 0 and N != 0:
        return (nXY/nX)/(nY/N)
    else:
        return 0
dataset/ETHPy150Open anzev/hedwig/hedwig/stats/scorefunctions.py/lift/original