def percentOverlap(x1, x2, size):
nonZeroX1 = np.count_nonzero(x1)<EOL>nonZeroX2 = np.count_nonzero(x2)<EOL>minX1X2 = min(nonZeroX1, nonZeroX2)<EOL>percentOverlap = <NUM_LIT:0><EOL>if minX1X2 > <NUM_LIT:0>:<EOL><INDENT>percentOverlap = float(np.dot(x1, x2))/float(minX1X2)<EOL><DEDENT>return percentOverlap<EOL>
Computes the percentage of overlap between vectors x1 and x2.

@param x1   (array) binary vector
@param x2   (array) binary vector
@param size (int)   length of binary vectors

@return percentOverlap (float) percentage overlap between x1 and x2