def correlation(u, v):
 u = _validate_vector(u)
 v = _validate_vector(v)
 umu = u.mean()
 vmu = v.mean()
 um = (u - umu)
 vm = (v - vmu)
 dist = (1.0 - (np.dot(um, vm) / (norm(um) * norm(vm))))
 return dist

def correlation ( u , v ) : u = _validate_vector ( u ) v = _validate_vector ( v ) umu = u . mean ( ) vmu = v . mean ( ) um = ( u - umu ) vm = ( v - vmu ) dist = ( 1.0 - ( np . dot ( um , vm ) / ( norm ( um ) * norm ( vm ) ) ) ) return dist
computes the correlation distance between two 1-d arrays .