similarity#
- similarity(*args, method='jaccard')[source]#
Compute pair-wise similarity for two or more sets
If two arguments, returns a scalar similarity between 0 and 1. If three or more, compute the matrix of similarities. Similarity is computed by default via the Jaccard index, which is the length of the intersection of the sets divided by the length of their union.
- Parameters:
*args (set/list/arr) – Two or more iterables to compute the
method (str) – Similarity metric: ‘jaccard’ (default) or ‘dice’
New in version 3.2.4.