-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
241 lines (218 loc) · 9.88 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
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
<!DOCTYPE html>
<html>
<head>
<title> 6x6 Binary Dataset Generator </title>
</head>
<body>
<h1>Web based 6x6 Binary Generator</h1>
<p>Open Source tool :
<a href="https://github.com/EduardoArtioli/web-based-matrix-dataset-weka-arff">https://github.com/EduardoArtioli/web-based-matrix-dataset-weka-arff</a> </p>
<br>
<table id="table" border="1" width="40%" height="500px">
<tr>
<td id="td0" onclick="content(this)" style="color:white">0</td>
<td id="td1" onclick="content(this)" style="color:white">0</td>
<td id="td2" onclick="content(this)" style="color:white">0</td>
<td id="td3" onclick="content(this)" style="color:white">0</td>
<td id="td4" onclick="content(this)" style="color:white">0</td>
<td id="td5" onclick="content(this)" style="color:white">0</td>
</tr>
<tr>
<td id="td6" onclick="content(this)" style="color:white">0</td>
<td id="td7" onclick="content(this)" style="color:white">0</td>
<td id="td8" onclick="content(this)" style="color:white">0</td>
<td id="td9" onclick="content(this)" style="color:white">0</td>
<td id="td10" onclick="content(this)" style="color:white">0</td>
<td id="td11" onclick="content(this)" style="color:white">0</td>
</tr>
<tr>
<td id="td12" onclick="content(this)" style="color:white">0</td>
<td id="td13" onclick="content(this)" style="color:white">0</td>
<td id="td14" onclick="content(this)" style="color:white">0</td>
<td id="td15" onclick="content(this)" style="color:white">0</td>
<td id="td16" onclick="content(this)" style="color:white">0</td>
<td id="td17" onclick="content(this)" style="color:white">0</td>
</tr>
<tr>
<td id="td18" onclick="content(this)" style="color:white">0</td>
<td id="td19" onclick="content(this)" style="color:white">0</td>
<td id="td20" onclick="content(this)" style="color:white">0</td>
<td id="td21" onclick="content(this)" style="color:white">0</td>
<td id="td22" onclick="content(this)" style="color:white">0</td>
<td id="td23" onclick="content(this)" style="color:white">0</td>
</tr>
<tr>
<td id="td24" onclick="content(this)" style="color:white">0</td>
<td id="td25" onclick="content(this)" style="color:white">0</td>
<td id="td26" onclick="content(this)" style="color:white">0</td>
<td id="td27" onclick="content(this)" style="color:white">0</td>
<td id="td28" onclick="content(this)" style="color:white">0</td>
<td id="td29" onclick="content(this)" style="color:white">0</td>
</tr>
<tr>
<td id="td30" onclick="content(this)" style="color:white">0</td>
<td id="td31" onclick="content(this)" style="color:white">0</td>
<td id="td32" onclick="content(this)" style="color:white">0</td>
<td id="td33" onclick="content(this)" style="color:white">0</td>
<td id="td34" onclick="content(this)" style="color:white">0</td>
<td id="td35" onclick="content(this)" style="color:white">0</td>
</tr>
</table>
<button onclick="clean()"> CLEAN </button>
<button onclick="addone()"> ADD ONE </button>
<button onclick="addtwo()"> ADD TWO </button>
<button onclick="addthree()"> ADD THREE </button>
<button onclick="addnone()"> ADD NONE </button>
<p id="data"></p>
<p id="um"></p>
<p id="dois"></p>
<p id="tres"></p>
<div id="datasetdiv" style="background-color: lightgrey;width:60%">
<pre style="word-wrap: break-word; white-space: pre-wrap;" id="dataset">
% 1. Title: 1,2,3 Binary formatted numbers Database 
% 
% 2. Info: 
% This dataset was generated using a web based application. 
% It is composed of binary data arranged by a 6x6 matrix. 
% It was developed for the WEKA interface. 
% This dataset aims to train a multilayer perceptron (MLP), deep artificial neural network. 
% The goal is to recognize 1,2,3 characters expressed by a 6x6 matrix in black or white pixels. 
% 
% 3. Sources: 
% (a) Creator: xxxxx xxxxx xxxx 
% (b) Open source dataset generator tool: https://github.com/EduardoArtioli/generator 
% (c) Web based tool creator: Eduardo Artioli , [email protected] 
% (d) Review: Michael da Costa Mora 
% (e) Date: November, 2018 

@RELATION 6x6number 

