-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathindex.html
executable file
·42 lines (35 loc) · 984 Bytes
/
index.html
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
39
40
41
42
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Clustering.js</title>
<script src="dist/k-medians.js"></script>
<script>
;(function(undefined){
'use strict';
var km = new this.KMedians({
K: 64,
distanceMetric: this.DistanceMetrics.Manhattan,
tolerance: 0.001
});
var data = (function(){
var i = 1000
, j
, ret = [];
while(i--) {
j = 5;
ret.push([])
while(j--)
ret[ret.length-1].push(Math.random())
}
return ret;
})()
km.cluster(data, undefined, function(){
console.log(this.iteration, this.clusters);
});
}).call(Clustering);
</script>
</head>
<body>
</body>
</html>