Same as the Tanimoto coefficient, but wit weights for each dimension.

def weighted_tanimoto(a, b, weights):
    """Same as the Tanimoto coefficient, but wit weights for each dimension."""
    weighted = lambda s: map(lambda (x,y): float(x)*float(y), zip(s, weights))
    return tanimoto_coefficient(weighted(a), weighted(b))