def russellrao(u, v):
 u = _validate_vector(u)
 v = _validate_vector(v)
 if (u.dtype == bool):
  ntt = (u & v).sum()
 else:
  ntt = (u * v).sum()
 return (float((len(u) - ntt)) / float(len(u)))

def russellrao ( u , v ) : u = _validate_vector ( u ) v = _validate_vector ( v ) if ( u . dtype == bool ) : ntt = ( u & v ) . sum ( ) else : ntt = ( u * v ) . sum ( ) return ( float ( ( len ( u ) - ntt ) ) / float ( len ( u ) ) )
computes the russell-rao dissimilarity between two boolean 1-d arrays .