@@ -21,10 +21,12 @@ def pairwise_distance(
21
21
22
22
To illustrate the algorithm consider the following (4, 5) two dimensional array:
23
23
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]
28
30
29
31
The rows of the above matrix are the set of vectors. Now let's label all
30
32
the vectors as v0, v1, v2, v3.
@@ -34,10 +36,12 @@ def pairwise_distance(
34
36
distance between each vector and every other vector, will result in 16
35
37
distances and the resultant array will be of size (4, 4) as follows:
36
38
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]
41
45
42
46
The (i, j) position in the resulting array (matrix) denotes the distance
43
47
between vi and vj vectors.
0 commit comments