-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
executable file
·219 lines (179 loc) · 7.58 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
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>Online HFM - Powered by OptFrame</title>
</head>
<body >
<center><h1> Online Hybrid Forecasting Model</h1></center>
<strong> From renewable energy and stock marketing forecasting to EEG learning or IoT solutions for Microgrids and Digital/Smart Cities.</strong>
<b> References:</b>
<a href="http://www.sciencedirect.com/science/article/pii/S0306261916301684?via%3Dihub" target="_blank">[1]</a>,
<a href="http://www.sciencedirect.com/science/article/pii/S0306261917300041?via%3Dihub" target="_blank">[2]</a> and
<a href="http://www.sciencedirect.com/science/article/pii/S1571065317300471?via%3Dihub" target="_blank">[3]</a>.
<p>Visit and contribute on github: <a href="https://github.com/vncoelho/HFM/" target="_blank">https://github.com/vncoelho/HFM</a> and
<a href="https://github.com/optframe/optframe" target="_blank">https://github.com/optframe/optframe</a></p>
<center>
<p><input type="button" value="Run HFM" id='mylink'> </p>
<h3>Method and problem params:</h3>
<p><b>*tMax <a href="http://www.mitpressjournals.org/doi/10.1162/EVCO_a_00187" target="_blank">NGES</a>(limited to 20):</b>
<input type="text" name="textWeight" id="maxTimeNGES" maxlength="2" onchange="this.value = minmax(this.value, 5, 30)" value="10" size="2" />
and <b>*tMax <a href="http://www.sciencedirect.com/science/article/pii/S0305054816302283?via%3Dihub" target="_blank">GPLS</a>(limited to 30):</b>
<input type="text" name="textWeight" id="maxTimeNGES" maxlength="2" onchange="this.value = minmax(this.value, 0, 30)" value="10" size="2" /></p>
<p><b>*maxLag (%)</b>:
<input type="text" name="textML" id="maxLag" maxlength="5" onchange="this.value = minmax(this.value, 0.01, 100)" value="0.1" size="4" step=".01" />
and <b>*maxExogenousVariablesForecasts(fh)</b>:
<input type="text" name="textMUL" id="maxUpperLag" maxlength="3" onchange="this.value = minmax(this.value, 0, 100)" value="0" size="3" />
</p>
<!-- <h3>Forcing forecasts to:</h3> -->
<p><b>*forceForecastToBinary(bool)</b>:
<input type="text" name="textMUL" id="forceBinary" maxlength="1" onchange="this.value = minmax(this.value, 0, 1)" value="0" size="1" step=".01" />
<b>*forceForecastToNonNegative(bool)</b>:
<input type="text" name="textMUL" id="forceNonNegative" maxlength="1" onchange="this.value = minmax(this.value, 0, 1)" value="0" size="1" step=".01" />
and <b>*forceForecastToInteger(bool)</b>:
<input type="text" name="textMUL" id="foreceInteger" maxlength="1" onchange="this.value = minmax(this.value, 0, 1)" value="0" size="1" step=".01" />
</p>
<div id="runHFMStatus"></div>
<p><input type="button" value="Stop HFM (NOT WORKING PRPERLY)" onClick="javascript_abort()"></p>
</center>
<script type="text/javascript">
function minmax(value, min, max)
{
if(parseFloat(value) < min || isNaN(parseFloat(value)))
return min;
else if(parseFloat(value) > max)
return max;
else return value;
}
</script>
<!--UPDATING HFM STATUS-->
<script type="text/javascript">
document.getElementById("runHFMStatus").innerHTML = "STATUS: waiting action...";
</script>
<!--UPDATING HFM STATUS-->
<!--RUNNING HFM FUNCTION-->
<script type="text/javascript">
var myLink = document.getElementById('mylink');
myLink.onmousedown = function(){
document.getElementById("runHFMStatus").innerHTML = "STATUS: running HFM for " + document.getElementById("maxTimeNGES").value + " seconds.";
}
myLink.onclick = function(){
callTSForecasting = Module.cwrap('callTSForecasting','string', ['number'])
if ( confirm( "This task may take " + document.getElementById("maxTimeNGES").value + " seconds or more to finish. Do you wish to continue?" ) ) {
var forecasts = callTSForecasting(0);
console.log(forecasts);
processForecasts(forecasts);
}
document.getElementById("runHFMStatus").innerHTML = "STATUS: Finished HFM...";
return true;
}
</script>
<!--RUNNING HFM FUNCTION-->
<!--Trying to stop HFM-->
<script type="text/javascript">
function javascript_abort()
{
throw new Error('Stoping HFM execution. This is just to abort javascript');
}
</script>
<!--Trying to stop HFM-->
<!--Clear output function-->
<script>
function clearOutput() {
document.getElementById("output").innerHTML = "";
document.getElementById("csvFileInput").value = "";
}
</script>
<!--Clear output function finishes-->
<div>
<form class="form-horizontal well">
<legend>
<h3>
<div id="title">HTML5 File Louder API
</div>
</h3>
</legend>
<fieldset>
<label for="csvFileInput"> <strong>CSV Target Time Series:</strong>
</label>
<input type="file" id="csvFileInput" onchange="handleFiles(this.files)"
accept=".csv">
<div id="fileStatus"> </div>
<div id="timeTSStatus"> </div>
<p><input type="button" value="Hide target TS" onClick="clearOutput()">
<input type="button" value="Hide testing TS" onClick="clearOutput()">
<input type="button" value="Hide forecast(TODO)" onClick="clearOutput()">
<input type="button" value="Plot solution(TODO):" onClick="clearOutput()">
<input type="text" name="textMUL" id="solToPlot" maxlength="3" onchange="this.value = minmax(this.value, 0, 9000)" value="0" size="3"/>
</p>
</div>
</fieldset>
</form>
<h3>Obtained forecasts: [forecast/targets/residuals]</h3>
<div id="outputForecasts">
</div>
<h3>Input data:</h3>
<div id="output">
</div>
<h3>Testing data:</h3>
<div id="outputTestingTS">
</div>
</div>
<br>
<br>
<center><h3>Thanks for your support! We are glad you are here.</h3></center>
<footer>
<center>
<p>© Vitor Nazário Coelho and Igor Machado Coelho, 2018</p>
</center>
</footer>
<!-- Le javascript
================================================== -->
<!-- Placed at the end of the document so the pages load faster -->
<script type="text/javascript" src="website/js/hfm-converted.js"></script>
<script type="text/javascript" src="website/js/read-csv.js"></script>
<!--
<a href='linkhref.html' id='mylink'>Print</a>
<input value="Hello" type="button" onClick="myLink"/>
<script type="text/javascript" src="file.js"></script>
<script type="text/javascript">
var x = [ 'p0', 'p1', 'p2' ];
var myLink = document.getElementById('mylink(x,this)');
myLink.onclick = function(params){
for (i=0; i<params.length; i++) {
alert(params[i])
}
console.log(params);
var script = document.createElement("script");
script.type = "text/javascript";
//script.src = "Public/Scripts/filename.js.";
script.src = "app_HFM.js"
var a = "Oi,TudoBem?";
console.log(a);
MYLIBRARY.init(a);
MYLIBRARY.helloWorld();
document.getElementsByTagName("head")[0].appendChild(script);
return false;
}
</script>
<script type="text/javascript" src="file.js"></script>
<script type="text/javascript">
function myLink2(params){
for (i=0; i<params.length; i++) {
alert(params[i])
}
console.log(params);
var script = document.createElement("script");
script.type = "text/javascript";
//script.src = "Public/Scripts/filename.js.";
script.src = "app_HFM.js"
var a = "Oi,TudoBem?";
console.log(a);
MYLIBRARY.init(a);
MYLIBRARY.helloWorld();
document.getElementsByTagName("head")[0].appendChild(script);
return false;
}
</script>
-->
</body>
</html>