# Similarity between sets with different size

is there a distance measure like jaccard for sets with different sizes? For example A=['a','b','c'] and B=['a','d']

I would like to include the total intersection as well as the order.

The implementation of jaccard similarity score in Pythons Sklearn only supports lists of same shape.

Thank you

• The mathematical answer to such a question is "of course" and it would go on to point out there is an infinite variety of possibilities. But that begs the statistical context: what is this "similarity" supposed to measure? You need to tell us that in order to get anything that might truly be useful to you. – whuber Jan 29 '16 at 14:32
• i edited my post. I would like to calculate a score which takes the intersection and the order into account. – J-H Jan 29 '16 at 15:02
• Thank you. But the question is still vague and still has too many possible, drastically different solutions. What statistical problem are you trying to solve? – whuber Jan 29 '16 at 15:07
• Thanks for your answer. I want to measure the quality of a classification. The result is a list containing different categories for each predicted sample like B=[a,b,c] C=[a,b] D=[c]. I want to compare these sets to my grounded truth set A = [a,b,c]. Therefore B should return the "highest" value and D the lowest because there is only one intercept and also at the wrong position (D=[c,none,none]) – J-H Jan 29 '16 at 15:16