-
Notifications
You must be signed in to change notification settings - Fork 15
/
index.html
33 lines (32 loc) · 1.15 KB
/
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
<html>
<head>
<script type="text/javascript" src="apriori.js"></script>
<link href="node_modules/mocha/mocha.css" media="screen" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="mocha"></div>
<script src="node_modules/mocha/mocha.js" type="text/javascript" charset="utf-8"></script>
<script src="node_modules/chai/chai.js" type="text/javascript" charset="utf-8"></script>
<script>
mocha.ui('bdd');
expect = chai.expect;
</script>
<script src="phantom_test/amd_compatibility_spec.js" type="text/javascript" charset="utf-8"></script>
<script>
if (window.mochaPhantomJS) {
mochaPhantomJS.run();
} else {
var request = new XMLHttpRequest();
request.open('GET', 'dataset.csv', true);
request.onload = function() {
var transactions = Apriori.ArrayUtils.readCSVToArray(request.responseText);
var apriori = new Apriori.Algorithm(0.15, 0.6, true);
var result = apriori.analyze(transactions);
document.write('<pre>' + JSON.stringify(result, null, ' ') + '</pre>');
};
request.onerror = function() { document.write('dataset.csv not found'); };
request.send();
}
</script>
</body>
</html>