def overlap_coefficient(label1, label2):
	""" Distance metric comparing set-similarity. """
	#the original formula used float, but it doesn't seem to make any difference
	#return float(len(label1 & label2)) / min(len(label1), len(label2))
	if min(len(label1), len(label2)) == 0:
		return 0
	else:
		return len(label1.intersection(label2)) / min(len(label1), len(label2))