@ATTRIBUTE bit0 {0,1} 
@ATTRIBUTE bit1 {0,1} 
@ATTRIBUTE bit2 {0,1} 
@ATTRIBUTE bit3 {0,1} 
@ATTRIBUTE bit4 {0,1} 
@ATTRIBUTE bit5 {0,1} 
@ATTRIBUTE bit6 {0,1} 
@ATTRIBUTE bit7 {0,1} 
@ATTRIBUTE bit8 {0,1} 
@ATTRIBUTE bit9 {0,1} 
@ATTRIBUTE bit10 {0,1} 
@ATTRIBUTE bit11 {0,1} 
@ATTRIBUTE bit12 {0,1} 
@ATTRIBUTE bit13 {0,1} 
@ATTRIBUTE bit14 {0,1} 
@ATTRIBUTE bit15 {0,1} 
@ATTRIBUTE bit16 {0,1} 
@ATTRIBUTE bit17 {0,1} 
@ATTRIBUTE bit18 {0,1} 
@ATTRIBUTE bit19 {0,1} 
@ATTRIBUTE bit20 {0,1} 
@ATTRIBUTE bit21 {0,1} 
@ATTRIBUTE bit22 {0,1} 
@ATTRIBUTE bit23 {0,1} 
@ATTRIBUTE bit24 {0,1} 
@ATTRIBUTE bit25 {0,1} 
@ATTRIBUTE bit26 {0,1} 
@ATTRIBUTE bit27 {0,1} 
@ATTRIBUTE bit28 {0,1} 
@ATTRIBUTE bit29 {0,1} 
@ATTRIBUTE bit30 {0,1} 
@ATTRIBUTE bit31 {0,1} 
@ATTRIBUTE bit32 {0,1} 
@ATTRIBUTE bit33 {0,1} 
@ATTRIBUTE bit34 {0,1} 
@ATTRIBUTE bit35 {0,1} 
@ATTRIBUTE class {Number-one,Number-two,Number-three,None} 

@DATA 
% Exemple: 

% 1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,Number-one 
% 0,1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,Number-one 
% 0,0,1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,Number-one 
% 0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,Number-one 
% 0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1,0,Number-one 
% 0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1,Number-one 
% 0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1,0,Number-one 
</pre>
</div>
<button type="button" id="download" onclick="downloadFile()">Download Arff File</button>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<script>
function downloadFile(){
var textToSave = document.getElementById("dataset").textContent;
var hiddenElement = document.createElement('a');
hiddenElement.href = 'data:attachment/text,' + encodeURI(textToSave);
// hiddenElement.href = 'data:attachment/text,' + escape(textToSave);
// hiddenElement.href = 'data:attachment/text,' + decodeURI();
hiddenElement.target = '_blank';
hiddenElement.download = 'dataset.arff';
hiddenElement.click();
}
var bool = 0;
var onedata = "0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,None";
var twodata = "0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,None";
var threedata = "0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,None";
var nonedata = "0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,None";
function content(elem)
{
console.log(elem);
if(elem.style.backgroundColor == "black"){
elem.style.backgroundColor = "white";
elem.style.color = "white";
elem.innerHTML = 0;
}else{
elem.style.backgroundColor = "black";
elem.style.color = "black";
elem.innerHTML = 1;
}
var data = document.getElementById("data");
var text = "";
$( "td" ).each(function( index ) {
// console.log( index + ": " + $( this ).text() );
text += $( this ).text() + ",";
});
data.innerHTML = "Data code : " + text.substring(0, text.length - 1);
onedata = text + "Number-one";
um.innerHTML = "Se um : " + onedata;
twodata = text + "Number-two";
dois.innerHTML = "Se dois : " + twodata;
threedata = text + "Number-three";
tres.innerHTML = "Se três : " + threedata;
nonedata = text + "None"
}
function clean(){
$( "td" ).each(function( index ) {
// console.log( index + ": " + $( this ).text() );
$( this ).html("0").css("background-color","white").css("color","white");
});
var text = "";
$( "td" ).each(function( index ) {
// console.log( index + ": " + $( this ).text() );
text += $( this ).text() + ",";
});
data.innerHTML = "Data code : " + text.substring(0, text.length - 1);
um.innerHTML = "Se um : " + text + "Numero-um";
dois.innerHTML = "Se dois : " + text + "Numero-dois";
tres.innerHTML = "Se três : " + text + "Numero-tres";
onedata = "0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,None";
twodata = "0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,None";
threedata = "0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,None";
nonedata = "0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,None";
}
function addone(){
dataset.textContent += onedata + "\r\n";
}
function addtwo(){
dataset.textContent += twodata + "\r\n";
}
function addthree(){
dataset.textContent += threedata + "\r\n";
}
function addnone(){
dataset.textContent += nonedata + "\r\n";
}
</script>
</body>
</html>