MCPcopy Index your code
hub / github.com/clips/pattern / distance

Method distance

pattern/vector/__init__.py:1080–1083  ·  view source on GitHub ↗

Returns the distance (COSINE, EUCLIDEAN, ...) between two document vectors (0.0-1.0).

(self, document1, document2, *args, **kwargs)

Source from the content-addressed store, hash-verified

1078 search = vector_space_search
1079
1080 def distance(self, document1, document2, *args, **kwargs):
1081 """ Returns the distance (COSINE, EUCLIDEAN, ...) between two document vectors (0.0-1.0).
1082 """
1083 return distance(document1.vector, document2.vector, *args, **kwargs)
1084
1085# def cluster(self, documents=ALL, method=KMEANS, k=10, iterations=10)
1086# def cluster(self, documents=ALL, method=HIERARCHICAL, k=1, iterations=1000)

Callers 5

canvas.jsFile · 0.45
pinchFunction · 0.45
test_canvas.jsFile · 0.45
test_distanceMethod · 0.45
test_distanceMethod · 0.45

Calls 1

distanceFunction · 0.85

Tested by 2

test_distanceMethod · 0.36
test_distanceMethod · 0.36