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

  • 1
    $\begingroup$ 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. $\endgroup$ – whuber Jan 29 '16 at 14:32
  • $\begingroup$ i edited my post. I would like to calculate a score which takes the intersection and the order into account. $\endgroup$ – J-H Jan 29 '16 at 15:02
  • $\begingroup$ 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? $\endgroup$ – whuber Jan 29 '16 at 15:07
  • $\begingroup$ 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]) $\endgroup$ – J-H Jan 29 '16 at 15:16

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.