def least_squares_fit(x, y):
 beta = ((correlation(x, y) * standard_deviation(y)) / standard_deviation(x))
 alpha = (mean(y) - (beta * mean(x)))
 return (alpha, beta)

def least_squares_fit ( x , y ) : beta = ( ( correlation ( x , y ) * standard_deviation ( y ) ) / standard_deviation ( x ) ) alpha = ( mean ( y ) - ( beta * mean ( x ) ) ) return ( alpha , beta )
given training values for x and y .