fog/test/clustering/jaccard_intersection_index_...

23 lines
595 B
Python

# =============================================================================
# Fog Jaccard Intersection Index Clustering Unit Tests
# =============================================================================
from test.clustering.utils import Clusters
from fog.clustering import jaccard_intersection_index
DATA = [
'abcde',
'abcdeg',
'zyx'
]
CLUSTERS = Clusters([
('abcde', 'abcdeg')
])
class TestJaccardIntersectionIndex(object):
def test_basics(self):
clusters = Clusters(jaccard_intersection_index(DATA, radius=0.8))
assert clusters == CLUSTERS