-
Notifications
You must be signed in to change notification settings - Fork 1
/
index.html
147 lines (134 loc) · 6.82 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
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
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
<!DOCTYPE html>
<html>
<body>
<head>
<meta charset="UTF-8">
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<meta http-equiv="content-language" content="en">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="./css/simple-grid.min.css">
<link rel="stylesheet" href="./css/style.css">
<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
<title>Lam - Binary Naive Bayes Classifier Calculator</title>
</head>
<div class="row">
<div class= "col-10">
<h2><a href="https://khlam.github.io/" style="text-decoration:none">khlam.github.io</a>/bayes</h2>
<h4>Binary <a href="https://en.wikipedia.org/wiki/Naive_Bayes_classifier">Naive Bayes [Wikipedia]</a> classifier calculator. Enter features or observations and calculate probabilities. Refresh to reset.</h4>
<p>For more information see <a href="http://youtu.be/ngKU5466i4o">Dr. Tom Mitchell's lecture [Youtube]</a></p>
</div>
</div>
<div class="row">
<div class="col-1"></div>
<div class="col-10">
<table id="dataInputTable">
<tr id="header">
<td width=30px></td>
<td onclick=changeValueText(event.target)> a </td>
<td onclick=changeValueText(event.target)> b </td>
<td onclick=changeValueText(event.target)> c </td>
<td> y </td>
<td width=30px><button class="material-icons" onclick="newCol()">add</button></td>
</tr>
<tr>
<td>#1</td>
<td onclick=changeValueBool(event.target)> 0 </td>
<td onclick=changeValueBool(event.target)> 1 </td>
<td onclick=changeValueBool(event.target)> 1 </td>
<td onclick=changeValueBool(event.target)> 0 </td>
<td><button class="material-icons" onclick="delRow(this)">delete</button></td>
</tr>
<tr>
<td>#2</td>
<td onclick=changeValueBool(event.target)> 1 </td>
<td onclick=changeValueBool(event.target)> 1 </td>
<td onclick=changeValueBool(event.target)> 1 </td>
<td onclick=changeValueBool(event.target)> 0 </td>
<td><button class="material-icons" onclick="delRow(this)">delete</button></td>
</tr>
<tr>
<td>#3</td>
<td onclick=changeValueBool(event.target)> 0 </td>
<td onclick=changeValueBool(event.target)> 0 </td>
<td onclick=changeValueBool(event.target)> 0 </td>
<td onclick=changeValueBool(event.target)> 0 </td>
<td><button class="material-icons" onclick="delRow(this)">delete</button></td>
</tr>
<tr>
<td>#4</td>
<td onclick=changeValueBool(event.target)> 1 </td>
<td onclick=changeValueBool(event.target)> 1 </td>
<td onclick=changeValueBool(event.target)> 0 </td>
<td onclick=changeValueBool(event.target)> 1 </td>
<td><button class="material-icons" onclick="delRow(this)">delete</button></td>
</tr>
<tr>
<td>#5</td>
<td onclick=changeValueBool(event.target)> 0 </td>
<td onclick=changeValueBool(event.target)> 1 </td>
<td onclick=changeValueBool(event.target)> 0 </td>
<td onclick=changeValueBool(event.target)> 1 </td>
<td><button class="material-icons" onclick="delRow(this)">delete</button></td>
</tr>
<tr>
<td>#6</td>
<td onclick=changeValueBool(event.target)> 1 </td>
<td onclick=changeValueBool(event.target)> 0 </td>
<td onclick=changeValueBool(event.target)> 1 </td>
<td onclick=changeValueBool(event.target)> 1 </td>
<td><button class="material-icons" onclick="delRow(this)">delete</button></td>
</tr>
<tr id="delrow">
<td><button class="material-icons" onclick="newRow(this)">add</button></td>
<td><button class="material-icons" onclick="delCol(this)">delete</button></td>
<td><button class="material-icons" onclick="delCol(this)">delete</button></td>
<td><button class="material-icons" onclick="delCol(this)">delete</button></td>
<td></td>
<td></td>
</tr>
</table>
</div>
</div>
<div class="row">
<div class="col-1"></div>
<div class="col-10">
<h4>Solve </h4>
<p>
P(y = <span id="yVal" onclick=changeValueBool(event.target)>1</span> | <span id="featureConst"></span>)
</p>
<script type="module">
import { LaTeXJSComponent } from "https://cdn.jsdelivr.net/npm/latex.js/dist/latex.mjs"
customElements.define("latex-js", LaTeXJSComponent)
</script>
</div>
</div>
<div class="row">
<div class="col-1"></div>
<div class="col-10" id="latexResult">
</div>
</div>
<div class="row">
<div class="col-1"></div>
<div class="col-2">
<p>Latex <input id="latexResultText" value=""></input> </p>
</div>
<div class="col-2">
<p>Fraction <input id="fracResultText" value=""></input> </p>
</div>
</div>
<div class="row">
<div class="col-1"></div>
<div class="col-10" id="probTableResult">
</div>
</div>
<footer class="footer">
<div class="row">
<center>
<a href="https://github.com/khlam/bayes">source</a>
</center>
</div>
</footer>
<script type="text/javascript" src="./js/helper.js"></script>
<script type="text/javascript" src="./js/naiveBaysTableClassifier.js"></script>
</body>
</html>