@@ -21,10 +21,12 @@ def pairwise_distance(
2121
2222 To illustrate the algorithm consider the following (4, 5) two dimensional array:
2323
24- [e.00, e.01, e.02, e.03, e.04]
25- [e.10, e.11, e.12, e.13, e.14]
26- [e.20, e.21, e.22, e.23, e.24]
27- [e.30, e.31, e.32, e.33, e.34]
24+ .. code-block:: none
25+
26+ [e.00, e.01, e.02, e.03, e.04]
27+ [e.10, e.11, e.12, e.13, e.14]
28+ [e.20, e.21, e.22, e.23, e.24]
29+ [e.30, e.31, e.32, e.33, e.34]
2830
2931 The rows of the above matrix are the set of vectors. Now let's label all
3032 the vectors as v0, v1, v2, v3.
@@ -34,10 +36,12 @@ def pairwise_distance(
3436 distance between each vector and every other vector, will result in 16
3537 distances and the resultant array will be of size (4, 4) as follows:
3638
37- [v0.v0, v0.v1, v0.v2, v0.v3]
38- [v1.v0, v1.v1, v1.v2, v1.v3]
39- [v2.v0, v2.v1, v2.v2, v2.v3]
40- [v3.v0, v3.v1, v3.v2, v3.v3]
39+ .. code-block:: none
40+
41+ [v0.v0, v0.v1, v0.v2, v0.v3]
42+ [v1.v0, v1.v1, v1.v2, v1.v3]
43+ [v2.v0, v2.v1, v2.v2, v2.v3]
44+ [v3.v0, v3.v1, v3.v2, v3.v3]
4145
4246 The (i, j) position in the resulting array (matrix) denotes the distance
4347 between vi and vj vectors.
0 commit comments