def least_square(x, y): # y=a+bx
    meanx = sum(x)/len(x)
    meany = sum(y)/len(y)
    xy = sum((x[i]-meanx)*(y[i]-meany) for i in range(len(x)))
    square = sum((x[i]-meanx)**2 for i in range(len(x)))
    b = xy/square
    return (meany-b*meanx, b)
dataset/ETHPy150Open isnowfy/snownlp/snownlp/utils/good_turing.py/least_square/original