-
Notifications
You must be signed in to change notification settings - Fork 16
/
main.html
80 lines (73 loc) · 3.2 KB
/
main.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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
<html>
<head>
<script type="text/javascript" src="http://code.jquery.com/jquery-1.8.1.min.js"></script>
<script type="text/javascript"
src="http://cdnjs.cloudflare.com/ajax/libs/underscore.js/1.3.3/underscore-min.js"></script>
<script type="text/javascript"
src="https://raw.github.com/strathausen/dracula/master/source/dracula_graph.js"></script>
<script type="text/javascript"
src="https://raw.github.com/DmitryBaranovskiy/raphael/master/raphael-min.js"></script>
<script type="text/javascript"
src="http://sigmajs.org/js/sigma.min.js"></script>
<script type="text/javascript" src="https://raw.github.com/strathausen/dracula/master/js/dracula_graffle.js"></script>
<script type="text/javascript" src="https://raw.github.com/strathausen/dracula/master/js/dracula_graph.js"></script>
<script type="text/javascript"
src="https://raw.github.com/strathausen/dracula/master/js/dracula_algorithms.js"></script>
<script type="text/javascript" src="js/examples.js"></script>
<script type="text/javascript"
src="js/tic-tac-examples.js"></script>
<script type="text/javascript"
src="js/voting-examples.js"></script>
<script src="http://d3js.org/d3.v2.js"></script>
<script type="text/javascript" src="js/id3.js"></script>
<script type='text/javascript'
src='https://www.google.com/jsapi?autoload={"modules":[{"name":"visualization","version":"1","packages":["orgchart"]}]}'></script>
<script type="text/javascript">
$(document).ready(function(){
console.log('all systems go');
$("#fire_tic_tac_toe").click(function(e){
e.preventDefault();
var testModel = id3(examples_tic_tac_toe,'classification',features_tic_tac_toe);
drawGraph(testModel,'canvas');
renderSamples(samples_tic_tac_toe,$("#samples"),testModel,'classification',features_tic_tac_toe);
renderTrainingData(examples_tic_tac_toe,$("#training"),'classification',features_tic_tac_toe);
});
$("#fire_voting").click(function(e){
e.preventDefault();
var testModel = id3(voting_examples,'classification',voting_features);
drawGraph(testModel,'canvas');
renderSamples(voting_samples,$("#samples"),testModel,'classification',voting_features);
renderTrainingData(voting_examples,$("#training"),'classification',voting_features);
});
$("#fire_tennis").click(function(e){
e.preventDefault();
var testModel = id3(examples,'play',features);
drawGraph(testModel,'canvas');
renderSamples(samples,$("#samples"),testModel,'play',features);
renderTrainingData(examples,$("#training"),'play',features);
console.log("error");
console.log(calcError(samples,testModel,'play'));
});
});
</script>
</head>
<body>
<div id="main">
<h1>ID3 Algorithm</h1>
<a id="fire_tennis" href="#">Run Tennis</a>
<a id="fire_voting" href="#">Run Voting</a>
<a id="fire_tic_tac_toe" href="#">Run Tic Tac Toe</a>
<div id="data-container">
<div id='canvas'></div>
<div >
<h3>Sample Predictions</h3>
<table id='samples'>
</table>
<h3>Training Data</h3>
<table id='training'>
</table>
</div>
</div>
</div>
</body>
</html>