-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathtestData.js
38 lines (35 loc) · 980 Bytes
/
testData.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
import { euclidean } from 'ml-distance-euclidean';
export const features1 = [
[2, 6],
[3, 4],
[3, 8],
[4, 5],
[4, 7],
[6, 2],
[7, 2],
[7, 4],
[8, 4],
[8, 5],
];
export const distanceMatrix1 = (() => {
const distance = new Array(features1.length);
for (let i = 0; i < features1.length; ++i) {
distance[i] = new Array(features1.length);
for (let j = 0; j < features1.length; ++j) {
distance[i][j] = euclidean(features1[i], features1[j]);
}
}
return distance;
})();
export const distanceMatrix2 = [
[0, 1, 1, 1, 1, 1, 1, 1, 1, 1],
[1, 0, 1, 1, 0.7, 0.79, 0.94, 1, 0.25, 0.57],
[1, 1, 0, 1, 1, 1, 1, 0.96, 1, 1],
[1, 1, 1, 0, 1, 1, 1, 1, 1, 1],
[1, 0.7, 1, 1, 0, 0.21, 0.95, 1, 0.79, 0.7],
[1, 0.79, 1, 1, 0.21, 0, 0.95, 1, 0.67, 0.79],
[1, 0.94, 1, 1, 0.95, 0.95, 0, 1, 0.94, 0.94],
[1, 1, 0.96, 1, 1, 1, 1, 0, 1, 1],
[1, 0.25, 1, 1, 0.79, 0.67, 0.94, 1, 0, 0.69],
[1, 0.57, 1, 1, 0.7, 0.79, 0.94, 1, 0.69, 0],
];