feat: optimize prediction
Browse files- .gitignore +2 -1
- Dockerfile +2 -1
- debug_tensor.txt +73 -0
- handlers/inference_handler.go +46 -0
- handlers/infograpic_handler.go +6 -10
- helpers/memory_usage.go +18 -0
- inferences/inference_helpers.go +63 -0
- inferences/stock_prediction.go +57 -84
- inferences/stock_prediction_debug.go +301 -0
- main.go +13 -2
- makefile +4 -11
- public/js/infographic/stock_prediction/inference.js +3 -2
- public/js/infographic/stock_prediction/update_pred_chart.js +7 -7
- public_dist/js/infographic/stock_prediction/inference.js +1 -1
- public_dist/js/infographic/stock_prediction/update_pred_chart.js +1 -1
- update_dataset_models.sh +15 -0
- views/infographic.html +1 -1
.gitignore
CHANGED
|
@@ -1,6 +1,7 @@
|
|
| 1 |
/node_modules
|
| 2 |
/indonesia_stocks
|
|
|
|
| 3 |
/onnxruntime
|
| 4 |
/onnxruntime-linux-x64-1.21.0
|
|
|
|
| 5 |
/models
|
| 6 |
-
getmodels.sh
|
|
|
|
| 1 |
/node_modules
|
| 2 |
/indonesia_stocks
|
| 3 |
+
|
| 4 |
/onnxruntime
|
| 5 |
/onnxruntime-linux-x64-1.21.0
|
| 6 |
+
|
| 7 |
/models
|
|
|
Dockerfile
CHANGED
|
@@ -1,6 +1,7 @@
|
|
| 1 |
FROM golang:1.21.13-bullseye
|
| 2 |
|
| 3 |
LABEL creator="al-fariqy raihan"
|
|
|
|
| 4 |
|
| 5 |
ENV APP_DIR=/thesis_forecasting_website \
|
| 6 |
GO111MODULE=on \
|
|
@@ -43,4 +44,4 @@ RUN mkdir -p models && \
|
|
| 43 |
RUN chmod -R 755 ${APP_DIR}
|
| 44 |
EXPOSE 7860
|
| 45 |
|
| 46 |
-
CMD ["./main"]
|
|
|
|
| 1 |
FROM golang:1.21.13-bullseye
|
| 2 |
|
| 3 |
LABEL creator="al-fariqy raihan"
|
| 4 |
+
LABEL npm="202143501514"
|
| 5 |
|
| 6 |
ENV APP_DIR=/thesis_forecasting_website \
|
| 7 |
GO111MODULE=on \
|
|
|
|
| 44 |
RUN chmod -R 755 ${APP_DIR}
|
| 45 |
EXPOSE 7860
|
| 46 |
|
| 47 |
+
CMD ["./main"]
|
debug_tensor.txt
ADDED
|
@@ -0,0 +1,73 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
|
| 2 |
+
┌───────────────────────────────────────────────────┐
|
| 3 |
+
│ Fiber v2.52.9 │
|
| 4 |
+
│ http://127.0.0.1:7860 │
|
| 5 |
+
│ (bound on host 0.0.0.0 and port 7860) │
|
| 6 |
+
│ │
|
| 7 |
+
│ Handlers ............. 9 Processes ........... 1 │
|
| 8 |
+
│ Prefork ....... Disabled PID .............. 3443 │
|
| 9 |
+
└───────────────────────────────────────────────────┘
|
| 10 |
+
|
| 11 |
+
[ Time ] Load ONNX Runtime : 1.284370100 s
|
| 12 |
+
|
| 13 |
+
[ Time ] Get Inference Scaler Data : 0.360198800 s
|
| 14 |
+
|
| 15 |
+
[ -- fmt.Println(data) -- ]
|
| 16 |
+
[[2023-02-24 0.117896326 0.03166881 0.6100166 0.36160064 0.5661812] [2023-02-27 0.14933504 0.053230006 0.5037513 0.52785075 0.56456184] [2023-02-28 0.14147565 0.11626053 0.6501211 0.48254967 0.5583146] [2023-03-01 0.09431716 0.062815055 0.5397935 0.26566896 0.53082776] [2023-03-02 0.10217688 0.048727717 0.45819578 0.312372 0.51177216] [2023-03-03 0.055018216 0.10134421 0.345866 0.1509849 0.47478062] [2023-03-06 0.03143922 0.09763991 0.2617981 0.090449095 0.43476927] [2023-03-07 0.039298773 0.115942694 0.18690357 0.14312671 0.40699565] [2023-03-08 0.08645727 0.07955804 0.321259 0.40549907 0.4068114] [2023-03-09 0.08645727 0.04536912 0.404207 0.40549907 0.40702304] [2023-03-10 0.047158662 0.05268107 0.34351858 0.24992779 0.3898577] [2023-03-13 0.07859772 0.08326492 0.4659021 0.40874085 0.3911062] [2023-03-14 0.0078598885 0.09470803 0.36943388 0.18972646 0.36078665] [2023-03-15 0.0078598885 0.089613035 0.36943388 0.18972646 0.33791253] [2023-03-16 0 0.115641445 0.26853392 0.1680009 0.3175954] [2023-03-17 0.023579331 0.24161223 0.5353767 0.30193084 0.31366104] [2023-03-20 0.03143922 0.02236285 0.57353663 0.34473372 0.31553316] [2023-03-21 0.06287794 0.09623345 0.6604757 0.49946338 0.33254388] [2023-03-24 0.16505481 0.16962376 0.7701348 0.785352 0.3930543] [2023-03-27 0.12575588 0.12216507 0.6222287 0.61823595 0.42329067] [2023-03-28 0.117896326 0.10531334 0.51345325 0.5865936 0.44361147] [2023-03-29 0.21249525 0.10908113 0.6081353 0.7862048 0.5020394] [2023-03-30 0.22051203 0.13333862 0.70048416 0.79910475 0.5506947] [2023-03-31 0.19646169 0.1037504 0.58574986 0.69298446 0.5767084] [2023-04-03 0.21249525 0.05364463 0.63656694 0.72829837 0.6027246] [2023-04-04 0.20447814 0.054578424 0.5635326 0.68872046 0.61762327] [2023-04-05 0.18844491 0.021879166 0.5999927 0.6078646 0.6200345] [2023-04-06 0.19646169 0.033525787 0.5403255 0.6345746 0.62345743] [2023-04-10 0.21249525 0.016541919 0.57925606 0.68804944 0.6312416] [2023-04-11 0.22051203 0.032254588 0.63120043 0.7146326 0.6387463] [2023-04-12 0.24456239 0.09662252 0.7246281 0.78897065 0.6531619] [2023-04-13 0.2525795 0.04200467 0.76960593 0.81198156 0.6656125] [2023-04-14 0.2766302 0.121704765 0.8491785 0.8754074 0.683597] [2023-04-17 0.28464663 0.08580596 0.896342 0.8947686 0.6984967] [2023-04-18 0.31671444 0.09563707 0.93888754 0.96139234 0.721633] [2023-04-26 0.34076512 0.22580154 1 1 0.7473511] [2023-04-27 0.3247312 0.046240512 0.9016013 0.8605789 0.7567604] [2023-04-28 0.29266343 0.16985717 0.68433666 0.6291036 0.74606955] [2023-05-02 0.29266343 0.085396774 0.584656 0.6291036 0.7341834] [2023-05-03 0.2525795 0.08550947 0.49626222 0.39541188 0.70345795] [2023-05-04 0.2766302 0.06353596 0.5634849 0.51431227 0.68718386] [2023-05-05 0.2766302 0.05979767 0.6238 0.51431227 0.6715943] [2023-05-08 0.2766302 0.08690383 0.6948064 0.51431227 0.6567189] [2023-05-09 0.2525795 0.027327072 0.63739085 0.36163715 0.63174933] [2023-05-10 0.2525795 0.033299036 0.57458013 0.36163715 0.609979] [2023-05-11 0.22051203 0.083151 0.47209752 0.19431539 0.5765324] [2023-05-12 0.21249525 0.10290579 0.37241885 0.16026664 0.5451422] [2023-05-15 0.20447814 0.059818335 0.3148753 0.12616378 0.5157204] [2023-05-16 0.18042763 0.038973827 0.27403668 0.03803681 0.48096117] [2023-05-17 0.20447814 0.066840865 0.38640726 0.25537547 0.4640621] [2023-05-19 0.2766302 0.13970128 0.5473509 0.6292489 0.48299477] [2023-05-22 0.2766302 0.095394135 0.63983876 0.6292489 0.49731588] [2023-05-23 0.31671444 0.11168075 0.72624177 0.7600828 0.52589905] [2023-05-24 0.28464663 0.07689627 0.6164412 0.5746653 0.5328614] [2023-05-25 0.29266343 0.075445496 0.5209091 0.60474426 0.54084337] [2023-05-26 0.3247312 0.047373593 0.5822009 0.71341187 0.56035644] [2023-05-29 0.3247312 0.07928248 0.66077644 0.71341187 0.5742507] [2023-05-30 0.35679835 0.10380831 0.7420027 0.8094255 0.59801495] [2023-05-31 0.29266343 0.9543182 0.22656727 0.46194157 0.58594936] [2023-06-05 0.34076512 0.194001 0.35005975 0.619705 0.596457] [2023-06-06 0.3247312 0.073469564 0.31787518 0.5493364 0.595669] [2023-06-07 0.30869764 0.09062554 0.28062242 0.48017353 0.5860401] [2023-06-08 0.31671444 0.043992016 0.25789145 0.5122754 0.5804172] [2023-06-09 0.30869764 0.03236076 0.30218345 0.4721508 0.5707818] [2023-06-12 0.3247312 0.023456374 0.34176728 0.54619104 0.5689354] [2023-06-13 0.3247312 0.033611704 0.39079583 0.54619104 0.5659972] [2023-06-14 0.30068088 0.06986912 0.33802256 0.40178978 0.55141425] [2023-06-15 0.29266343 0.051991705 0.29699636 0.3582686 0.5350891] [2023-06-16 0.29266343 0.12498806 0.22746344 0.3582686 0.52119285] [2023-06-19 0.2766302 0.015637357 0.20907785 0.26439166 0.5021429] [2023-06-20 0.29266343 0.046441298 0.17779441 0.3947301 0.49370247] [2023-06-21 0.31671444 0.029701583 0.25004944 0.5519594 0.49727857] [2023-06-22 0.29266343 0.037334494 0.21531647 0.3934025 0.48858225] [2023-06-23 0.29266343 0.036685232 0.18244053 0.3934025 0.48119304] [2023-06-26 0.30068088 0.02115568 0.25471136 0.45449853 0.47852007] [2023-06-27 0.3247312 0.020931646 0.32585886 0.6100812 0.48678756] [2023-07-03 0.30068088 0.11966793 0.22525027 0.4317534 0.48188668] [2023-07-04 0.29266343 0.01933323 0.29397446 0.38008556 0.47393948] [2023-07-05 0.29266343 0.03232922 0.2512074 0.38008556 0.46730408] [2023-07-06 0.30068088 0.043100234 0.35731098 0.44976535 0.46537995] [2023-07-07 0.28464663 0.022856867 0.313042 0.32492045 0.45634547] [2023-07-10 0.29266343 0.011084498 0.37447014 0.40074816 0.45266634] [2023-07-11 0.28464663 0.031097986 0.31619298 0.33594763 0.44600964] [2023-07-12 0.332748 0.055381436 0.44700193 0.67196107 0.46234968] [2023-07-13 0.31671444 0.06036292 0.56082076 0.5443459 0.46765956] [2023-07-14 0.34076512 0.04720856 0.6421643 0.6659702 0.48230532] [2023-07-17 0.332748 0.05671857 0.7199471 0.60139614 0.48966786] [2023-07-18 0.3247312 0.0436334 0.6093922 0.53664345 0.49124038] [2023-07-20 0.3247312 0.085166626 0.6093922 0.53664345 0.49186626] [2023-07-21 0.3247312 0.029690027 0.5184999 0.53664345 0.4917434] [2023-07-24 0.30869764 0.056053944 0.40702614 0.3844411 0.48381996] [2023-07-25 0.3247312 0.13862759 0.616418 0.5251796 0.48430586] [2023-07-26 0.38886613 0.12648247 0.74175584 0.8275153 0.51302075] [2023-07-27 0.34878156 0.0775155 0.8061254 0.5509234 0.5166254] [2023-07-28 0.31671444 0.07297745 0.66916144 0.3922785 0.5041236] [2023-07-31 0.31671444 0.08162042 0.5449228 0.3922785 0.4935758] [2023-08-01 0.31671444 0.039326463 0.4775191 0.3922785 0.4846791] [2023-08-02 0.34076512 0.054108195 0.5600671 0.53442687 0.48800045] [2023-08-03 0.35679835 0.059499957 0.6381277 0.6142116 0.49724853] [2023-08-04 0.3247312 0.043295313 0.55290496 0.41446507 0.48938903] [2023-08-07 0.3648158 0.047255866 0.62409985 0.6024416 0.50068474] [2023-08-08 0.34076512 0.03064924 0.55046594 0.47293693 0.49799785] [2023-08-09 0.40489972 0.07643937 0.65127057 0.69593763 0.5240708] [2023-08-10 0.40489972 0.07600612 0.73277104 0.69593763 0.543518] [2023-08-11 0.40489972 0.06534889 0.7936419 0.69593763 0.5575526] [2023-08-14 0.38886613 0.07431676 0.65126604 0.59039384 0.5599712] [2023-08-15 0.37283224 0.052305322 0.7126903 0.49290058 0.55326134] [2023-08-16 0.37283224 0.04433405 0.6170766 0.49290058 0.5466914] [2023-08-18 0.35679835 0.07952812 0.49494573 0.3914093 0.53309053] [2023-08-21 0.332748 0.0717034 0.40194082 0.2649003 0.5105287] [2023-08-22 0.37283224 0.060952503 0.50092566 0.50607485 0.5100643] [2023-08-23 0.37283224 0.05834947 0.58533126 0.50607485 0.5088799] [2023-08-24 0.34076512 0.04472271 0.50470155 0.32959026 0.49271423] [2023-08-25 0.3648158 0.04017284 0.5744493 0.4671979 0.49024892] [2023-08-28 0.34076512 0.03207623 0.5041436 0.34699535 0.47689956] [2023-08-29 0.35679835 0.033443 0.57199764 0.43784395 0.47321305] [2023-08-30 0.34076512 0.048122775 0.47961062 0.35582358 0.46270895] [2023-08-31 0.332748 0.1567141 0.31509438 0.31608412 0.4505905] [2023-09-01 0.34878156 0.028989786 0.38802078 0.4230011 0.4481683] [2023-09-04 0.34878156 0.026893415 0.38802078 0.4230011 0.44615534] [2023-09-05 0.34878156 0.02879199 0.38802078 0.4230011 0.44448584] [2023-09-06 0.3247312 0.038731035 0.31652224 0.26249933 0.43228167] [2023-09-07 0.332748 0.05516216 0.24213745 0.33525357 0.42639336] [2023-09-08 0.31671444 0.08143595 0.1662944 0.23661035 0.41469762] [2023-09-11 0.31671444 0.04394784 0.1662944 0.23661035 0.40580043] [2023-09-12 0.30869764 0.062059622 0.11123973 0.1858698 0.39558962] [2023-09-13 0.30068088 0.06615313 0.06633992 0.13769034 0.38446596] [2023-09-14 0.30869764 0.12497242 0.33607545 0.2438083 0.37996915] [2023-09-15 0.2766302 0.13618416 0.22362807 0.06677323 0.36267725] [2023-09-18 0.2766302 0.01827682 0.19747023 0.06677323 0.34998843] [2023-09-19 0.30068088 0.016990257 0.2683345 0.33970174 0.35187367] [2023-09-20 0.3247312 0.045510635 0.37770188 0.5279459 0.36515567] [2023-09-21 0.31671444 0.02688852 0.32762513 0.46289456 0.3727849] [2023-09-22 0.30068088 0.029387554 0.2787322 0.34507456 0.37229076] [2023-09-25 0.2766302 0.0479939 0.2213448 0.20750389 0.36182997] [2023-09-26 0.26059595 0.07166493 0.15932488 0.13500297 0.34728727] [2023-09-27 0.2365456 0.08634715 0.103865184 0.0474524 0.3261049] [2023-09-29 0.22051203 0.13340372 0.04718766 0 0.3035695] [2023-10-02 0.30068088 0.09901429 0.2401465 0.51639307 0.32352287] [2023-10-03 0.34076512 0.10542698 0.40166232 0.65377957 0.35849935] [2023-10-04 0.34076512 0.12473439 0.54497075 0.65377957 0.38680914] [2023-10-05 0.30068088 0.07072828 0.46005583 0.4509153 0.39153484] [2023-10-06 0.28464663 0.04420409 0.40342942 0.3832421 0.38855186] [2023-10-09 0.29266343 0.031194506 0.4649572 0.42315236 0.3903865] [2023-10-10 0.2525795 0.06951894 0.38413692 0.26133558 0.37432897] [2023-10-11 0.2525795 0.08629386 0.5017891 0.26133558 0.36247444] [2023-10-12 0.29266343 0.06829327 0.58711416 0.47483447 0.37208617] [2023-10-13 0.30068088 0.057251055 0.654271 0.51117593 0.38397637] [2023-10-16 0.30869764 0.0116931135 0.68439543 0.54889965 0.39751595] [2023-10-17 0.26059595 0.052716278 0.5837568 0.3127761 0.3869396] [2023-10-18 0.22852848 0.040907204 0.506723 0.20323405 0.3648051] [2023-10-19 0.19646169 0.09336818 0.39268392 0.116018154 0.3338676] [2023-10-20 0.26861274 0.059443403 0.49118167 0.4465531 0.3432848] [2023-10-23 0.22852848 0.040518817 0.42501965 0.32216346 0.3337046] [2023-10-24 0.20447814 0.07631213 0.33761063 0.25725806 0.31656498] [2023-10-25 0.2365456 0.046112724 0.4299278 0.38556677 0.31895167] [2023-10-26 0.18844491 0.057601243 0.3555023 0.25218987 0.30053306] [2023-10-27 0.18042763 0.04298917 0.30064934 0.23210223 0.28406185] [2023-10-30 0.22852848 0.04231965 0.39670002 0.42339933 0.29455778] [2023-10-31 0.19646169 0.059923418 0.32158136 0.32618868 0.28998598] [2023-11-01 0.14836033 0.06280541 0.25608632 0.20682101 0.26644537] [2023-11-02 0.22852848 0.04788338 0.3654282 0.47003603 0.28603396] [2023-11-03 0.24456239 0.053814832 0.47007212 0.5123403 0.31032893] [2023-11-06 0.29266343 0.08722969 0.5928557 0.6277113 0.3524649] [2023-11-07 0.26861274 0.054133072 0.498787 0.54534936 0.37562975] [2023-11-08 0.2766302 0.014955875 0.54605556 0.56691086 0.39809814] [2023-11-09 0.2766302 0.034324314 0.61163855 0.56691086 0.41615692] [2023-11-10 0.22051203 0.040683445 0.5218504 0.3613466 0.4053013] [2023-11-13 0.2365456 0 0.48636603 0.4216949 0.4043847] [2023-11-14 0.2525795 0.022251105 0.5529823 0.48150772 0.41126564] [2023-11-15 0.29266343 0.08720753 0.67956436 0.61246246 0.4350001] [2023-11-16 0.30068088 0.037909806 0.7378626 0.6362927 0.4572382] [2023-11-17 0.30068088 0.04924226 0.7973477 0.6362927 0.47444254] [2023-11-20 0.2365456 0.03859183 0.6824171 0.35170892 0.45864555] [2023-11-21 0.20447814 0.11798075 0.48946095 0.25316605 0.43160364] [2023-11-22 0.2365456 0.026559267 0.5509459 0.39180794 0.4249211] [2023-11-23 0.2525795 0.0471917 0.62889546 0.45498165 0.42705053] [2023-11-24 0.2525795 0.031000651 0.684176 0.45498165 0.42884427] [2023-11-27 0.2365456 0.020189263 0.6100811 0.38281852 0.42313915] [2023-11-28 0.2365456 0.065582715 0.48450044 0.38281852 0.41883928] [2023-11-29 0.24456239 0.046068136 0.5736409 0.4311723 0.419297] [2023-11-30 0.26861274 0.25079313 0.78720915 0.56236446 0.43069226] [2023-12-01 0.26059595 0.08121042 0.6550377 0.508767 0.4360964] [2023-12-04 0.26623482 0.046111364 0.7057246 0.5417958 0.44289023] [2023-12-05 0.25817934 0.099967115 0.56467164 0.479833 0.44453287] [2023-12-06 0.22595915 0.08295918 0.46403223 0.28040126 0.43124658] [2023-12-07 0.23401429 0.09583256 0.3704956 0.34285197 0.42453954] [2023-12-08 0.2098489 0.031353693 0.33005455 0.21777044 0.40856406] [2023-12-11 0.2098489 0.07859542 0.26405513 0.21777044 0.3963837] [2023-12-12 0.19373864 0.09075754 0.20214665 0.14053427 0.38006577] [2023-12-13 0.18568383 0.041779008 0.16982241 0.105263844 0.36431715] [2023-12-14 0.30651012 0.1284728 0.3654844 0.73565656 0.40719175] [2023-12-15 0.36289605 0.3455471 0.649678 0.8476671 0.46650887] [2023-12-18 0.35484126 0.12355087 0.7230081 0.80413747 0.5090333] [2023-12-19 0.37095118 0.06028625 0.76159734 0.836498 0.548791] [2023-12-20 0.38706145 0.0708403 0.80262554 0.86800903 0.5859279] [2023-12-21 0.39511624 0.0914745 0.8475699 0.88390076 0.6169633] [2023-12-22 0.39511624 0.0593008 0.8775793 0.88390076 0.63923997] [2023-12-27 0.4112265 0.05932133 0.9058826 0.91986287 0.6616502] [2023-12-28 0.41928196 0.06709711 0.9343229 0.9372507 0.680285] [2023-12-29 0.41928196 0.080309115 0.96326864 0.9372507 0.69212437] [2024-01-02 0.42733675 0.013210234 0.90365803 0.9574344 0.7021296] [2024-01-03 0.4031717 0.018726926 0.83499366 0.6990102 0.6960845] [2024-01-04 0.44344702 0.048496343 0.870814 0.8428879 0.70653206] [2024-01-05 0.47566754 0.08763194 0.9177989 0.91891134 0.7261574] [2024-01-08 0.47566754 0.040875666 0.9421655 0.91891134 0.73825014] [2024-01-09 0.4917778 0.053046074 0.9684274 0.95429736 0.75155324] [2024-01-10 0.46761242 0.043429896 0.84651726 0.7344982 0.74752855] [2024-01-11 0.47566754 0.025222542 0.87347126 0.7642421 0.7444734] [2024-01-12 0.5159429 0.06447179 0.91573083 0.882719 0.756712] [2024-01-15 0.523998 0.091858946 0.959955 0.9016913 0.7662942] [2024-01-16 0.5159429 0.032682672 0.853593 0.82568973 0.766436] [2024-01-17 0.5320531 0.11810487 0.91790676 0.87427986 0.77005464] [2024-01-18 0.5078881 0.06827207 0.7714312 0.6610012 0.7582317] [2024-01-19 0.4917778 0.057570115 0.65805024 0.54244685 0.7380702] [2024-01-22 0.4917778 0.043556865 0.57285976 0.54244685 0.71885514] [2024-01-23 0.48372233 0.09722746 0.44690737 0.4782006 0.6969755] [2024-01-24 0.4595573 0.08710979 0.3541127 0.31446844 0.6660082] [2024-01-25 0.45150214 0.057619326 0.29498044 0.26803327 0.6355234] [2024-01-26 0.4031717 0.07905015 0.23158062 0.07002415 0.5876397] [2024-01-29 0.46761242 0.07154 0.35699552 0.45929936 0.5774182] [2024-01-30 0.4998326 0.071109876 0.46582848 0.5830944 0.5823211] [2024-01-31 0.46761242 0.111137934 0.5907443 0.43893704 0.5700189] [2024-02-01 0.5159429 0.11335041 0.69042057 0.60627145 0.5806257] [2024-02-02 0.5159429 0.10671001 0.7664756 0.60627145 0.58731115] [2024-02-05 0.47566754 0.050510336 0.67754704 0.42675534 0.57272375] [2024-02-06 0.4917778 0.09084141 0.7479865 0.49120587 0.5670099] [2024-02-07 0.5159429 0.09804978 0.8105387 0.5808935 0.5719382] [2024-02-12 0.5481634 0.09124707 0.86052126 0.68235093 0.58877313] [2024-02-13 0.523998 0.06150688 0.74950826 0.5599095 0.58937067] [2024-02-15 0.56427366 0.1956504 0.84933245 0.6839991 0.6062388] [2024-02-16 0.5964942 0.16510177 0.91011006 0.76294893 0.63203746] [2024-02-19 0.5723288 0.044199873 0.82787883 0.6389126 0.63916475] [2024-02-20 0.6206596 0.058686476 0.86033183 0.7588156 0.66420627] [2024-02-21 0.6045493 0.07414847 0.74236286 0.678487 0.67399865] [2024-02-22 0.5723288 0.062649615 0.6474087 0.53201246 0.66448236] [2024-02-23 0.55621886 0.046716176 0.57454157 0.46549878 0.64719653] [2024-02-26 0.5481634 0.02790673 0.521786 0.43163362 0.6276451] [2024-02-27 0.5723288 0.031141896 0.5742634 0.5329091 0.62104106] [2024-02-28 0.6126041 0.04515392 0.6364079 0.66862065 0.63190585] [2024-02-29 0.5723288 0.14388654 0.46256086 0.48328322 0.62008476] [2024-03-01 0.55621886 0.041724764 0.40540183 0.41927448 0.60149914] [2024-03-04 0.5320531 0.0312603 0.3591872 0.3296256 0.5742003] [2024-03-05 0.5481634 0.055906717 0.455835 0.40483448 0.55851054] [2024-03-06 0.5964942 0.06717542 0.5525272 0.58881366 0.56659454] [2024-03-07 0.6528798 0.13260071 0.68242836 0.7352561 0.5968374] [2024-03-08 0.6609352 0.10891663 0.76601845 0.75304747 0.6223474] [2024-03-13 0.6126041 0.16421188 0.56528264 0.5328047 0.6184842] [2024-03-14 0.71732044 0.12214916 0.66437256 0.76328367 0.66052467] [2024-03-15 0.6609352 0.18127841 0.4937751 0.57460827 0.6655531] [2024-03-18 0.6609352 0.056574468 0.5535053 0.57460827 0.66690016] [2024-03-19 0.66899 0.04646128 0.4950194 0.59504986 0.6689724] [2024-03-20 0.6528798 0.061775096 0.4287119 0.5319728 0.6607145] [2024-03-21 0.6528798 0.09441453 0.5310142 0.5319728 0.65170723] [2024-03-22 0.6448246 0.09671034 0.4359246 0.4945837 0.6385905] [2024-03-25 0.71157455 0.06272846 0.5136056 0.70666933 0.6560667] [2024-03-26 0.7033337 0.061058674 0.4421156 0.6651717 0.6635659] [2024-03-27 0.71157455 0.025402801 0.49239895 0.68955046 0.67057985] [2024-03-28 0.71157455 0.07939327 0.58547395 0.68955046 0.6734252] [2024-04-01 0.6374081 0.0794191 0.4850684 0.33788013 0.6395965] [2024-04-02 0.6538895 0.07604011 0.4014368 0.40952885 0.6182126] [2024-04-03 0.53027874 0.21287367 0.2613564 0.10622057 0.5437796] [2024-04-04 0.6374081 0.07499389 0.36346638 0.4306982 0.5324676] [2024-04-05 0.62916756 0.06742881 0.4505983 0.41161385 0.5188206] [2024-04-16 0.51379704 0.35676566 0.25551692 0.1984455 0.4552902] [2024-04-17 0.53027874 0.101675645 0.35896236 0.2448316 0.41273618] [2024-04-18 0.51379704 0.14451568 0.28403306 0.21643433 0.3722677] [2024-04-19 0.51379704 0.17258826 0.2131238 0.21643433 0.3413113] [2024-04-22 0.4725937 0.14692731 0.16224068 0.13948451 0.29961827] [2024-04-23 0.5962047 0.2147967 0.35066515 0.49488106 0.32415655] [2024-04-24 0.6703709 0.15226266 0.46588126 0.6288056 0.37805513] [2024-04-25 0.6126858 0.11425497 0.39594123 0.49253398 0.39500824] [2024-04-26 0.5632416 0.108897194 0.33563626 0.39140984 0.38653076] [2024-04-29 0.6209267 0.09412103 0.42054906 0.5090975 0.40643483] [2024-04-30 0.6209267 0.12071075 0.51530313 0.5090975 0.4223895] [2024-05-02 0.5385193 0.10365864 0.4402664 0.33119947 0.39798397] [2024-05-03 0.6374081 0.082072295 0.51215893 0.5328632 0.42382035] [2024-05-06 0.6209267 0.043839492 0.55764323 0.49686146 0.43680793] [2024-05-07 0.5879639 0.062423676 0.49326316 0.42432845 0.43216398] [2024-05-08 0.48083422 0.12504175 0.39824367 0.23823461 0.38038328] [2024-05-13 0.53027874 0.169442 0.3002459 0.35253194 0.36272207] [2024-05-14 0.5385193 0.101325996 0.4048081 0.3715074 0.35345173] [2024-05-15 0.5220379 0.046103887 0.36400715 0.33793342 0.33973595] [2024-05-16 0.5550007 0.054782607 0.43389308 0.42589962 0.34494397] [2024-05-17 0.6044449 0.10742303 0.5381113 0.542559 0.37233576] [2024-05-20 0.51379704 0.09116645 0.4520935 0.33625114 0.35375306] [2024-05-21 0.48083422 0.074066624 0.38683304 0.2763426 0.32532102] [2024-05-22 0.49731594 0.13714582 0.51741046 0.32308477 0.31174687] [2024-05-27 0.45611227 0.14647937 0.40530017 0.24193121 0.28400913] [2024-05-28 0.45611227 0.07221006 0.48143497 0.24193121 0.26403278] [2024-05-29 0.40666807 0.13121723 0.38461998 0.14755617 0.22811455] [2024-05-30 0.3572235 0.25324416 0.25985947 0.07155913 0.18011542] [2024-05-31 0.43963087 1 0.71155703 0.34256417 0.1825328] [2024-06-03 0.44787142 0.06983378 0.7352802 0.36577544 0.19104698] [2024-06-04 0.4725937 0.074123316 0.7610336 0.4373755 0.21165778] [2024-06-05 0.5055568 0.08327797 0.7893037 0.52662396 0.24521956] [2024-06-06 0.51379704 0.032848656 0.8053064 0.5486743 0.2774201] [2024-06-07 0.46435282 0.041832432 0.7542998 0.39030695 0.28222862] [2024-06-10 0.53027874 0.03365534 0.77552694 0.5702502 0.31743908] [2024-06-11 0.45611227 0.06506654 0.6994024 0.37299457 0.31302446] [2024-06-12 0.43963087 0.039366294 0.64536405 0.3357112 0.30357376] [2024-06-13 0.42314914 0.08676477 0.7027075 0.297372 0.29028496] [2024-06-14 0.42314914 0.043717276 0.64008224 0.297372 0.28155744] [2024-06-19 0.3737049 0.107698314 0.53189135 0.18040295 0.25425267] [2024-06-20 0.49731594 0.08244532 0.6051126 0.54465073 0.2905808] [2024-06-21 0.5550007 0.19849473 0.72730947 0.6513557 0.34668228] [2024-06-24 0.5550007 0.0798862 0.77442396 0.6513557 0.39167768] [2024-06-25 0.5550007 0.08047986 0.6718825 0.6513557 0.42745897] [2024-06-26 0.5220379 0.077603586 0.5810528 0.53175485 0.4407799] [2024-06-27 0.6044449 0.09288015 0.65598804 0.71010685 0.48826936] [2024-06-28 0.66213036 0.19758542 0.767517 0.79790646 0.55086297] [2024-07-01 0.64564896 0.06499001 0.68043613 0.7369903 0.5912011] [2024-07-02 0.6538895 0.07887506 0.7343809 0.7514822 0.62476814] [2024-07-03 0.68685263 0.047624137 0.77040094 0.8083489 0.66377294] [2024-07-04 0.62916756 0.062841296 0.67487305 0.5832611 0.66580117] [2024-07-05 0.6703709 0.02191288 0.705116 0.67208326 0.6833367] [2024-07-08 0.7033337 0.0707934 0.76205033 0.73440427 0.70911366] [2024-07-09 0.71157455 0.055771183 0.8057886 0.74980026 0.72992873] [2024-07-10 0.71981543 0.056413785 0.84599096 0.7663789 0.74661905] [2024-07-11 0.71157455 0.04768966 0.742021 0.72324 0.7524707] [2024-07-12 0.71157455 0.056849618 0.7917996 0.72324 0.7534721] [2024-07-15 0.7033337 0.021553583 0.7220964 0.6708478 0.7469537] [2024-07-16 0.6703709 0.022247028 0.65296966 0.48431444 0.72349286] [2024-07-17 0.6209267 0.09494009 0.50826377 0.28645894 0.67960864] [2024-07-18 0.71981543 0.06056996 0.5946344 0.62154514 0.6869745] [2024-07-19 0.7280563 0.044932608 0.6583024 0.64142555 0.6936172] [2024-07-22 0.71981543 0.014216347 0.69362384 0.60547215 0.6922008] [2024-07-23 0.74453735 0.025140433 0.73701096 0.6750054 0.6993198] [2024-07-24 0.71157455 0.0052070143 0.68152535 0.5257947 0.6870864] [2024-07-25 0.78574103 0.105029896 0.7897378 0.7181689 0.7080395] [2024-07-26 0.7939819 0.074412465 0.8520393 0.7353163 0.7250874] [2024-07-29 0.76925963 0.06561249 0.7020063 0.6221334 0.7240477] [2024-07-30 0.74453735 0.015355003 0.6391033 0.5183377 0.70884866] [2024-07-31 0.7775005 0.08386606 0.7333368 0.6188744 0.7086883] [2024-08-01 0.8104633 0.05485085 0.7906408 0.70390254 0.7203121] [2024-08-02 0.75277823 0.04740622 0.67527884 0.4739875 0.7002436] [2024-08-05 0.64564896 0.1434204 0.47930512 0.21574174 0.6333232] [2024-08-06 0.68685263 0.07836582 0.57895297 0.34129128 0.59720945] [2024-08-07 0.71981543 0.042821553 0.6380606 0.43205273 0.58193505] [2024-08-08 0.7610191 0.045315694 0.6951257 0.5340258 0.58687025] [2024-08-09 0.73629683 0.035664167 0.6119721 0.46308106 0.57791567] [2024-08-12 0.75277823 0.026558315 0.54447585 0.5080412 0.5767229] [2024-08-13 0.78574103 0.046736293 0.62086654 0.5937272 0.58904165] [2024-08-14 0.75277823 0.036937542 0.53604054 0.4811355 0.58213884] [2024-08-15 0.7610191 0.017086506 0.5868615 0.506214 0.57879716] [2024-08-16 0.7939819 0.027057633 0.6461278 0.6027354 0.58940864] [2024-08-19 0.8104633 0.041091 0.7132858 0.6473091 0.6034144] [2024-08-20 0.82694507 0.0536657 0.78097373 0.6912824 0.6199201] [2024-08-21 0.82694507 0.08703203 0.85608643 0.6912824 0.63077927] [2024-08-22 0.7939819 0.048645608 0.72465485 0.51759154 0.6222572] [2024-08-23 0.7939819 0.035105713 0.7729015 0.51759154 0.61348104] [2024-08-26 0.7939819 0.019464144 0.69213194 0.51759154 0.60460603] [2024-08-27 0.75277823 0.05386146 0.568589 0.3096729 0.5772125] [2024-08-28 0.8022225 0.024010476 0.6267618 0.5403987 0.5764149] [2024-08-29 0.7610191 0.04374229 0.69881344 0.3704023 0.5556713] [2024-08-30 0.7939819 0.18702456 0.4306004 0.5001613 0.55291235] [2024-09-02 0.7775005 0.06957671 0.53460467 0.43309692 0.5420251] [2024-09-03 0.74453735 0.04094935 0.4639756 0.31347334 0.51747656] [2024-09-04 0.78574103 0.03261171 0.5303652 0.48083234 0.5158803] [2024-09-05 0.76925963 0.025156474 0.58601767 0.41736314 0.50632596] [2024-09-06 0.78574103 0.014565039 0.53064847 0.48389736 0.5054791] [2024-09-09 0.7775005 0.020877268 0.58784956 0.44682 0.50033885] [2024-09-10 0.8022225 0.04658132 0.66693157 0.55211735 0.5067269] [2024-09-11 0.82694507 0.059534214 0.7450698 0.64258534 0.5220746] [2024-09-12 0.84342617 0.067878105 0.81452256 0.69693184 0.5405583] [2024-09-13 0.82694507 0.06692379 0.6607935 0.5960581 0.54645497] [2024-09-17 0.851667 0.093688056 0.75656545 0.68634856 0.5609646] [2024-09-18 0.8928707 0.06062026 0.8131213 0.8020406 0.5894739] [2024-09-19 0.9835186 0.16321135 0.9042175 0.94921786 0.6508771] [2024-09-20 0.9423149 0.16498947 0.6577869 0.7483215 0.6780176] [2024-09-23 1 0.07031787 0.71892935 0.8428827 0.7225057] [2024-09-24 0.9505558 0.11468591 0.5727458 0.64781845 0.73186904] [2024-09-25 0.9670372 0.18697754 0.41078335 0.6820344 0.74327344] [2024-09-26 0.91759294 0.087183334 0.502455 0.5081557 0.7264798] [2024-09-27 0.90111125 0.09815024 0.4166019 0.45631287 0.7026186] [2024-09-30 0.7939819 0.16838464 0.31024235 0.20805313 0.63269967] [2024-10-01 0.86814845 0.05297688 0.38101062 0.41217563 0.60907733] [2024-10-02 0.851667 0.0896114 0.31665888 0.3758412 0.58120394] [2024-10-03 0.8351853 0.054457705 0.27502322 0.33814353 0.5503176] [2024-10-04 0.84342617 0.051213294 0.23691279 0.36459342 0.52854794] [2024-10-07 0.78574103 0.096573986 0.18351467 0.22987446 0.48450178] [2024-10-08 0.8187042 0.10711634 0.3289636 0.3425262 0.46429712] [2024-10-09 0.82694507 0.048949577 0.40380615 0.37037942 0.4518766] [2024-10-10 0.851667 0.0411258 0.46847823 0.4544046 0.45311302] [2024-10-11 0.8104633 0.03236035 0.41975877 0.32950723 0.43536803] [2024-10-14 0.851667 0.014832575 0.46499035 0.46786788 0.44003788] [2024-10-15 0.8928707 0.062271964 0.5553905 0.58191943 0.46221605] [2024-10-16 0.84342617 0.05767805 0.46789226 0.4238993 0.45706618] [2024-10-17 0.92583317 0.06275877 0.5602083 0.6225098 0.48989868] [2024-10-18 0.93407404 0.04822147 0.629493 0.63917714 0.51873976] [2024-10-21 0.9093521 0.021267967 0.5680375 0.5536635 0.5292914] [2024-10-22 0.851667 0.10055928 0.43308073 0.38444704 0.5105598] [2024-10-23 0.90111125 0.03816633 0.50692147 0.51743764 0.51730806] [2024-10-24 0.91759294 0.08770141 0.61915463 0.5578854 0.52910894] [2024-10-25 0.93407404 0.019058898 0.5619788 0.5990787 0.5447336] [2024-10-28 0.88462985 0.024787525 0.49976233 0.4344899 0.53350896] [2024-10-29 0.851667 0.03922274 0.42691574 0.34307194 0.50879335] [2024-10-30 0.8022225 0.12731907 0.29650152 0.22802918 0.4663726] [2024-10-31 0.76925963 0.10430301 0.21568474 0.1634369 0.41798064] [2024-11-01 0.82694507 0.03654453 0.30422467 0.36466694 0.40625444] [2024-11-04 0.8104633 0.038672987 0.3903434 0.32385474 0.39001265] [2024-11-05 0.851667 0.04006069 0.47234657 0.45402563 0.39637715] [2024-11-06 0.8351853 0.040099297 0.40464786 0.40492275 0.39442152] [2024-11-07 0.74453735 0.15055847 0.2696605 0.19665712 0.35259414] [2024-11-08 0.71157455 0.096979365 0.2017655 0.14099897 0.3059637] [2024-11-11 0.7033337 0.14665487 0.13016027 0.12709668 0.2672267] [2024-11-12 0.73629683 0.080954984 0.26494485 0.25930065 0.25365764] [2024-11-13 0.73629683 0.05723923 0.36005136 0.25930065 0.24512799] [2024-11-14 0.71981543 0.04833267 0.31025848 0.21573213 0.23322697] [2024-11-15 0.74453735 0.058143385 0.40712413 0.33027545 0.23736212] [2024-11-18 0.68685263 0.06102265 0.34160358 0.17624421 0.21693029] [2024-11-19 0.66213036 0.08763901 0.26870662 0.12414475 0.19231707] [2024-11-20 0.71157455 0.05132749 0.36409113 0.3358672 0.198084] [2024-11-21 0.653602 0.098359324 0.2811636 0.19887955 0.17924872] [2024-11-22 0.653602 0.051071506 0.23629743 0.19887955 0.16744106] [2024-11-25 0.7612655 0.19649392 0.47577834 0.54364634 0.20972355] [2024-11-26 0.703293 0.056392305 0.41278854 0.39272317 0.21936469] [2024-11-28 0.703293 0.049776517 0.35883638 0.39272317 0.22941045] [2024-11-29 0.703293 0.07620718 0.4628399 0.39272317 0.23965874] [2024-12-02 0.6204745 0.09115218 0.37502992 0.19493337 0.2126798] [2024-12-03 0.7695474 0.1430925 0.52934986 0.56661373 0.26119506] [2024-12-04 0.7695474 0.10474197 0.62419367 0.56661373 0.30122104] [2024-12-05 0.7861112 0.10342074 0.70342904 0.59974045 0.34159362] [2024-12-06 0.7281383 0.06446336 0.6135636 0.44174182 0.34823546] [2024-12-09 0.8192384 0.059312765 0.6706306 0.62468314 0.3954586] [2024-12-10 0.8192384 0.054924533 0.72127986 0.62468314 0.4329422] [2024-12-11 0.8440841 0.023255179 0.7515839 0.6713422 0.47354874] [2024-12-12 0.7612655 0.032561544 0.6750574 0.43924847 0.4676893] [2024-12-13 0.71985644 0.07381513 0.5601296 0.34882283 0.44412634] [2024-12-16 0.7364202 0.05018788 0.4823203 0.39375335 0.43304998] [2024-12-17 0.6701655 0.1074195 0.37024018 0.25527352 0.39461362] [2024-12-18 0.6370383 0.08705881 0.29386684 0.1973083 0.35008717] [2024-12-19 0.59562916 0.11341212 0.21895398 0.13161317 0.2975697] [2024-12-20 0.58734727 0.09617839 0.3574597 0.118746094 0.25429755] [2024-12-23 0.6287564 0.030538717 0.41765884 0.27267224 0.24112342] [2024-12-24 0.6204745 0.015753044 0.46294093 0.2539794 0.22931908] [2024-12-27 0.6370383 0.0043352135 0.43277675 0.31886008 0.22990327] [2024-12-30 0.59562916 0.04829012 0.36469814 0.2142416 0.21409851] [2025-01-02 0.6701655 0.02351415 0.43209055 0.46720126 0.23781012] [2025-01-03 0.653602 0.02866801 0.5030542 0.41908753 0.25121585] [2025-01-06 0.59562916 0.028230138 0.43860584 0.27267292 0.23775972] [2025-01-07 0.5459382 0.068638705 0.34378824 0.17546864 0.20713831] [2025-01-08 0.59562916 0.04773683 0.44895068 0.3401464 0.20814009] [2025-01-09 0.653602 0.029779749 0.5223963 0.49382654 0.23763338] [2025-01-10 0.6121929 0.07028729 0.41006538 0.39047337 0.24439014] [2025-01-13 0.59562916 0.09168304 0.30492005 0.35111576 0.24443702] [2025-01-14 0.5459382 0.068127565 0.23814191 0.24306515 0.22431877] [2025-01-15 0.6370383 0.07649538 0.38397387 0.4890064 0.25198823] [2025-01-16 0.6204745 0.076333605 0.5045164 0.4480546 0.2683331] [2025-01-17 0.6701655 0.06825059 0.59757394 0.56190866 0.30543444] [2025-01-20 0.5790654 0.12409328 0.44601062 0.35030878 0.29501787] [2025-01-21 0.56250197 0.14100006 0.32446185 0.31815898 0.28103304] [2025-01-22 0.5707835 0.09424515 0.44682696 0.34219053 0.27559242] [2025-01-23 0.5707835 0.13551818 0.5785625 0.34219053 0.27318123] [2025-01-24 0.48796532 0.17839669 0.42738637 0.16729344 0.23590201] [2025-01-30 0.4217109 0.18191597 0.31710067 0.07161662 0.17918321] [2025-01-31 0.5210929 0.12527816 0.43677747 0.36029607 0.18241833] [2025-02-03 0.48796532 0.09463272 0.36957884 0.2998211 0.17295846] [2025-02-04 0.4299928 0.100298546 0.30703393 0.2054263 0.14247969] [2025-02-05 0.41342902 0.105222665 0.2501826 0.18028873 0.1145148] [2025-02-06 0.35545614 0.20479785 0.17141548 0.09921475 0.07020367] [2025-02-07 0.48796532 0.14999172 0.32176778 0.43185925 0.09930938] [2025-02-10 0.4217109 0.075286984 0.27859613 0.321081 0.09615819] [2025-02-11 0.39686525 0.068461575 0.24049953 0.2826357 0.08640475] [2025-02-12 0.4217109 0.13641159 0.37845635 0.34268937 0.09395133] [2025-02-13 0.37201992 0.094632454 0.31859306 0.2565376 0.08142385] [2025-02-14 0.36373803 0.12975298 0.25163555 0.24246785 0.07194608] [2025-02-17 0.47968343 0.09280633 0.35630724 0.5162835 0.12086917] [2025-02-18 0.47140187 0.11757768 0.46894944 0.49724033 0.15908706] [2025-02-19 0.35545614 0.18163376 0.3560451 0.27730668 0.14003226] [2025-02-20 0.37201992 0.13381264 0.28585353 0.31697032 0.13595337] [2025-02-21 0.37201992 0.11585991 0.2317619 0.31697032 0.13620038] [2025-02-24 0.34717426 0.11922531 0.18332702 0.2671143 0.12865302] [2025-02-25 0.31404707 0.10979414 0.14343289 0.2039768 0.11135821] [2025-02-26 0.2974833 0.13188593 0.10337999 0.17334847 0.09407729] [2025-02-27 0.2146651 0.24356028 0.05112706 0.048783414 0.04718907] [2025-02-28 0.1815379 0.3701276 0 0.010224068 0] [2025-03-03 0.30576518 0.23398 0.19529235 0.38356856 0.023924025] [2025-03-04 0.32232895 0.14218359 0.30415562 0.42137706 0.054841183] [2025-03-05 0.37201992 0.18268012 0.42501518 0.52927005 0.10579252] [2025-03-06 0.36373803 0.10255846 0.4928025 0.5075354 0.14577116] [2025-03-07 0.34717426 0.083560735 0.44002056 0.4613786 0.17297044] [2025-03-10 0.34717426 0.10443719 0.38091156 0.4613786 0.1973013] [2025-03-11 0.34717426 0.12026568 0.47127262 0.4613786 0.21910752] [2025-03-12 0.41342902 0.091273576 0.53907 0.6529575 0.26850253] [2025-03-13 0.36373803 0.084560454 0.47288412 0.47682363 0.28677312] [2025-03-14 0.28920174 0.12312347 0.39418006 0.28654435 0.2692696] [2025-03-17 0.23951076 0.17745692 0.30580378 0.19230667 0.23511803] [2025-03-18 0.14012863 0.538983 0.15513146 0.05689959 0.16595085] [2025-03-19 0.14841051 0.26275077 0.3208134 0.08545094 0.11858782] [2025-03-20 0.16497412 0.1795662 0.42205447 0.14624731 0.09257443] [2025-03-21 0.08814426 0.4854361 0.27820298 0.041400954 0.04155647] [2025-03-24 0.10521756 0.42279425 0.19273931 0.105028614 0.013786746] [2025-03-25 0.13936417 0.15703288 0.2787004 0.2284281 0.012231074] [2025-03-26 0.30156055 0.35654637 0.43989787 0.60167366 0.088854834] [2025-03-27 0.29302388 0.13881955 0.43989787 0.5808933 0.14902557] [2025-04-08 0.045461003 0.69636106 0.2678629 0.19311179 0.08805595] [2025-04-09 0.09668091 0.15759324 0.3405556 0.28798312 0.06732575] [2025-04-10 0.19912073 0.1676458 0.41868463 0.45147237 0.10140784] [2025-04-11 0.21619403 0.083979025 0.38566902 0.47650698 0.13962989] [2025-04-14 0.25887728 0.08495279 0.43569764 0.54030186 0.19218463] [2025-04-15 0.31863385 0.08510572 0.48707542 0.622882 0.26305294] [2025-04-16 0.28448725 0.07619209 0.44291466 0.55215764 0.3052045] [2025-04-17 0.29302388 0.085253626 0.39571878 0.56613064 0.34358478] [2025-04-21 0.22473069 0.026992925 0.37259567 0.4211476 0.34399873] [2025-04-22 0.29302388 0.048544332 0.42340493 0.5467051 0.37612748] [2025-04-23 0.36985373 0.09720163 0.50513464 0.66045207 0.43657944] [2025-04-24 0.28448725 0.16700238 0.3975562 0.48410004 0.44554314] [2025-04-25 0.3271705 0.05093679 0.45228645 0.5525277 0.47168848] [2025-04-28 0.38692704 0.071244456 0.51984704 0.6395071 0.5186804] [2025-04-29 0.36985373 0.053681064 0.57317114 0.59951675 0.5468955] [2025-04-30 0.40400034 0.19544458 0.6957011 0.65326774 0.5831272] [2025-05-02 0.45522025 0.09705128 0.75162315 0.7269789 0.6329101] [2025-05-05 0.45522025 0.0891212 0.79891217 0.7269789 0.6696931] [2025-05-06 0.47229356 0.038108554 0.824316 0.7538177 0.7035551] [2025-05-07 0.48936686 0.07688146 0.86269534 0.7813249 0.73474264] [2025-05-08 0.45522025 0.10710493 0.71628994 0.6473987 0.74042994] [2025-05-09 0.46375692 0.035807043 0.6530983 0.66654295 0.74528146] [2025-05-14 0.5576601 0.17424487 0.7619466 0.83078545 0.78783864] [2025-05-15 0.5576601 0.10953395 0.8196931 0.83078545 0.817195] [2025-05-16 0.56619674 0.05734037 0.72875786 0.84420484 0.83971584] [2025-05-19 0.63448995 0.123394534 0.7990508 0.9344922 0.88351566] [2025-05-20 0.6259533 0.1900304 0.87667954 0.8916715 0.9089136] [2025-05-21 0.70278317 0.20243436 0.9360439 0.9757425 0.95802057] [2025-05-22 0.68570983 0.11186088 0.9647971 0.8942256 0.98288596] [2025-05-23 0.6942465 0.037648115 0.89238316 0.90538406 1] [2025-05-26 0.6771732 0.048664235 0.80918527 0.8137262 0.99932134] [2025-05-27 0.6174166 0.09840119 0.68407094 0.5505729 0.9655024] [2025-05-28 0.60034335 0.29380363 0.45455608 0.48865008 0.92531204] [2025-06-02 0.49790353 0.33115783 0.30122718 0.22158384 0.84217215] [2025-06-03 0.48083022 0.14612538 0.24560517 0.18919656 0.7647456] [2025-06-04 0.45522025 0.09859858 0.20867741 0.14140911 0.68883604] [2025-06-05 0.43814695 0.10155098 0.17335205 0.11032122 0.6188216] [2025-06-10 0.49790353 0.08099291 0.26111045 0.34543625 0.588798] [2025-06-11 0.48083022 0.04867416 0.3218541 0.30161166 0.55587417] [2025-06-12 0.50644016 0.02788131 0.36702123 0.39464492 0.54026115] [2025-06-13 0.47229356 0.08495102 0.31006894 0.2974013 0.5114977] [2025-06-16 0.43814695 0.050295137 0.27321342 0.21355034 0.4727589] [2025-06-17 0.48936686 0.04635674 0.34610116 0.4033243 0.46506193] [2025-06-18 0.4296103 0.08896432 0.2829182 0.25570115 0.4318327] [2025-06-19 0.38692704 0.0789172 0.23238136 0.17271574 0.3866614] [2025-06-20 0.3613171 0.5778754 0.06883671 0.12796694 0.34033173] [2025-06-23 0.33570716 0.09039757 0.049971875 0.08544214 0.29362243] [2025-06-24 0.38692704 0.12143927 0.17783417 0.28737274 0.28172222] [2025-06-25 0.3271705 0.13150188 0.13821943 0.1690252 0.2472892] [2025-06-26 0.3442438 0.1311222 0.1031674 0.23186123 0.23016883] [2025-06-30 0.35278046 0.2237809 0.298509 0.2647884 0.22296606] [2025-07-01 0.3613171 0.083654806 0.37309957 0.30013818 0.22361556] [2025-07-02 0.35278046 0.06486834 0.33343014 0.2744872 0.22272658] [2025-07-03 0.3271705 0.040161695 0.38372484 0.19998842 0.2129592] [2025-07-04 0.3442438 0.030948177 0.3534078 0.2888058 0.21555501] [2025-07-07 0.33570716 0.03957184 0.3183811 0.25940478 0.21628277] [2025-07-08 0.29302388 0.26479372 0.1991748 0.13303901 0.20017236] [2025-07-09 0.29302388 0.10009681 0.15956393 0.13303901 0.19026113] [2025-07-10 0.3271705 0.123628624 0.29611173 0.33609912 0.20068604] [2025-07-11 0.33570716 0.15655002 0.43555087 0.38121715 0.21540031] [2025-07-14 0.30156055 0.14188111 0.3509945 0.24630478 0.21409963] [2025-07-15 0.3100972 0.076660275 0.30443126 0.29701236 0.21947432] [2025-07-16 0.30156055 0.10419684 0.30443126 0.26169458 0.22233458] [2025-07-17 0.30156055 0.0886193 0.24957572 0.26169458 0.22703385] [2025-07-18 0.26741394 0.081027985 0.20387325 0.12567143 0.2177541] [2025-07-21 0.27595058 0.10135319 0.15627544 0.19417772 0.2168357] [2025-07-22 0.25887728 0.0776967 0.12195585 0.12866895 0.21095403] [2025-07-23 0.26741394 0.06816413 0.23264195 0.20266365 0.21277544] [2025-07-24 0.29302388 0.15963632 0.41289142 0.39573213 0.22829446] [2025-07-25 0.27595058 0.051461253 0.36440468 0.303772 0.23516048] [2025-07-28 0.29302388 0.106927924 0.48038673 0.42091402 0.25053516] [2025-07-29 0.25887728 0.11339337 0.38746068 0.25069466 0.24935149] [2025-07-30 0.25034064 0.105043486 0.31370127 0.21518968 0.24673297] [2025-07-31 0.21619403 0.25173685 0.19928597 0.09567603 0.23149538] [2025-08-01 0.22473069 0.08886359 0.30271515 0.16307425 0.2257526] [2025-08-04 0.21619403 0.038372282 0.27320248 0.13151638 0.21983108] [2025-08-05 0.26741394 0.06613369 0.3601216 0.46744114 0.240728] [2025-08-06 0.22473069 0.048256543 0.31784847 0.28592062 0.24014106] [2025-08-07 0.22473069 0.030986242 0.2857229 0.28592062 0.24193661] [2025-08-08 0.22473069 0.064642124 0.3831313 0.28592062 0.24557832]]
|
| 17 |
+
|
| 18 |
+
[ -- fmt.Println(len(data)) -- ]
|
| 19 |
+
576
|
| 20 |
+
|
| 21 |
+
[ -- fmt.Println(scalers) -- ]
|
| 22 |
+
{map[Close:7641.865 MACD:-227.40883 MFI:11.185383 RSI:20.973848 Volume:2.08277e+07] map[Close:10570.414 MACD:291.72772 MFI:87.80657 RSI:86.10713 Volume:7.564316e+08]}
|
| 23 |
+
|
| 24 |
+
[ -- fmt.Println(errors) -- ]
|
| 25 |
+
[]
|
| 26 |
+
|
| 27 |
+
[ Time ] Get Actuals Data : 0.000005600 s
|
| 28 |
+
|
| 29 |
+
[ -- fmt.Println(actuals) -- ]
|
| 30 |
+
[{2025-06-30 8675} {2025-07-01 8700} {2025-07-02 8675} {2025-07-03 8600} {2025-07-04 8650} {2025-07-07 8625} {2025-07-08 8500} {2025-07-09 8500} {2025-07-10 8600} {2025-07-11 8625} {2025-07-14 8525} {2025-07-15 8550} {2025-07-16 8525} {2025-07-17 8525} {2025-07-18 8425} {2025-07-21 8450} {2025-07-22 8400} {2025-07-23 8425} {2025-07-24 8500} {2025-07-25 8450} {2025-07-28 8500} {2025-07-29 8400} {2025-07-30 8375} {2025-07-31 8275} {2025-08-01 8300} {2025-08-04 8275} {2025-08-05 8425} {2025-08-06 8300} {2025-08-07 8300} {2025-08-08 8300}]
|
| 31 |
+
|
| 32 |
+
[ -- fmt.Println(len(actuals)) -- ]
|
| 33 |
+
30
|
| 34 |
+
|
| 35 |
+
[ -- fmt.Println(lastSequenceData) -- ]
|
| 36 |
+
[[2025-05-08 0.45522025 0.10710493 0.71628994 0.6473987 0.74042994] [2025-05-09 0.46375692 0.035807043 0.6530983 0.66654295 0.74528146] [2025-05-14 0.5576601 0.17424487 0.7619466 0.83078545 0.78783864] [2025-05-15 0.5576601 0.10953395 0.8196931 0.83078545 0.817195] [2025-05-16 0.56619674 0.05734037 0.72875786 0.84420484 0.83971584] [2025-05-19 0.63448995 0.123394534 0.7990508 0.9344922 0.88351566] [2025-05-20 0.6259533 0.1900304 0.87667954 0.8916715 0.9089136] [2025-05-21 0.70278317 0.20243436 0.9360439 0.9757425 0.95802057] [2025-05-22 0.68570983 0.11186088 0.9647971 0.8942256 0.98288596] [2025-05-23 0.6942465 0.037648115 0.89238316 0.90538406 1] [2025-05-26 0.6771732 0.048664235 0.80918527 0.8137262 0.99932134] [2025-05-27 0.6174166 0.09840119 0.68407094 0.5505729 0.9655024] [2025-05-28 0.60034335 0.29380363 0.45455608 0.48865008 0.92531204] [2025-06-02 0.49790353 0.33115783 0.30122718 0.22158384 0.84217215] [2025-06-03 0.48083022 0.14612538 0.24560517 0.18919656 0.7647456] [2025-06-04 0.45522025 0.09859858 0.20867741 0.14140911 0.68883604] [2025-06-05 0.43814695 0.10155098 0.17335205 0.11032122 0.6188216] [2025-06-10 0.49790353 0.08099291 0.26111045 0.34543625 0.588798] [2025-06-11 0.48083022 0.04867416 0.3218541 0.30161166 0.55587417] [2025-06-12 0.50644016 0.02788131 0.36702123 0.39464492 0.54026115] [2025-06-13 0.47229356 0.08495102 0.31006894 0.2974013 0.5114977] [2025-06-16 0.43814695 0.050295137 0.27321342 0.21355034 0.4727589] [2025-06-17 0.48936686 0.04635674 0.34610116 0.4033243 0.46506193] [2025-06-18 0.4296103 0.08896432 0.2829182 0.25570115 0.4318327] [2025-06-19 0.38692704 0.0789172 0.23238136 0.17271574 0.3866614] [2025-06-20 0.3613171 0.5778754 0.06883671 0.12796694 0.34033173] [2025-06-23 0.33570716 0.09039757 0.049971875 0.08544214 0.29362243] [2025-06-24 0.38692704 0.12143927 0.17783417 0.28737274 0.28172222] [2025-06-25 0.3271705 0.13150188 0.13821943 0.1690252 0.2472892] [2025-06-26 0.3442438 0.1311222 0.1031674 0.23186123 0.23016883] [2025-06-30 0.35278046 0.2237809 0.298509 0.2647884 0.22296606] [2025-07-01 0.3613171 0.083654806 0.37309957 0.30013818 0.22361556] [2025-07-02 0.35278046 0.06486834 0.33343014 0.2744872 0.22272658] [2025-07-03 0.3271705 0.040161695 0.38372484 0.19998842 0.2129592] [2025-07-04 0.3442438 0.030948177 0.3534078 0.2888058 0.21555501] [2025-07-07 0.33570716 0.03957184 0.3183811 0.25940478 0.21628277] [2025-07-08 0.29302388 0.26479372 0.1991748 0.13303901 0.20017236] [2025-07-09 0.29302388 0.10009681 0.15956393 0.13303901 0.19026113] [2025-07-10 0.3271705 0.123628624 0.29611173 0.33609912 0.20068604] [2025-07-11 0.33570716 0.15655002 0.43555087 0.38121715 0.21540031] [2025-07-14 0.30156055 0.14188111 0.3509945 0.24630478 0.21409963] [2025-07-15 0.3100972 0.076660275 0.30443126 0.29701236 0.21947432] [2025-07-16 0.30156055 0.10419684 0.30443126 0.26169458 0.22233458] [2025-07-17 0.30156055 0.0886193 0.24957572 0.26169458 0.22703385] [2025-07-18 0.26741394 0.081027985 0.20387325 0.12567143 0.2177541] [2025-07-21 0.27595058 0.10135319 0.15627544 0.19417772 0.2168357] [2025-07-22 0.25887728 0.0776967 0.12195585 0.12866895 0.21095403] [2025-07-23 0.26741394 0.06816413 0.23264195 0.20266365 0.21277544] [2025-07-24 0.29302388 0.15963632 0.41289142 0.39573213 0.22829446] [2025-07-25 0.27595058 0.051461253 0.36440468 0.303772 0.23516048] [2025-07-28 0.29302388 0.106927924 0.48038673 0.42091402 0.25053516] [2025-07-29 0.25887728 0.11339337 0.38746068 0.25069466 0.24935149] [2025-07-30 0.25034064 0.105043486 0.31370127 0.21518968 0.24673297] [2025-07-31 0.21619403 0.25173685 0.19928597 0.09567603 0.23149538] [2025-08-01 0.22473069 0.08886359 0.30271515 0.16307425 0.2257526] [2025-08-04 0.21619403 0.038372282 0.27320248 0.13151638 0.21983108] [2025-08-05 0.26741394 0.06613369 0.3601216 0.46744114 0.240728] [2025-08-06 0.22473069 0.048256543 0.31784847 0.28592062 0.24014106] [2025-08-07 0.22473069 0.030986242 0.2857229 0.28592062 0.24193661] [2025-08-08 0.22473069 0.064642124 0.3831313 0.28592062 0.24557832]]
|
| 37 |
+
|
| 38 |
+
[ -- fmt.Println(len(lastSequenceData)) -- ]
|
| 39 |
+
60
|
| 40 |
+
|
| 41 |
+
[ Time ] Get Input Data : 0.000033700 s
|
| 42 |
+
|
| 43 |
+
[ -- fmt.Println(inputData) -- ]
|
| 44 |
+
[0.45522025 0.10710493 0.71628994 0.6473987 0.74042994 0.46375692 0.035807043 0.6530983 0.66654295 0.74528146 0.5576601 0.17424487 0.7619466 0.83078545 0.78783864 0.5576601 0.10953395 0.8196931 0.83078545 0.817195 0.56619674 0.05734037 0.72875786 0.84420484 0.83971584 0.63448995 0.123394534 0.7990508 0.9344922 0.88351566 0.6259533 0.1900304 0.87667954 0.8916715 0.9089136 0.70278317 0.20243436 0.9360439 0.9757425 0.95802057 0.68570983 0.11186088 0.9647971 0.8942256 0.98288596 0.6942465 0.037648115 0.89238316 0.90538406 1 0.6771732 0.048664235 0.80918527 0.8137262 0.99932134 0.6174166 0.09840119 0.68407094 0.5505729 0.9655024 0.60034335 0.29380363 0.45455608 0.48865008 0.92531204 0.49790353 0.33115783 0.30122718 0.22158384 0.84217215 0.48083022 0.14612538 0.24560517 0.18919656 0.7647456 0.45522025 0.09859858 0.20867741 0.14140911 0.68883604 0.43814695 0.10155098 0.17335205 0.11032122 0.6188216 0.49790353 0.08099291 0.26111045 0.34543625 0.588798 0.48083022 0.04867416 0.3218541 0.30161166 0.55587417 0.50644016 0.02788131 0.36702123 0.39464492 0.54026115 0.47229356 0.08495102 0.31006894 0.2974013 0.5114977 0.43814695 0.050295137 0.27321342 0.21355034 0.4727589 0.48936686 0.04635674 0.34610116 0.4033243 0.46506193 0.4296103 0.08896432 0.2829182 0.25570115 0.4318327 0.38692704 0.0789172 0.23238136 0.17271574 0.3866614 0.3613171 0.5778754 0.06883671 0.12796694 0.34033173 0.33570716 0.09039757 0.049971875 0.08544214 0.29362243 0.38692704 0.12143927 0.17783417 0.28737274 0.28172222 0.3271705 0.13150188 0.13821943 0.1690252 0.2472892 0.3442438 0.1311222 0.1031674 0.23186123 0.23016883 0.35278046 0.2237809 0.298509 0.2647884 0.22296606 0.3613171 0.083654806 0.37309957 0.30013818 0.22361556 0.35278046 0.06486834 0.33343014 0.2744872 0.22272658 0.3271705 0.040161695 0.38372484 0.19998842 0.2129592 0.3442438 0.030948177 0.3534078 0.2888058 0.21555501 0.33570716 0.03957184 0.3183811 0.25940478 0.21628277 0.29302388 0.26479372 0.1991748 0.13303901 0.20017236 0.29302388 0.10009681 0.15956393 0.13303901 0.19026113 0.3271705 0.123628624 0.29611173 0.33609912 0.20068604 0.33570716 0.15655002 0.43555087 0.38121715 0.21540031 0.30156055 0.14188111 0.3509945 0.24630478 0.21409963 0.3100972 0.076660275 0.30443126 0.29701236 0.21947432 0.30156055 0.10419684 0.30443126 0.26169458 0.22233458 0.30156055 0.0886193 0.24957572 0.26169458 0.22703385 0.26741394 0.081027985 0.20387325 0.12567143 0.2177541 0.27595058 0.10135319 0.15627544 0.19417772 0.2168357 0.25887728 0.0776967 0.12195585 0.12866895 0.21095403 0.26741394 0.06816413 0.23264195 0.20266365 0.21277544 0.29302388 0.15963632 0.41289142 0.39573213 0.22829446 0.27595058 0.051461253 0.36440468 0.303772 0.23516048 0.29302388 0.106927924 0.48038673 0.42091402 0.25053516 0.25887728 0.11339337 0.38746068 0.25069466 0.24935149 0.25034064 0.105043486 0.31370127 0.21518968 0.24673297 0.21619403 0.25173685 0.19928597 0.09567603 0.23149538 0.22473069 0.08886359 0.30271515 0.16307425 0.2257526 0.21619403 0.038372282 0.27320248 0.13151638 0.21983108 0.26741394 0.06613369 0.3601216 0.46744114 0.240728 0.22473069 0.048256543 0.31784847 0.28592062 0.24014106 0.22473069 0.030986242 0.2857229 0.28592062 0.24193661 0.22473069 0.064642124 0.3831313 0.28592062 0.24557832]
|
| 45 |
+
|
| 46 |
+
[ -- fmt.Println(len(inputData)) -- ]
|
| 47 |
+
300
|
| 48 |
+
|
| 49 |
+
[ Time ] Get Input Tensor : 0.045372100 s
|
| 50 |
+
|
| 51 |
+
[ -- fmt.Println(inputTensor) -- ]
|
| 52 |
+
&{[1 60 5] [0.45522025 0.10710493 0.71628994 0.6473987 0.74042994 0.46375692 0.035807043 0.6530983 0.66654295 0.74528146 0.5576601 0.17424487 0.7619466 0.83078545 0.78783864 0.5576601 0.10953395 0.8196931 0.83078545 0.817195 0.56619674 0.05734037 0.72875786 0.84420484 0.83971584 0.63448995 0.123394534 0.7990508 0.9344922 0.88351566 0.6259533 0.1900304 0.87667954 0.8916715 0.9089136 0.70278317 0.20243436 0.9360439 0.9757425 0.95802057 0.68570983 0.11186088 0.9647971 0.8942256 0.98288596 0.6942465 0.037648115 0.89238316 0.90538406 1 0.6771732 0.048664235 0.80918527 0.8137262 0.99932134 0.6174166 0.09840119 0.68407094 0.5505729 0.9655024 0.60034335 0.29380363 0.45455608 0.48865008 0.92531204 0.49790353 0.33115783 0.30122718 0.22158384 0.84217215 0.48083022 0.14612538 0.24560517 0.18919656 0.7647456 0.45522025 0.09859858 0.20867741 0.14140911 0.68883604 0.43814695 0.10155098 0.17335205 0.11032122 0.6188216 0.49790353 0.08099291 0.26111045 0.34543625 0.588798 0.48083022 0.04867416 0.3218541 0.30161166 0.55587417 0.50644016 0.02788131 0.36702123 0.39464492 0.54026115 0.47229356 0.08495102 0.31006894 0.2974013 0.5114977 0.43814695 0.050295137 0.27321342 0.21355034 0.4727589 0.48936686 0.04635674 0.34610116 0.4033243 0.46506193 0.4296103 0.08896432 0.2829182 0.25570115 0.4318327 0.38692704 0.0789172 0.23238136 0.17271574 0.3866614 0.3613171 0.5778754 0.06883671 0.12796694 0.34033173 0.33570716 0.09039757 0.049971875 0.08544214 0.29362243 0.38692704 0.12143927 0.17783417 0.28737274 0.28172222 0.3271705 0.13150188 0.13821943 0.1690252 0.2472892 0.3442438 0.1311222 0.1031674 0.23186123 0.23016883 0.35278046 0.2237809 0.298509 0.2647884 0.22296606 0.3613171 0.083654806 0.37309957 0.30013818 0.22361556 0.35278046 0.06486834 0.33343014 0.2744872 0.22272658 0.3271705 0.040161695 0.38372484 0.19998842 0.2129592 0.3442438 0.030948177 0.3534078 0.2888058 0.21555501 0.33570716 0.03957184 0.3183811 0.25940478 0.21628277 0.29302388 0.26479372 0.1991748 0.13303901 0.20017236 0.29302388 0.10009681 0.15956393 0.13303901 0.19026113 0.3271705 0.123628624 0.29611173 0.33609912 0.20068604 0.33570716 0.15655002 0.43555087 0.38121715 0.21540031 0.30156055 0.14188111 0.3509945 0.24630478 0.21409963 0.3100972 0.076660275 0.30443126 0.29701236 0.21947432 0.30156055 0.10419684 0.30443126 0.26169458 0.22233458 0.30156055 0.0886193 0.24957572 0.26169458 0.22703385 0.26741394 0.081027985 0.20387325 0.12567143 0.2177541 0.27595058 0.10135319 0.15627544 0.19417772 0.2168357 0.25887728 0.0776967 0.12195585 0.12866895 0.21095403 0.26741394 0.06816413 0.23264195 0.20266365 0.21277544 0.29302388 0.15963632 0.41289142 0.39573213 0.22829446 0.27595058 0.051461253 0.36440468 0.303772 0.23516048 0.29302388 0.106927924 0.48038673 0.42091402 0.25053516 0.25887728 0.11339337 0.38746068 0.25069466 0.24935149 0.25034064 0.105043486 0.31370127 0.21518968 0.24673297 0.21619403 0.25173685 0.19928597 0.09567603 0.23149538 0.22473069 0.08886359 0.30271515 0.16307425 0.2257526 0.21619403 0.038372282 0.27320248 0.13151638 0.21983108 0.26741394 0.06613369 0.3601216 0.46744114 0.240728 0.22473069 0.048256543 0.31784847 0.28592062 0.24014106 0.22473069 0.030986242 0.2857229 0.28592062 0.24193661 0.22473069 0.064642124 0.3831313 0.28592062 0.24557832] 1200 0x7f1d64000d30}
|
| 53 |
+
|
| 54 |
+
[ Time ] Get Output Tensor : 0.000009200 s
|
| 55 |
+
|
| 56 |
+
[ -- fmt.Println(outputTensor) -- ]
|
| 57 |
+
&{[1 1] [0] 4 0x7f1d64000e50}
|
| 58 |
+
|
| 59 |
+
[Tag: Before Session] Alloc = 1 MB | TotalAlloc = 1 MB | Sys = 7 MB | NumGC = 0
|
| 60 |
+
[Tag: After Session] Alloc = 1 MB | TotalAlloc = 1 MB | Sys = 7 MB | NumGC = 0
|
| 61 |
+
[ Time ] Get Session : 15.745096400 s
|
| 62 |
+
|
| 63 |
+
[ -- fmt.Println(session) -- ]
|
| 64 |
+
&{0x7f1d64001280 [0x7f1d64000f30] [0x7f1d64000f50] [0x7f1d64000d30] [0x7f1d64000e50]}
|
| 65 |
+
|
| 66 |
+
[ Time ] Get Predicted Data : 0.392711200 s
|
| 67 |
+
|
| 68 |
+
[ -- fmt.Println(predicted) -- ]
|
| 69 |
+
[{2025-08-09 8232.763} {2025-08-10 8219.98} {2025-08-11 8210.573} {2025-08-12 8203.26} {2025-08-13 8197.979} {2025-08-14 8194.418} {2025-08-15 8192.1875} {2025-08-16 8190.914} {2025-08-17 8190.288} {2025-08-18 8190.0767} {2025-08-19 8190.112} {2025-08-20 8190.2793}]
|
| 70 |
+
|
| 71 |
+
[ -- fmt.Println(len(predicted)) -- ]
|
| 72 |
+
12
|
| 73 |
+
|
handlers/inference_handler.go
CHANGED
|
@@ -1 +1,47 @@
|
|
| 1 |
package handlers
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
package handlers
|
| 2 |
+
|
| 3 |
+
import (
|
| 4 |
+
"github.com/gofiber/fiber/v2"
|
| 5 |
+
inferences "thesis_forecasting_website/inferences"
|
| 6 |
+
)
|
| 7 |
+
|
| 8 |
+
type StockRequest struct {
|
| 9 |
+
Issuer string `json:"issuer"`
|
| 10 |
+
Days int `json:"days"`
|
| 11 |
+
}
|
| 12 |
+
|
| 13 |
+
type StockResponse struct {
|
| 14 |
+
Actuals []inferences.StockPrice `json:"actuals"`
|
| 15 |
+
Prediction []inferences.StockPrice `json:"predictions"`
|
| 16 |
+
}
|
| 17 |
+
|
| 18 |
+
func InferenceHandler(context *fiber.Ctx) error {
|
| 19 |
+
request := new(StockRequest)
|
| 20 |
+
if err := context.BodyParser(request); err != nil {
|
| 21 |
+
return context.Status(fiber.StatusBadRequest).JSON(fiber.Map{
|
| 22 |
+
"error": "Invalid request body",
|
| 23 |
+
})
|
| 24 |
+
}
|
| 25 |
+
|
| 26 |
+
if request.Days <= 0 { request.Days = 7 }
|
| 27 |
+
if request.Days > 60 { request.Days = 60 }
|
| 28 |
+
|
| 29 |
+
// actuals, predicted, err := inferences.StockPredictionDebug(
|
| 30 |
+
// request.Issuer, request.Days,
|
| 31 |
+
// )
|
| 32 |
+
|
| 33 |
+
actuals, predicted, err := inferences.StockPrediction(
|
| 34 |
+
request.Issuer, request.Days,
|
| 35 |
+
)
|
| 36 |
+
|
| 37 |
+
if err != nil {
|
| 38 |
+
return context.Status(fiber.StatusInternalServerError).JSON(fiber.Map{
|
| 39 |
+
"error": "Internal server error",
|
| 40 |
+
})
|
| 41 |
+
}
|
| 42 |
+
|
| 43 |
+
return context.Status(fiber.StatusOK).JSON(StockResponse{
|
| 44 |
+
Actuals: actuals,
|
| 45 |
+
Prediction: predicted,
|
| 46 |
+
})
|
| 47 |
+
}
|
handlers/infograpic_handler.go
CHANGED
|
@@ -9,11 +9,9 @@ import (
|
|
| 9 |
loaders "thesis_forecasting_website/loaders"
|
| 10 |
)
|
| 11 |
|
| 12 |
-
func InfographicHandler(
|
| 13 |
-
issuer_name :=
|
| 14 |
-
if issuer_name == "" {
|
| 15 |
-
return c.Redirect("/")
|
| 16 |
-
}
|
| 17 |
|
| 18 |
// json validation
|
| 19 |
fundamental_json := fmt.Sprintf("./indonesia_stocks/fundamentals/%s.json", issuer_name)
|
|
@@ -40,9 +38,7 @@ func InfographicHandler(c *fiber.Ctx) error {
|
|
| 40 |
waitgroup_validate.Wait()
|
| 41 |
|
| 42 |
for i := 0; i < len(json_paths); i++ {
|
| 43 |
-
if err := <-err_channel; err != nil {
|
| 44 |
-
return c.Redirect("/")
|
| 45 |
-
}
|
| 46 |
}
|
| 47 |
|
| 48 |
// load infographics (fundamental, historical, indicator)
|
|
@@ -99,7 +95,7 @@ func InfographicHandler(c *fiber.Ctx) error {
|
|
| 99 |
|
| 100 |
if len(errors) > 0 {
|
| 101 |
for _, err := range errors { println(err.Error()) }
|
| 102 |
-
return
|
| 103 |
}
|
| 104 |
|
| 105 |
data := fiber.Map{
|
|
@@ -108,5 +104,5 @@ func InfographicHandler(c *fiber.Ctx) error {
|
|
| 108 |
"Technicals": indicators,
|
| 109 |
}
|
| 110 |
|
| 111 |
-
return
|
| 112 |
}
|
|
|
|
| 9 |
loaders "thesis_forecasting_website/loaders"
|
| 10 |
)
|
| 11 |
|
| 12 |
+
func InfographicHandler(context *fiber.Ctx) error {
|
| 13 |
+
issuer_name := context.Query("issuer_name")
|
| 14 |
+
if issuer_name == "" { return context.Redirect("/") }
|
|
|
|
|
|
|
| 15 |
|
| 16 |
// json validation
|
| 17 |
fundamental_json := fmt.Sprintf("./indonesia_stocks/fundamentals/%s.json", issuer_name)
|
|
|
|
| 38 |
waitgroup_validate.Wait()
|
| 39 |
|
| 40 |
for i := 0; i < len(json_paths); i++ {
|
| 41 |
+
if err := <-err_channel; err != nil { return context.Redirect("/") }
|
|
|
|
|
|
|
| 42 |
}
|
| 43 |
|
| 44 |
// load infographics (fundamental, historical, indicator)
|
|
|
|
| 95 |
|
| 96 |
if len(errors) > 0 {
|
| 97 |
for _, err := range errors { println(err.Error()) }
|
| 98 |
+
return context.Redirect("/")
|
| 99 |
}
|
| 100 |
|
| 101 |
data := fiber.Map{
|
|
|
|
| 104 |
"Technicals": indicators,
|
| 105 |
}
|
| 106 |
|
| 107 |
+
return context.Render("infographic", data)
|
| 108 |
}
|
helpers/memory_usage.go
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
package helpers
|
| 2 |
+
|
| 3 |
+
import (
|
| 4 |
+
"fmt"
|
| 5 |
+
"runtime"
|
| 6 |
+
)
|
| 7 |
+
|
| 8 |
+
func MemoryUsage(tag string) {
|
| 9 |
+
var memory runtime.MemStats
|
| 10 |
+
runtime.ReadMemStats(&memory)
|
| 11 |
+
|
| 12 |
+
fmt.Printf(
|
| 13 |
+
"[Tag: %s] Alloc = %v MB | TotalAlloc = %v MB | Sys = %v MB | NumGC = %v\n",
|
| 14 |
+
tag, memory.Alloc/1024/1024,
|
| 15 |
+
memory.TotalAlloc/1024/1024,
|
| 16 |
+
memory.Sys/1024/1024, memory.NumGC,
|
| 17 |
+
)
|
| 18 |
+
}
|
inferences/inference_helpers.go
ADDED
|
@@ -0,0 +1,63 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
package inferences
|
| 2 |
+
|
| 3 |
+
import (
|
| 4 |
+
"sync"
|
| 5 |
+
loaders "thesis_forecasting_website/loaders"
|
| 6 |
+
)
|
| 7 |
+
|
| 8 |
+
type StockPrice struct {
|
| 9 |
+
Date string `json:"date"`
|
| 10 |
+
Price float32 `json:"price"`
|
| 11 |
+
}
|
| 12 |
+
|
| 13 |
+
func Denormalization(data, minValue, maxValue float32) float32 {
|
| 14 |
+
return (data * (maxValue - minValue)) + minValue
|
| 15 |
+
}
|
| 16 |
+
|
| 17 |
+
func InferenceLoader(inferenceDataPath, scalersDataPath string) (
|
| 18 |
+
[][]interface{}, loaders.Scalers, []error,
|
| 19 |
+
) {
|
| 20 |
+
var (
|
| 21 |
+
inferenceData [][]interface{}
|
| 22 |
+
scalersData loaders.Scalers
|
| 23 |
+
)
|
| 24 |
+
|
| 25 |
+
errChannel := make(chan error, 2)
|
| 26 |
+
|
| 27 |
+
var wgDatasetScalerLoader sync.WaitGroup
|
| 28 |
+
wgDatasetScalerLoader.Add(2)
|
| 29 |
+
|
| 30 |
+
go func() {
|
| 31 |
+
defer wgDatasetScalerLoader.Done()
|
| 32 |
+
tempData, err := loaders.DatasetLoader(inferenceDataPath)
|
| 33 |
+
if err != nil {
|
| 34 |
+
errChannel <- err
|
| 35 |
+
return
|
| 36 |
+
}
|
| 37 |
+
inferenceData = tempData
|
| 38 |
+
}()
|
| 39 |
+
|
| 40 |
+
go func() {
|
| 41 |
+
defer wgDatasetScalerLoader.Done()
|
| 42 |
+
tempData, err := loaders.ScalersLoader(scalersDataPath)
|
| 43 |
+
if err != nil {
|
| 44 |
+
errChannel <- err
|
| 45 |
+
return
|
| 46 |
+
}
|
| 47 |
+
scalersData = tempData
|
| 48 |
+
}()
|
| 49 |
+
|
| 50 |
+
wgDatasetScalerLoader.Wait()
|
| 51 |
+
close(errChannel)
|
| 52 |
+
|
| 53 |
+
var errors []error
|
| 54 |
+
for err := range errChannel {
|
| 55 |
+
errors = append(errors, err)
|
| 56 |
+
}
|
| 57 |
+
|
| 58 |
+
if len(errors) > 0 {
|
| 59 |
+
return nil, loaders.Scalers{}, errors
|
| 60 |
+
}
|
| 61 |
+
|
| 62 |
+
return inferenceData, scalersData, nil
|
| 63 |
+
}
|
inferences/stock_prediction.go
CHANGED
|
@@ -4,85 +4,63 @@ import (
|
|
| 4 |
"fmt"
|
| 5 |
"log"
|
| 6 |
"time"
|
|
|
|
| 7 |
|
| 8 |
-
"github.com/gofiber/fiber/v2"
|
| 9 |
-
|
| 10 |
-
loaders "thesis_forecasting_website/loaders"
|
| 11 |
onnxruntime "github.com/belajarqywok/onnxruntime_go"
|
| 12 |
-
"sync"
|
| 13 |
)
|
| 14 |
|
| 15 |
-
var once sync.Once
|
| 16 |
-
var isInit bool
|
| 17 |
|
| 18 |
-
|
| 19 |
-
return (data * (maxValue - minValue)) + minValue
|
| 20 |
-
}
|
| 21 |
|
| 22 |
-
|
| 23 |
-
Issuer string `json:"issuer"`
|
| 24 |
-
Days int `json:"days"`
|
| 25 |
-
}
|
| 26 |
|
| 27 |
-
|
| 28 |
-
|
| 29 |
-
|
| 30 |
-
|
| 31 |
|
| 32 |
-
type StockResponse struct {
|
| 33 |
-
Actuals []StockPrice `json:"actuals"`
|
| 34 |
-
Prediction []StockPrice `json:"prediction"`
|
| 35 |
-
}
|
| 36 |
|
| 37 |
-
|
| 38 |
-
req := new(StockRequest)
|
| 39 |
-
if err := c.BodyParser(req); err != nil {
|
| 40 |
-
return c.Status(fiber.StatusBadRequest).JSON(fiber.Map{
|
| 41 |
-
"error": "Invalid request body",
|
| 42 |
-
})
|
| 43 |
-
}
|
| 44 |
|
| 45 |
-
if req.Days <= 0 { req.Days = 7 }
|
| 46 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 47 |
once.Do(func() {
|
| 48 |
-
|
|
|
|
|
|
|
| 49 |
if err := onnxruntime.InitializeEnvironment(); err != nil {
|
| 50 |
log.Fatal("Error initializing ONNX runtime: ", err)
|
| 51 |
}
|
| 52 |
|
| 53 |
isInit = true
|
| 54 |
})
|
| 55 |
-
|
| 56 |
if !isInit { log.Fatal("ONNX runtime not initialized") }
|
| 57 |
|
| 58 |
-
//
|
| 59 |
-
|
| 60 |
-
data,
|
| 61 |
-
if
|
| 62 |
-
|
| 63 |
-
|
| 64 |
-
|
| 65 |
-
|
| 66 |
-
|
| 67 |
-
// load scaler
|
| 68 |
-
minmax_json_path := fmt.Sprintf("./indonesia_stocks/min_max/%s.json", req.Issuer)
|
| 69 |
-
scalers, err := loaders.ScalersLoader(minmax_json_path)
|
| 70 |
-
if err != nil {
|
| 71 |
-
return c.Status(fiber.StatusInternalServerError).JSON(fiber.Map{
|
| 72 |
-
"error": "Error loading scalers",
|
| 73 |
-
})
|
| 74 |
}
|
| 75 |
|
| 76 |
-
|
| 77 |
-
if len(data) <
|
| 78 |
-
|
| 79 |
|
| 80 |
var actuals []StockPrice
|
| 81 |
-
for _, row := range
|
| 82 |
date := row[0].(string)
|
| 83 |
closeVal := row[1].(float32)
|
| 84 |
|
| 85 |
-
closePrice :=
|
| 86 |
closeVal,
|
| 87 |
scalers.MinValue["Close"],
|
| 88 |
scalers.MaxValue["Close"],
|
|
@@ -90,71 +68,66 @@ func StockPredictionHandler(c *fiber.Ctx) error {
|
|
| 90 |
|
| 91 |
actuals = append(actuals, StockPrice{
|
| 92 |
Date: date,
|
| 93 |
-
Price:
|
| 94 |
})
|
| 95 |
}
|
| 96 |
|
| 97 |
-
|
| 98 |
-
|
| 99 |
-
|
| 100 |
-
lastData := data[len(data) - int(sequenceLength):]
|
| 101 |
|
| 102 |
inputData := make([]float32, sequenceLength * featureSize)
|
| 103 |
-
for
|
| 104 |
-
for
|
| 105 |
-
|
| 106 |
-
if !ok {
|
| 107 |
-
|
| 108 |
-
|
| 109 |
-
|
| 110 |
-
|
|
|
|
| 111 |
}
|
| 112 |
}
|
| 113 |
|
| 114 |
inputShape := onnxruntime.NewShape(1, sequenceLength, featureSize)
|
| 115 |
inputTensor, err := onnxruntime.NewTensor(inputShape, inputData)
|
| 116 |
-
if err != nil { log.Fatalf("
|
| 117 |
|
| 118 |
outputShape := onnxruntime.NewShape(1, 1)
|
| 119 |
outputTensor, err := onnxruntime.NewEmptyTensor[float32](outputShape)
|
| 120 |
-
if err != nil { log.Fatalf("
|
| 121 |
|
| 122 |
-
model_onnx_path := fmt.Sprintf("./models/%s.onnx", req.Issuer)
|
| 123 |
session, err := onnxruntime.NewAdvancedSession(
|
| 124 |
-
|
| 125 |
-
[]string{"input"},
|
| 126 |
[]onnxruntime.ArbitraryTensor{inputTensor},
|
| 127 |
[]onnxruntime.ArbitraryTensor{outputTensor}, nil,
|
| 128 |
)
|
|
|
|
| 129 |
|
| 130 |
-
if err != nil { log.Fatalf("Error initializing ONNX session: %v", err) }
|
| 131 |
-
|
| 132 |
-
// generate predictions
|
| 133 |
var predicted []StockPrice
|
| 134 |
lastDate, _ := time.Parse("2006-01-02", actuals[len(actuals)-1].Date)
|
| 135 |
-
|
| 136 |
-
for i := 0; i < req.Days; i++ {
|
| 137 |
if err := session.Run(); err != nil {
|
| 138 |
log.Fatalf("Error running model: %v", err)
|
| 139 |
}
|
| 140 |
|
| 141 |
predictedClose := outputTensor.GetData()[0]
|
| 142 |
-
denormPrice :=
|
|
|
|
|
|
|
|
|
|
|
|
|
| 143 |
|
| 144 |
-
lastDate
|
| 145 |
predicted = append(predicted, StockPrice{
|
| 146 |
Date: lastDate.Format("2006-01-02"),
|
| 147 |
-
Price:
|
| 148 |
})
|
| 149 |
|
| 150 |
copy(inputData, inputData[int(featureSize):])
|
| 151 |
inputData[len(inputData)-1] = predictedClose
|
| 152 |
}
|
| 153 |
|
| 154 |
-
|
| 155 |
-
Actuals: actuals,
|
| 156 |
-
Prediction: predicted,
|
| 157 |
-
}
|
| 158 |
-
|
| 159 |
-
return c.JSON(resp)
|
| 160 |
}
|
|
|
|
| 4 |
"fmt"
|
| 5 |
"log"
|
| 6 |
"time"
|
| 7 |
+
"sync"
|
| 8 |
|
|
|
|
|
|
|
|
|
|
| 9 |
onnxruntime "github.com/belajarqywok/onnxruntime_go"
|
|
|
|
| 10 |
)
|
| 11 |
|
|
|
|
|
|
|
| 12 |
|
| 13 |
+
/*
|
|
|
|
|
|
|
| 14 |
|
| 15 |
+
-- Stock Prediction --
|
|
|
|
|
|
|
|
|
|
| 16 |
|
| 17 |
+
Writer : Al-Fariqy Raihan Azhwar
|
| 18 |
+
NPM : 202143501514
|
| 19 |
+
Class : R8Q
|
| 20 |
+
Email : alfariqyraihan@gmail.com
|
| 21 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 22 |
|
| 23 |
+
*/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 24 |
|
|
|
|
| 25 |
|
| 26 |
+
var once sync.Once
|
| 27 |
+
var isInit bool
|
| 28 |
+
|
| 29 |
+
func StockPrediction(issuer string, days int) (
|
| 30 |
+
[]StockPrice, []StockPrice, error,
|
| 31 |
+
) {
|
| 32 |
once.Do(func() {
|
| 33 |
+
runtimePath := "./onnxruntime-linux-x64-1.21.0/lib/libonnxruntime.so"
|
| 34 |
+
onnxruntime.SetSharedLibraryPath(runtimePath)
|
| 35 |
+
|
| 36 |
if err := onnxruntime.InitializeEnvironment(); err != nil {
|
| 37 |
log.Fatal("Error initializing ONNX runtime: ", err)
|
| 38 |
}
|
| 39 |
|
| 40 |
isInit = true
|
| 41 |
})
|
|
|
|
| 42 |
if !isInit { log.Fatal("ONNX runtime not initialized") }
|
| 43 |
|
| 44 |
+
inferenceDataPath := fmt.Sprintf("./indonesia_stocks/modeling_datas/%s.csv", issuer)
|
| 45 |
+
scalersDataPath := fmt.Sprintf("./indonesia_stocks/min_max/%s.json", issuer)
|
| 46 |
+
data, scalers, errors := InferenceLoader(inferenceDataPath, scalersDataPath)
|
| 47 |
+
if len(errors) > 0 {
|
| 48 |
+
for _, e := range errors { log.Println("Error:", e) }
|
| 49 |
+
return []StockPrice{}, []StockPrice{}, fmt.Errorf(
|
| 50 |
+
"multiple errors occurred: %v", errors,
|
| 51 |
+
)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 52 |
}
|
| 53 |
|
| 54 |
+
nData := 30
|
| 55 |
+
if len(data) < nData { nData = len(data) }
|
| 56 |
+
lastActualData := data[len(data) - nData:]
|
| 57 |
|
| 58 |
var actuals []StockPrice
|
| 59 |
+
for _, row := range lastActualData {
|
| 60 |
date := row[0].(string)
|
| 61 |
closeVal := row[1].(float32)
|
| 62 |
|
| 63 |
+
closePrice := Denormalization(
|
| 64 |
closeVal,
|
| 65 |
scalers.MinValue["Close"],
|
| 66 |
scalers.MaxValue["Close"],
|
|
|
|
| 68 |
|
| 69 |
actuals = append(actuals, StockPrice{
|
| 70 |
Date: date,
|
| 71 |
+
Price: float32(closePrice),
|
| 72 |
})
|
| 73 |
}
|
| 74 |
|
| 75 |
+
sequenceLength := int64(60)
|
| 76 |
+
featureSize := int64(5)
|
| 77 |
+
lastSequenceData := data[len(data) - int(sequenceLength):]
|
|
|
|
| 78 |
|
| 79 |
inputData := make([]float32, sequenceLength * featureSize)
|
| 80 |
+
for idxRow, row := range lastSequenceData {
|
| 81 |
+
for idxFeature := 1; idxFeature <= int(featureSize); idxFeature++ {
|
| 82 |
+
valueFeature, ok := row[idxFeature].(float32)
|
| 83 |
+
if !ok {log.Fatalf(
|
| 84 |
+
"expected float32 at row %d col %d, got %T",
|
| 85 |
+
idxRow, idxFeature, row[idxFeature],
|
| 86 |
+
)}
|
| 87 |
+
|
| 88 |
+
inputData[idxRow*int(featureSize) + (idxFeature-1)] = valueFeature
|
| 89 |
}
|
| 90 |
}
|
| 91 |
|
| 92 |
inputShape := onnxruntime.NewShape(1, sequenceLength, featureSize)
|
| 93 |
inputTensor, err := onnxruntime.NewTensor(inputShape, inputData)
|
| 94 |
+
if err != nil { log.Fatalf("error creating input tensor: %v", err) }
|
| 95 |
|
| 96 |
outputShape := onnxruntime.NewShape(1, 1)
|
| 97 |
outputTensor, err := onnxruntime.NewEmptyTensor[float32](outputShape)
|
| 98 |
+
if err != nil { log.Fatalf("error creating output tensor: %v", err) }
|
| 99 |
|
|
|
|
| 100 |
session, err := onnxruntime.NewAdvancedSession(
|
| 101 |
+
fmt.Sprintf("./models/%s.onnx", issuer),
|
| 102 |
+
[]string{"input"}, []string{"output"},
|
| 103 |
[]onnxruntime.ArbitraryTensor{inputTensor},
|
| 104 |
[]onnxruntime.ArbitraryTensor{outputTensor}, nil,
|
| 105 |
)
|
| 106 |
+
if err != nil { log.Fatalf("error initializing ONNX session: %v", err) }
|
| 107 |
|
|
|
|
|
|
|
|
|
|
| 108 |
var predicted []StockPrice
|
| 109 |
lastDate, _ := time.Parse("2006-01-02", actuals[len(actuals)-1].Date)
|
| 110 |
+
for i := 0; i < days; i++ {
|
|
|
|
| 111 |
if err := session.Run(); err != nil {
|
| 112 |
log.Fatalf("Error running model: %v", err)
|
| 113 |
}
|
| 114 |
|
| 115 |
predictedClose := outputTensor.GetData()[0]
|
| 116 |
+
denormPrice := Denormalization(
|
| 117 |
+
predictedClose,
|
| 118 |
+
scalers.MinValue["Close"],
|
| 119 |
+
scalers.MaxValue["Close"],
|
| 120 |
+
)
|
| 121 |
|
| 122 |
+
lastDate = lastDate.AddDate(0, 0, 1)
|
| 123 |
predicted = append(predicted, StockPrice{
|
| 124 |
Date: lastDate.Format("2006-01-02"),
|
| 125 |
+
Price: float32(denormPrice),
|
| 126 |
})
|
| 127 |
|
| 128 |
copy(inputData, inputData[int(featureSize):])
|
| 129 |
inputData[len(inputData)-1] = predictedClose
|
| 130 |
}
|
| 131 |
|
| 132 |
+
return actuals, predicted, nil
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 133 |
}
|
inferences/stock_prediction_debug.go
ADDED
|
@@ -0,0 +1,301 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
package inferences
|
| 2 |
+
|
| 3 |
+
import (
|
| 4 |
+
"fmt"
|
| 5 |
+
"log"
|
| 6 |
+
"time"
|
| 7 |
+
"sync"
|
| 8 |
+
|
| 9 |
+
helpers "thesis_forecasting_website/helpers"
|
| 10 |
+
onnxruntime "github.com/belajarqywok/onnxruntime_go"
|
| 11 |
+
)
|
| 12 |
+
|
| 13 |
+
|
| 14 |
+
/*
|
| 15 |
+
|
| 16 |
+
-- Stock Prediction [ Debug ] --
|
| 17 |
+
|
| 18 |
+
Writer : Al-Fariqy Raihan Azhwar
|
| 19 |
+
NPM : 202143501514
|
| 20 |
+
Class : R8Q
|
| 21 |
+
Email : alfariqyraihan@gmail.com
|
| 22 |
+
|
| 23 |
+
|
| 24 |
+
*/
|
| 25 |
+
|
| 26 |
+
|
| 27 |
+
var onceDebug sync.Once
|
| 28 |
+
var isInitDebug bool
|
| 29 |
+
|
| 30 |
+
func StockPredictionDebug(issuer string, days int) ([]StockPrice, []StockPrice, error) {
|
| 31 |
+
// -----------------------------------------------------------------------------------------
|
| 32 |
+
// -----------------------------------------------------------------------------------------
|
| 33 |
+
startTimeLoadOnnxRuntime := time.Now()
|
| 34 |
+
onceDebug.Do(func() {
|
| 35 |
+
runtimePath := "./onnxruntime-linux-x64-1.21.0/lib/libonnxruntime.so"
|
| 36 |
+
onnxruntime.SetSharedLibraryPath(runtimePath)
|
| 37 |
+
|
| 38 |
+
if err := onnxruntime.InitializeEnvironment(); err != nil {
|
| 39 |
+
log.Fatal("Error initializing ONNX runtime: ", err)
|
| 40 |
+
}
|
| 41 |
+
|
| 42 |
+
isInitDebug = true
|
| 43 |
+
})
|
| 44 |
+
if !isInitDebug { log.Fatal("ONNX runtime not initialized") }
|
| 45 |
+
|
| 46 |
+
elapsedTimeGetLoadOnnxRuntime:= time.Since(startTimeLoadOnnxRuntime)
|
| 47 |
+
fmt.Printf(
|
| 48 |
+
"[ Time ] Load ONNX Runtime : %.9f s\n\n",
|
| 49 |
+
elapsedTimeGetLoadOnnxRuntime.Seconds(),
|
| 50 |
+
)
|
| 51 |
+
// -----------------------------------------------------------------------------------------
|
| 52 |
+
// -----------------------------------------------------------------------------------------
|
| 53 |
+
|
| 54 |
+
|
| 55 |
+
// -----------------------------------------------------------------------------------------
|
| 56 |
+
// -----------------------------------------------------------------------------------------
|
| 57 |
+
startTimeGetInferenceScalerData := time.Now()
|
| 58 |
+
|
| 59 |
+
inferenceDataPath := fmt.Sprintf("./indonesia_stocks/modeling_datas/%s.csv", issuer)
|
| 60 |
+
scalersDataPath := fmt.Sprintf("./indonesia_stocks/min_max/%s.json", issuer)
|
| 61 |
+
data, scalers, errors := InferenceLoader(inferenceDataPath, scalersDataPath)
|
| 62 |
+
if len(errors) > 0 {
|
| 63 |
+
for _, e := range errors { log.Println("Error:", e) }
|
| 64 |
+
return []StockPrice{}, []StockPrice{}, fmt.Errorf("multiple errors occurred: %v", errors)
|
| 65 |
+
}
|
| 66 |
+
|
| 67 |
+
elapsedTimeGetInferenceScalerData := time.Since(startTimeGetInferenceScalerData)
|
| 68 |
+
fmt.Printf(
|
| 69 |
+
"[ Time ] Get Inference Scaler Data : %.9f s\n\n",
|
| 70 |
+
elapsedTimeGetInferenceScalerData.Seconds(),
|
| 71 |
+
)
|
| 72 |
+
// -----------------------------------------------------------------------------------------
|
| 73 |
+
// -----------------------------------------------------------------------------------------
|
| 74 |
+
|
| 75 |
+
// DEBUG
|
| 76 |
+
fmt.Println("[ -- fmt.Println(data) -- ]")
|
| 77 |
+
fmt.Println(data)
|
| 78 |
+
fmt.Println()
|
| 79 |
+
|
| 80 |
+
fmt.Println("[ -- fmt.Println(len(data)) -- ]")
|
| 81 |
+
fmt.Println(len(data))
|
| 82 |
+
fmt.Println()
|
| 83 |
+
|
| 84 |
+
fmt.Println("[ -- fmt.Println(scalers) -- ]")
|
| 85 |
+
fmt.Println(scalers)
|
| 86 |
+
fmt.Println()
|
| 87 |
+
|
| 88 |
+
fmt.Println("[ -- fmt.Println(errors) -- ]")
|
| 89 |
+
fmt.Println(errors)
|
| 90 |
+
fmt.Println()
|
| 91 |
+
|
| 92 |
+
nData := 30
|
| 93 |
+
if len(data) < nData { nData = len(data) }
|
| 94 |
+
lastActualData := data[len(data) - nData:]
|
| 95 |
+
|
| 96 |
+
|
| 97 |
+
// -----------------------------------------------------------------------------------------
|
| 98 |
+
// -----------------------------------------------------------------------------------------
|
| 99 |
+
startTimeGetActualsData := time.Now()
|
| 100 |
+
|
| 101 |
+
var actuals []StockPrice
|
| 102 |
+
for _, row := range lastActualData {
|
| 103 |
+
date := row[0].(string)
|
| 104 |
+
closeVal := row[1].(float32)
|
| 105 |
+
|
| 106 |
+
closePrice := Denormalization(
|
| 107 |
+
closeVal,
|
| 108 |
+
scalers.MinValue["Close"],
|
| 109 |
+
scalers.MaxValue["Close"],
|
| 110 |
+
)
|
| 111 |
+
|
| 112 |
+
actuals = append(actuals, StockPrice{
|
| 113 |
+
Date: date,
|
| 114 |
+
Price: float32(closePrice),
|
| 115 |
+
})
|
| 116 |
+
}
|
| 117 |
+
|
| 118 |
+
elapsedTimeGetActualsData := time.Since(startTimeGetActualsData)
|
| 119 |
+
fmt.Printf(
|
| 120 |
+
"[ Time ] Get Actuals Data : %.9f s\n\n",
|
| 121 |
+
elapsedTimeGetActualsData.Seconds(),
|
| 122 |
+
)
|
| 123 |
+
// -----------------------------------------------------------------------------------------
|
| 124 |
+
// -----------------------------------------------------------------------------------------
|
| 125 |
+
|
| 126 |
+
// DEBUG
|
| 127 |
+
fmt.Println("[ -- fmt.Println(actuals) -- ]")
|
| 128 |
+
fmt.Println(actuals)
|
| 129 |
+
fmt.Println()
|
| 130 |
+
|
| 131 |
+
fmt.Println("[ -- fmt.Println(len(actuals)) -- ]")
|
| 132 |
+
fmt.Println(len(actuals))
|
| 133 |
+
fmt.Println()
|
| 134 |
+
|
| 135 |
+
// prepare input for model
|
| 136 |
+
sequenceLength := int64(60)
|
| 137 |
+
featureSize := int64(5)
|
| 138 |
+
lastSequenceData := data[len(data) - int(sequenceLength):]
|
| 139 |
+
|
| 140 |
+
// DEBUG
|
| 141 |
+
fmt.Println("[ -- fmt.Println(lastSequenceData) -- ]")
|
| 142 |
+
fmt.Println(lastSequenceData)
|
| 143 |
+
fmt.Println()
|
| 144 |
+
|
| 145 |
+
fmt.Println("[ -- fmt.Println(len(lastSequenceData)) -- ]")
|
| 146 |
+
fmt.Println(len(lastSequenceData))
|
| 147 |
+
fmt.Println()
|
| 148 |
+
|
| 149 |
+
|
| 150 |
+
// -----------------------------------------------------------------------------------------
|
| 151 |
+
// -----------------------------------------------------------------------------------------
|
| 152 |
+
startTimeGetInputData := time.Now()
|
| 153 |
+
|
| 154 |
+
inputData := make([]float32, sequenceLength * featureSize)
|
| 155 |
+
for idxRow, row := range lastSequenceData {
|
| 156 |
+
for idxFeature := 1; idxFeature <= int(featureSize); idxFeature++ {
|
| 157 |
+
valueFeature, ok := row[idxFeature].(float32)
|
| 158 |
+
if !ok {log.Fatalf(
|
| 159 |
+
"Expected float32 at row %d col %d, got %T",
|
| 160 |
+
idxRow, idxFeature, row[idxFeature],
|
| 161 |
+
)}
|
| 162 |
+
|
| 163 |
+
inputData[idxRow*int(featureSize) + (idxFeature-1)] = valueFeature
|
| 164 |
+
}
|
| 165 |
+
}
|
| 166 |
+
|
| 167 |
+
elapsedTimeGetInputData := time.Since(startTimeGetInputData)
|
| 168 |
+
fmt.Printf(
|
| 169 |
+
"[ Time ] Get Input Data : %.9f s\n\n",
|
| 170 |
+
elapsedTimeGetInputData.Seconds(),
|
| 171 |
+
)
|
| 172 |
+
// -----------------------------------------------------------------------------------------
|
| 173 |
+
// -----------------------------------------------------------------------------------------
|
| 174 |
+
|
| 175 |
+
// DEBUG
|
| 176 |
+
fmt.Println("[ -- fmt.Println(inputData) -- ]")
|
| 177 |
+
fmt.Println(inputData)
|
| 178 |
+
fmt.Println()
|
| 179 |
+
|
| 180 |
+
fmt.Println("[ -- fmt.Println(len(inputData)) -- ]")
|
| 181 |
+
fmt.Println(len(inputData))
|
| 182 |
+
fmt.Println()
|
| 183 |
+
|
| 184 |
+
|
| 185 |
+
// -----------------------------------------------------------------------------------------
|
| 186 |
+
// -----------------------------------------------------------------------------------------
|
| 187 |
+
startTimeGetInputTensor := time.Now()
|
| 188 |
+
|
| 189 |
+
inputShape := onnxruntime.NewShape(1, sequenceLength, featureSize)
|
| 190 |
+
inputTensor, err := onnxruntime.NewTensor(inputShape, inputData)
|
| 191 |
+
if err != nil { log.Fatalf("Error creating input tensor: %v", err) }
|
| 192 |
+
|
| 193 |
+
elapsedTimeGetInputTensor := time.Since(startTimeGetInputTensor)
|
| 194 |
+
fmt.Printf(
|
| 195 |
+
"[ Time ] Get Input Tensor : %.9f s\n\n",
|
| 196 |
+
elapsedTimeGetInputTensor.Seconds(),
|
| 197 |
+
)
|
| 198 |
+
// -----------------------------------------------------------------------------------------
|
| 199 |
+
// -----------------------------------------------------------------------------------------
|
| 200 |
+
|
| 201 |
+
// DEBUG
|
| 202 |
+
fmt.Println("[ -- fmt.Println(inputTensor) -- ]")
|
| 203 |
+
fmt.Println(inputTensor)
|
| 204 |
+
fmt.Println()
|
| 205 |
+
|
| 206 |
+
|
| 207 |
+
// -----------------------------------------------------------------------------------------
|
| 208 |
+
// -----------------------------------------------------------------------------------------
|
| 209 |
+
startTimeGetOutputTensor := time.Now()
|
| 210 |
+
|
| 211 |
+
outputShape := onnxruntime.NewShape(1, 1)
|
| 212 |
+
outputTensor, err := onnxruntime.NewEmptyTensor[float32](outputShape)
|
| 213 |
+
if err != nil { log.Fatalf("Error creating output tensor: %v", err) }
|
| 214 |
+
|
| 215 |
+
elapsedTimeGetOutputTensor := time.Since(startTimeGetOutputTensor)
|
| 216 |
+
fmt.Printf(
|
| 217 |
+
"[ Time ] Get Output Tensor : %.9f s\n\n",
|
| 218 |
+
elapsedTimeGetOutputTensor.Seconds(),
|
| 219 |
+
)
|
| 220 |
+
// -----------------------------------------------------------------------------------------
|
| 221 |
+
// -----------------------------------------------------------------------------------------
|
| 222 |
+
|
| 223 |
+
// DEBUG
|
| 224 |
+
fmt.Println("[ -- fmt.Println(outputTensor) -- ]")
|
| 225 |
+
fmt.Println(outputTensor)
|
| 226 |
+
fmt.Println()
|
| 227 |
+
|
| 228 |
+
|
| 229 |
+
// -----------------------------------------------------------------------------------------
|
| 230 |
+
// -----------------------------------------------------------------------------------------
|
| 231 |
+
startTimeGetSession := time.Now()
|
| 232 |
+
helpers.MemoryUsage("Before Session")
|
| 233 |
+
|
| 234 |
+
session, err := onnxruntime.NewAdvancedSession(
|
| 235 |
+
fmt.Sprintf("./models/%s.onnx", issuer),
|
| 236 |
+
[]string{"input"}, []string{"output"},
|
| 237 |
+
[]onnxruntime.ArbitraryTensor{inputTensor},
|
| 238 |
+
[]onnxruntime.ArbitraryTensor{outputTensor}, nil,
|
| 239 |
+
)
|
| 240 |
+
if err != nil { log.Fatalf("Error initializing ONNX session: %v", err) }
|
| 241 |
+
|
| 242 |
+
_ = session
|
| 243 |
+
helpers.MemoryUsage("After Session")
|
| 244 |
+
|
| 245 |
+
elapsedTimeGetSession := time.Since(startTimeGetSession)
|
| 246 |
+
fmt.Printf(
|
| 247 |
+
"[ Time ] Get Session : %.9f s\n\n",
|
| 248 |
+
elapsedTimeGetSession.Seconds(),
|
| 249 |
+
)
|
| 250 |
+
// -----------------------------------------------------------------------------------------
|
| 251 |
+
// -----------------------------------------------------------------------------------------
|
| 252 |
+
|
| 253 |
+
// DEBUG
|
| 254 |
+
fmt.Println("[ -- fmt.Println(session) -- ]")
|
| 255 |
+
fmt.Println(session)
|
| 256 |
+
fmt.Println()
|
| 257 |
+
|
| 258 |
+
|
| 259 |
+
// -----------------------------------------------------------------------------------------
|
| 260 |
+
// -----------------------------------------------------------------------------------------
|
| 261 |
+
startTimeGetPredictedData := time.Now()
|
| 262 |
+
|
| 263 |
+
var predicted []StockPrice
|
| 264 |
+
lastDate, _ := time.Parse("2006-01-02", actuals[len(actuals)-1].Date)
|
| 265 |
+
for i := 0; i < days; i++ {
|
| 266 |
+
if err := session.Run(); err != nil {
|
| 267 |
+
log.Fatalf("Error running model: %v", err)
|
| 268 |
+
}
|
| 269 |
+
|
| 270 |
+
predictedClose := outputTensor.GetData()[0]
|
| 271 |
+
denormPrice := Denormalization(predictedClose, scalers.MinValue["Close"], scalers.MaxValue["Close"])
|
| 272 |
+
|
| 273 |
+
lastDate = lastDate.AddDate(0, 0, 1)
|
| 274 |
+
predicted = append(predicted, StockPrice{
|
| 275 |
+
Date: lastDate.Format("2006-01-02"),
|
| 276 |
+
Price: float32(denormPrice),
|
| 277 |
+
})
|
| 278 |
+
|
| 279 |
+
copy(inputData, inputData[int(featureSize):])
|
| 280 |
+
inputData[len(inputData)-1] = predictedClose
|
| 281 |
+
}
|
| 282 |
+
|
| 283 |
+
elapsedTimeGetPredictedData := time.Since(startTimeGetPredictedData)
|
| 284 |
+
fmt.Printf(
|
| 285 |
+
"[ Time ] Get Predicted Data : %.9f s\n\n",
|
| 286 |
+
elapsedTimeGetPredictedData.Seconds(),
|
| 287 |
+
)
|
| 288 |
+
// -----------------------------------------------------------------------------------------
|
| 289 |
+
// -----------------------------------------------------------------------------------------
|
| 290 |
+
|
| 291 |
+
// DEBUG
|
| 292 |
+
fmt.Println("[ -- fmt.Println(predicted) -- ]")
|
| 293 |
+
fmt.Println(predicted)
|
| 294 |
+
fmt.Println()
|
| 295 |
+
|
| 296 |
+
fmt.Println("[ -- fmt.Println(len(predicted)) -- ]")
|
| 297 |
+
fmt.Println(len(predicted))
|
| 298 |
+
fmt.Println()
|
| 299 |
+
|
| 300 |
+
return actuals, predicted, nil
|
| 301 |
+
}
|
main.go
CHANGED
|
@@ -4,6 +4,10 @@ import (
|
|
| 4 |
"fmt"
|
| 5 |
"log"
|
| 6 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 7 |
"os"
|
| 8 |
"os/signal"
|
| 9 |
"syscall"
|
|
@@ -15,7 +19,6 @@ import (
|
|
| 15 |
|
| 16 |
helpers "thesis_forecasting_website/helpers"
|
| 17 |
handlers "thesis_forecasting_website/handlers"
|
| 18 |
-
inferences "thesis_forecasting_website/inferences"
|
| 19 |
middlewares "thesis_forecasting_website/middlewares"
|
| 20 |
)
|
| 21 |
|
|
@@ -37,7 +40,7 @@ func main() {
|
|
| 37 |
|
| 38 |
forecasting_service.Get("/", handlers.IssuerHandler)
|
| 39 |
forecasting_service.Get("/infographic", handlers.InfographicHandler)
|
| 40 |
-
forecasting_service.Post("/prediction",
|
| 41 |
|
| 42 |
host := os.Getenv("FORECASTING_SERVICE_HOST")
|
| 43 |
port := os.Getenv("FORECASTING_SERVICE_PORT")
|
|
@@ -49,6 +52,14 @@ func main() {
|
|
| 49 |
}
|
| 50 |
}()
|
| 51 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 52 |
quit := make(chan os.Signal, 1)
|
| 53 |
signal.Notify(quit, os.Interrupt, syscall.SIGTERM)
|
| 54 |
<-quit
|
|
|
|
| 4 |
"fmt"
|
| 5 |
"log"
|
| 6 |
|
| 7 |
+
// //for pprof profiling
|
| 8 |
+
// "net/http"
|
| 9 |
+
// _ "net/http/pprof"
|
| 10 |
+
|
| 11 |
"os"
|
| 12 |
"os/signal"
|
| 13 |
"syscall"
|
|
|
|
| 19 |
|
| 20 |
helpers "thesis_forecasting_website/helpers"
|
| 21 |
handlers "thesis_forecasting_website/handlers"
|
|
|
|
| 22 |
middlewares "thesis_forecasting_website/middlewares"
|
| 23 |
)
|
| 24 |
|
|
|
|
| 40 |
|
| 41 |
forecasting_service.Get("/", handlers.IssuerHandler)
|
| 42 |
forecasting_service.Get("/infographic", handlers.InfographicHandler)
|
| 43 |
+
forecasting_service.Post("/prediction", handlers.InferenceHandler)
|
| 44 |
|
| 45 |
host := os.Getenv("FORECASTING_SERVICE_HOST")
|
| 46 |
port := os.Getenv("FORECASTING_SERVICE_PORT")
|
|
|
|
| 52 |
}
|
| 53 |
}()
|
| 54 |
|
| 55 |
+
// // pprof profiling
|
| 56 |
+
// go func() {
|
| 57 |
+
// log.Println("pprof listening on :6060")
|
| 58 |
+
// if err := http.ListenAndServe("0.0.0.0:6060", nil); err != nil {
|
| 59 |
+
// log.Fatalf("pprof server error: %v", err)
|
| 60 |
+
// }
|
| 61 |
+
// }()
|
| 62 |
+
|
| 63 |
quit := make(chan os.Signal, 1)
|
| 64 |
signal.Notify(quit, os.Interrupt, syscall.SIGTERM)
|
| 65 |
<-quit
|
makefile
CHANGED
|
@@ -10,14 +10,7 @@ run:
|
|
| 10 |
npm run min:js:infographic:stock_historical:table
|
| 11 |
go run main.go
|
| 12 |
|
| 13 |
-
|
| 14 |
-
|
| 15 |
-
|
| 16 |
-
|
| 17 |
-
mkdir -p models
|
| 18 |
-
for i in $(seq 1 10); do
|
| 19 |
-
git clone https://huggingface.co/qywok/stock_models_$i
|
| 20 |
-
cd stock_models_$i && git lfs pull && cd ..
|
| 21 |
-
mv stock_models_$i/*.onnx models/
|
| 22 |
-
rm -rf stock_models_$i
|
| 23 |
-
done
|
|
|
|
| 10 |
npm run min:js:infographic:stock_historical:table
|
| 11 |
go run main.go
|
| 12 |
|
| 13 |
+
req:
|
| 14 |
+
curl -X POST "http://127.0.0.1:7860/prediction" \
|
| 15 |
+
-H "Content-Type: application/json" \
|
| 16 |
+
-d '{"issuer":"BBCA","days":12}'
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public/js/infographic/stock_prediction/inference.js
CHANGED
|
@@ -5,7 +5,8 @@ const predict = async () => {
|
|
| 5 |
loadingSpinner.classList.remove('d-none')
|
| 6 |
loadingSpinner.classList.add('show')
|
| 7 |
|
| 8 |
-
const apiUrl = 'https://qywok-cryptocurrency-prediction.hf.space/crypto/prediction'
|
|
|
|
| 9 |
|
| 10 |
try {
|
| 11 |
const response = await fetch(apiUrl, {
|
|
@@ -16,7 +17,7 @@ const predict = async () => {
|
|
| 16 |
},
|
| 17 |
body: JSON.stringify({
|
| 18 |
days: parseInt(days),
|
| 19 |
-
|
| 20 |
})
|
| 21 |
})
|
| 22 |
|
|
|
|
| 5 |
loadingSpinner.classList.remove('d-none')
|
| 6 |
loadingSpinner.classList.add('show')
|
| 7 |
|
| 8 |
+
// const apiUrl = 'https://qywok-cryptocurrency-prediction.hf.space/crypto/prediction'
|
| 9 |
+
const apiUrl = '/prediction'
|
| 10 |
|
| 11 |
try {
|
| 12 |
const response = await fetch(apiUrl, {
|
|
|
|
| 17 |
},
|
| 18 |
body: JSON.stringify({
|
| 19 |
days: parseInt(days),
|
| 20 |
+
issuer: `${stock_name}`
|
| 21 |
})
|
| 22 |
})
|
| 23 |
|
public/js/infographic/stock_prediction/update_pred_chart.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
| 1 |
-
const updatePredictionChart = (
|
| 2 |
-
const actualDates =
|
| 3 |
-
const actualPrices =
|
| 4 |
|
| 5 |
-
const predictionDates =
|
| 6 |
-
const predictionPrices =
|
| 7 |
|
| 8 |
const labels = [...actualDates, ...predictionDates]
|
| 9 |
const actualData = [...actualPrices, ...Array(predictionPrices.length).fill(null)]
|
|
@@ -23,7 +23,7 @@ const updatePredictionChart = (data) => {
|
|
| 23 |
labels: labels,
|
| 24 |
datasets: [
|
| 25 |
{
|
| 26 |
-
label: 'Data
|
| 27 |
data: actualData,
|
| 28 |
borderColor: 'rgba(75, 192, 192, 1)',
|
| 29 |
backgroundColor: 'rgba(75, 192, 192, 0.2)',
|
|
@@ -52,7 +52,7 @@ const updatePredictionChart = (data) => {
|
|
| 52 |
let options_plugins_chart = {
|
| 53 |
title: {
|
| 54 |
display: true,
|
| 55 |
-
text:
|
| 56 |
color: '#ffffff',
|
| 57 |
font: {
|
| 58 |
size: 16,
|
|
|
|
| 1 |
+
const updatePredictionChart = (response) => {
|
| 2 |
+
const actualDates = response.actuals.map(entry => entry.date)
|
| 3 |
+
const actualPrices = response.actuals.map(entry => entry.price)
|
| 4 |
|
| 5 |
+
const predictionDates = response.predictions.map(entry => entry.date)
|
| 6 |
+
const predictionPrices = response.predictions.map(entry => entry.price)
|
| 7 |
|
| 8 |
const labels = [...actualDates, ...predictionDates]
|
| 9 |
const actualData = [...actualPrices, ...Array(predictionPrices.length).fill(null)]
|
|
|
|
| 23 |
labels: labels,
|
| 24 |
datasets: [
|
| 25 |
{
|
| 26 |
+
label: 'Data Historiskal',
|
| 27 |
data: actualData,
|
| 28 |
borderColor: 'rgba(75, 192, 192, 1)',
|
| 29 |
backgroundColor: 'rgba(75, 192, 192, 0.2)',
|
|
|
|
| 52 |
let options_plugins_chart = {
|
| 53 |
title: {
|
| 54 |
display: true,
|
| 55 |
+
text: `${stock_name} - Prediksi Harga Saham`,
|
| 56 |
color: '#ffffff',
|
| 57 |
font: {
|
| 58 |
size: 16,
|
public_dist/js/infographic/stock_prediction/inference.js
CHANGED
|
@@ -1 +1 @@
|
|
| 1 |
-
const predict=async()=>{const
|
|
|
|
| 1 |
+
const predict=async()=>{const s=document.getElementById("predictionDays").value,e=document.getElementById("loadingSpinner");e.classList.remove("d-none"),e.classList.add("show");const t="/prediction";try{const a=await fetch(t,{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify({days:parseInt(s),issuer:`${stock_name}`})});if(!a.ok)throw new Error("Network response was not ok");const n=await a.json();updatePredictionChart(n)}catch(a){console.error("Error fetching data:",a),alert("Terjadi kesalahan saat memproses prediksi. Silakan coba lagi.")}finally{e.classList.remove("show"),e.classList.add("d-none")}};
|
public_dist/js/infographic/stock_prediction/update_pred_chart.js
CHANGED
|
@@ -1 +1 @@
|
|
| 1 |
-
const updatePredictionChart=a=>{const
|
|
|
|
| 1 |
+
const updatePredictionChart=a=>{const n=a.actuals.map(t=>t.date),r=a.actuals.map(t=>t.price),s=a.predictions.map(t=>t.date),o=a.predictions.map(t=>t.price),i=[...n,...s],l=[...r,...Array(o.length).fill(null)],d=[...Array(r.length).fill(null),...o];if(predictionChart)predictionChart.data.labels=i,predictionChart.data.datasets[0].data=l,predictionChart.data.datasets[1].data=d,predictionChart.update();else{const t=document.getElementById("predictionChart").getContext("2d");let c={labels:i,datasets:[{label:"Data Historis",data:l,borderColor:"rgba(75, 192, 192, 1)",backgroundColor:"rgba(75, 192, 192, 0.2)",borderWidth:2,fill:!1,tension:.1,pointRadius:2,pointHoverRadius:5},{label:"Prediksi",data:d,borderColor:"rgba(255, 99, 132, 1)",backgroundColor:"rgba(255, 99, 132, 0.2)",borderWidth:2,borderDash:[5,5],fill:!1,tension:.1,pointRadius:3,pointHoverRadius:6}]},f={title:{display:!0,text:`${stock_name} - Prediksi Harga Saham`,color:"#ffffff",font:{size:16,weight:"bold"}},legend:{labels:{color:"#ffffff",usePointStyle:!0,padding:20}},tooltip:{mode:"index",intersect:!1,backgroundColor:"rgba(26, 26, 46, 0.9)",titleColor:"#ffffff",bodyColor:"#ffffff",borderColor:"#00d4aa",borderWidth:1,callbacks:{label:function(e){return e.dataset.label+": Rp "+e.parsed.y.toLocaleString("id-ID")}}}},p={x:{type:"category",title:{display:!0,text:"Tanggal",color:"#ffffff"},grid:{color:"rgba(255, 255, 255, 0.1)"},ticks:{color:"#a0a0a0"}},y:{beginAtZero:!1,title:{display:!0,text:"Harga (Rp)",color:"#ffffff"},grid:{color:"rgba(255, 255, 255, 0.1)"},ticks:{color:"#a0a0a0",callback:function(e){return"Rp "+e.toLocaleString("id-ID")}}}};predictionChart=new Chart(t,{type:"line",data:c,options:{responsive:!0,maintainAspectRatio:!1,plugins:f,scales:p,interaction:{mode:"nearest",axis:"x",intersect:!1},elements:{point:{hoverBorderWidth:3}}}})}};
|
update_dataset_models.sh
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#!/bin/bash
|
| 2 |
+
|
| 3 |
+
apt install -y git git-lfs
|
| 4 |
+
git lfs install
|
| 5 |
+
|
| 6 |
+
rm -irf indonesia_stocks
|
| 7 |
+
git clone https://huggingface.co/datasets/qywok/indonesia_stocks
|
| 8 |
+
|
| 9 |
+
mkdir -p models
|
| 10 |
+
for i in $(seq 1 10); do
|
| 11 |
+
git clone https://huggingface.co/qywok/stock_models_$i
|
| 12 |
+
cd stock_models_$i && git lfs pull && cd ..
|
| 13 |
+
mv stock_models_$i/*.onnx models/
|
| 14 |
+
rm -rf stock_models_$i
|
| 15 |
+
done
|
views/infographic.html
CHANGED
|
@@ -391,7 +391,7 @@
|
|
| 391 |
<div id="prediction-tab" class="tab-pane">
|
| 392 |
<!-- Prediction Controls -->
|
| 393 |
<div class="prediction-controls">
|
| 394 |
-
<h6><i class="fas fa-brain me-2"></i>Prediksi Harga Saham
|
| 395 |
<div class="prediction-input-group">
|
| 396 |
<div class="prediction-input">
|
| 397 |
<label for="predictionDays">Hari Prediksi:</label>
|
|
|
|
| 391 |
<div id="prediction-tab" class="tab-pane">
|
| 392 |
<!-- Prediction Controls -->
|
| 393 |
<div class="prediction-controls">
|
| 394 |
+
<h6><i class="fas fa-brain me-2"></i>Prediksi Harga Saham {{ .Fundamentals.Symbol }}</h6>
|
| 395 |
<div class="prediction-input-group">
|
| 396 |
<div class="prediction-input">
|
| 397 |
<label for="predictionDays">Hari Prediksi:</label>
|