Unterschiede

Hier werden die Unterschiede zwischen zwei Versionen angezeigt.

Link zu dieser Vergleichsansicht

Beide Seiten der vorigen RevisionVorhergehende Überarbeitung
Nächste Überarbeitung
Vorhergehende Überarbeitung
p:ki:smi [2023/08/31 15:49] – [🇨🇭 SMI-Vorhersage] Ralf Kretzschmarp:ki:smi [2024/05/02 08:57] (aktuell) Tscherter, Vincent
Zeile 16: Zeile 16:
   - Studiere die Anzeige.    - Studiere die Anzeige. 
     * Im Register ''Trainingsdaten'' siehst du die Trainingsdaten (den SMI von 2021 bis 2022).     * Im Register ''Trainingsdaten'' siehst du die Trainingsdaten (den SMI von 2021 bis 2022).
-    * Im Register ''Resultat'' siehst du grün den letzten Teil der Trainingsdaten von 2022. Das trainierte neuronale Netz nimmt die letzten Daten aus 2022 als Eingang und sagt ausgehend davon Schritt für Schritt die blaue Kurve für 2023 vorher. Die orange Kurve stellt die wahren SMI-Werte 2023 dar. +    * Im Register ''Resultat'' siehst du braun den letzten Teil der Trainingsdaten von 2022. Das trainierte neuronale Netz nimmt die letzten Daten aus 2022 als Eingang und sagt ausgehend davon Schritt für Schritt die grüne Kurve für 2023 vorher. Die orange Kurve stellt die wahren SMI-Werte 2023 dar. 
  
-{{exorciser/jspg?javascript=%2F%2F%20%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%0A%2F%2F%20%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%0A%0A%2F%2F%20Diese%20Trainings-%20und%20Updateparameter%20d%C3%BCrfen%20ge%C3%A4ndert%20werden.%0A%0Aconst%20TIMESERIES_FEATURES%20%3D%20100%3B%20%2F%2F%20ganzahliger%20Wert%20von%201%20bis%20250%0A%0Aconst%20LERNRATE%20%3D%200.0001%3B%20%2F%2F%20Dezimalzahl%20%3E%200%0Aconst%20ANZAHL_HIDDEN_NEURONS%20%3D%2050%3B%20%2F%2F%20ganzzahliger%20Wert%20%3E%200%0Aconst%20ANZAHL_EPOCHEN%20%3D%20500%3B%20%2F%2F%20ganzzahliger%20Wert%20%3E%200%0A%0A%2F%2F%20%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%0A%2F%2F%20%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%0A%0A%0A%0A%2F%2F%20%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%0A%2F%2F%20CONSTANTS%20AND%20GLOBAL%20VARIABLES%0A%2F%2F%20%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%0A%0A%0A%2F%2F%20data%0Aconst%20trainingData%20%3D%20%5B10738.39%2C%2010694.09%2C%2010747.08%2C%2010778.67%2C%2010797.99%2C%2010870.42%2C%2010875.25%2C%2010846.88%2C%2010850.81%2C%2010877.06%2C%2010888.54%2C%2010876.98%2C%2010945.46%2C%2010913.11%2C%2010930.81%2C%2010925.7%2C%2010964.05%2C%2010904.24%2C%2010849.82%2C%2010591.06%2C%2010740.22%2C%2010803.57%2C%2010775.68%2C%2010860.95%2C%2010755.47%2C%2010778.83%2C%2010803.67%2C%2010825.75%2C%2010852.91%2C%2010880.37%2C%2010940.99%2C%2010907.6%2C%2010809.28%2C%2010717.71%2C%2010704.75%2C%2010697.38%2C%2010609.03%2C%2010727.7%2C%2010658.87%2C%2010522.22%2C%2010706.59%2C%2010817.15%2C%2010771.88%2C%2010750.09%2C%2010607.79%2C%2010830.38%2C%2010857.97%2C%2010909.77%2C%2010883.23%2C%2010839.93%2C%2010867.33%2C%2010944.48%2C%2010922.49%2C%2010973.76%2C%2010967.37%2C%2011048.58%2C%2011098.66%2C%2011063.87%2C%2011098.81%2C%2011116.81%2C%2011089.6%2C%2011121.42%2C%2011047.37%2C%2011118.03%2C%2011182.95%2C%2011128.18%2C%2011206.88%2C%2011238.52%2C%2011181.35%2C%2011122.37%2C%2011156.21%2C%2011198.7%2C%2011262.97%2C%2011209.84%2C%2011078.98%2C%2011209.09%2C%2011224.9%2C%2011200.54%2C%2011162.09%2C%2011092.08%2C%2011103.46%2C%2011079.51%2C%2011022.34%2C%2011119%2C%2010970.93%2C%2011108.88%2C%2011111.1%2C%2011173.57%2C%2011123.67%2C%2010989.32%2C%2011033.9%2C%2011120.77%2C%2011135.37%2C%2011141.75%2C%2011045.2%2C%2011152.08%2C%2011225.58%2C%2011305.74%2C%2011348.74%2C%2011340.27%2C%2011426.15%2C%2011363.45%2C%2011434.88%2C%2011470.35%2C%2011510.6%2C%2011570.68%2C%2011630.66%2C%2011656.89%2C%2011788.1%2C%2011810.8%2C%2011841.3%2C%2011866.41%2C%2011921.97%2C%2011982.03%2C%2012011.11%2C%2011941.25%2C%2011995.63%2C%2011982.48%2C%2011898.62%2C%2011993.64%2C%2011999.7%2C%2012009.17%2C%2012028.45%2C%2011942.72%2C%2011977.03%2C%2011964.84%2C%2011967.57%2C%2011965.22%2C%2012085.51%2C%2011924.66%2C%2011989.81%2C%2012081.62%2C%2012071.05%2C%2012043.35%2C%2011976.79%2C%2012026.5%2C%2011862.08%2C%2011945.68%2C%2012021.58%2C%2011977%2C%2012130.83%2C%2012049.63%2C%2012021.09%2C%2012073.23%2C%2012086.74%2C%2012116.82%2C%2012171.02%2C%2012163.22%2C%2012178.74%2C%2012199.82%2C%2012176.3%2C%2012310.75%2C%2012361.69%2C%2012387.9%2C%2012429.17%2C%2012464.44%2C%2012419.14%2C%2012477.44%2C%2012545.35%2C%2012403.58%2C%2012415.66%2C%2012476.87%2C%2012436.66%2C%2012364.57%2C%2012409.03%2C%2012439%2C%2012436.58%2C%2012411.11%2C%2012432.79%2C%2012432.46%2C%2012351.84%2C%2012430.23%2C%2012344.38%2C%2012215.14%2C%2012116.43%2C%2012060.64%2C%2012074.81%2C%2012097.28%2C%2011984.83%2C%2012028.44%2C%2011935.53%2C%2011766.42%2C%2011789.17%2C%2011837.57%2C%2011938.62%2C%2011817.2%2C%2011691.18%2C%2011485.58%2C%2011628.33%2C%2011642.45%2C%2011575.37%2C%2011582.35%2C%2011587%2C%2011569.39%2C%2011763.64%2C%2011764.99%2C%2011771.57%2C%2011756.76%2C%2011814.59%2C%2011892.52%2C%2011961.34%2C%2011968.08%2C%2011942.74%2C%2012013.15%2C%2012039.14%2C%2012056.21%2C%2012063.17%2C%2012146.52%2C%2012087.45%2C%2012153.1%2C%2012108.17%2C%2012216.33%2C%2012321%2C%2012383.27%2C%2012403.05%2C%2012321.85%2C%2012353.35%2C%2012367.52%2C%2012401.4%2C%2012421.08%2C%2012516.05%2C%2012517.12%2C%2012557.34%2C%2012600.15%2C%2012553.19%2C%2012545.01%2C%2012510.81%2C%2012366.73%2C%2012395.72%2C%2012449.68%2C%2012199.21%2C%2012220.74%2C%2012159.69%2C%2012266.46%2C%2012177.52%2C%2012175.77%2C%2012375.35%2C%2012513.62%2C%2012597.43%2C%2012607.63%2C%2012607.73%2C%2012551.28%2C%2012411.58%2C%2012530.95%2C%2012790.89%2C%2012715.48%2C%2012589.89%2C%2012682.53%2C%2012713.9%2C%2012785.32%2C%2012866.9%2C%2012970.53%2C%2012926.56%2C%2012875.66%2C%2012939.17%2C%2012900.97%2C%2012906.37%2C%2012792.28%2C%2012797.94%2C%2012597.35%2C%2012709.71%2C%2012670.47%2C%2012620.44%2C%2012525.63%2C%2012633.21%2C%2012529.56%2C%2012525.69%2C%2012560.7%2C%2012355.54%2C%2011881.3%2C%2011945.69%2C%2012098.26%2C%2012176.9%2C%2012104.44%2C%2012226.7%2C%2012359.8%2C%2012360.37%2C%2012234.15%2C%2012140.25%2C%2012193.81%2C%2012155.66%2C%2012367.82%2C%2012313.16%2C%2012231.97%2C%2012026.37%2C%2012181.86%2C%2012191.57%2C%2012075.27%2C%2012010.09%2C%2011891.88%2C%2011959.39%2C%2011941.89%2C%2011636.76%2C%2011987.31%2C%2011986.78%2C%2011862.28%2C%2011871.59%2C%2011675.7%2C%2011300.13%2C%2011204.67%2C%2011057.06%2C%2011493.36%2C%2011391.1%2C%2011495.69%2C%2011678.94%2C%2011682.22%2C%2011900.96%2C%2012061.87%2C%2012184.99%2C%2012171.28%2C%2012202.62%2C%2012099.5%2C%2012131.45%2C%2012121.67%2C%2012155.95%2C%2012325.58%2C%2012243.73%2C%2012161.53%2C%2012179.08%2C%2012340.87%2C%2012376.97%2C%2012320.1%2C%2012372.46%2C%2012507.69%2C%2012528.61%2C%2012378.87%2C%2012378.68%2C%2012475.08%2C%2012281.42%2C%2012310.17%2C%2012301.33%2C%2012258.33%2C%2012084.98%2C%2011933.28%2C%2012051.48%2C%2012068.41%2C%2012128.76%2C%2011971.73%2C%2012001.88%2C%2011880.24%2C%2011877.27%2C%2011730.42%2C%2011444.18%2C%2011541.72%2C%2011553.66%2C%2011506.13%2C%2011650.42%2C%2011672.23%2C%2011730.44%2C%2011579.14%2C%2011309.49%2C%2011308.98%2C%2011466.28%2C%2011483.56%2C%2011491.8%2C%2011647.17%2C%2011736.26%2C%2011611.38%2C%2011494.12%2C%2011550.2%2C%2011529.16%2C%2011534.18%2C%2011467.39%2C%2011322.43%2C%2011084.62%2C%2010896.25%2C%2010699.07%2C%2010783.59%2C%2010475.37%2C%2010451.31%2C%2010485.91%2C%2010479.84%2C%2010528.34%2C%2010453.31%2C%2010823.12%2C%2010906.82%2C%2010809.57%2C%2010811.75%2C%2010741.21%2C%2010770.4%2C%2010881.97%2C%2010702.5%2C%2010840.6%2C%2010940.98%2C%2011015.03%2C%2011027.16%2C%2011069.83%2C%2010904.85%2C%2010799.52%2C%2010982.09%2C%2011010.18%2C%2011122.08%2C%2011059.49%2C%2011134.74%2C%2011096.12%2C%2011129.35%2C%2011102.31%2C%2011056.74%2C%2011129.33%2C%2011145.91%2C%2011118.1%2C%2011178.99%2C%2011202.66%2C%2011123.07%2C%2011166.32%2C%2011132.48%2C%2011155.1%2C%2011154.58%2C%2011128.24%2C%2011171.54%2C%2011130.44%2C%2011128.19%2C%2011167.59%2C%2011156.72%2C%2011085.84%2C%2010933.06%2C%2011012.87%2C%2011063.88%2C%2010942.16%2C%2010896.74%2C%2010884.95%2C%2010855.03%2C%2010663.44%2C%2010891.71%2C%2010819.54%2C%2010834.18%2C%2010805.16%2C%2010790.32%2C%2010900.24%2C%2010990.75%2C%2010891.54%2C%2010754.4%2C%2010746.7%2C%2010610.65%2C%2010617.01%2C%2010476.54%2C%2010429.4%2C%2010297.65%2C%2010137.78%2C%2010072.62%2C%2010126.43%2C%2010220.76%2C%2010126.99%2C%2010267.55%2C%2010290.71%2C%2010590.92%2C%2010477.69%2C%2010391.13%2C%2010308.57%2C%2010262.52%2C%2010207.83%2C%2010199.32%2C%2010227.9%2C%2010329.34%2C%2010498.71%2C%2010578.76%2C%2010484.14%2C%2010473.45%2C%2010418.6%2C%2010595.53%2C%2010773.34%2C%2010817.21%2C%2010706.62%2C%2010772.37%2C%2010827.93%2C%2010783.65%2C%2010806.23%2C%2010710.59%2C%2010787.77%2C%2010750.39%2C%2010827.04%2C%2010904.33%2C%2011120.49%2C%2011127.15%2C%2010999.59%2C%2011026.22%2C%2010936.62%2C%2010917.88%2C%2011045.49%2C%2011085.04%2C%2011074.3%2C%2011094.46%2C%2011157.56%2C%2011168.03%2C%2011162.16%2C%2011077.81%2C%2011127.77%2C%2011238.2%2C%2011198.13%2C%2011194.67%2C%2011109.33%2C%2011009.95%2C%2011004.53%2C%2011068.3%2C%2011033.64%2C%2011136.62%2C%2011160.69%2C%2010880.14%2C%2010770.38%2C%2010773.23%2C%2010659.19%2C%2010845.59%2C%2010774.64%2C%2010804.68%2C%2010839.22%2C%2010812.67%2C%2010857.35%2C%2010729.4%5D%3B%0Aconst%20testingData%20%3D%20%5B10978.64%2C%2011140.27%2C%2011057.39%2C%2011144.54%2C%2011212.57%2C%2011162.15%2C%2011246.01%2C%2011287.82%2C%2011290.79%2C%2011435.99%2C%2011401.99%2C%2011366.62%2C%2011258.97%2C%2011295.02%2C%2011406.27%2C%2011406.29%2C%2011404.77%2C%2011317.56%2C%2011332.3%2C%2011379.64%2C%2011285.78%2C%2011200.93%2C%2011188.42%2C%2011349.39%2C%2011283.25%2C%2011233.87%2C%2011276.28%2C%2011217.73%2C%2011130.46%2C%2011209.34%2C%2011231.91%2C%2011272.67%2C%2011194.91%2C%2011256.29%2C%2011266.68%2C%2011282.16%2C%2011300.29%2C%2011247.75%2C%2011181.77%2C%2011219.93%2C%2011098.35%2C%2011056.08%2C%2011165.58%2C%2011190.09%2C%2011147.25%2C%2011064.08%2C%2011025.26%2C%2010948.85%2C%2010765.26%2C%2010632.05%2C%2010716.72%2C%2010516.4%2C%2010719.1%2C%2010613.55%2C%2010643.64%2C%2010792.58%2C%2010782.28%2C%2010718.54%2C%2010634.04%2C%2010786.22%2C%2010839.11%2C%2010963.31%2C%2011032.21%2C%2011106.24%2C%2011093.09%2C%2011073.48%2C%2011115.4%2C%2011230.07%2C%2011265.3%2C%2011231.99%2C%2011258.95%2C%2011342.86%2C%2011311.76%2C%2011358.98%2C%2011366.22%2C%2011390.64%2C%2011460.58%2C%2011467.2%2C%2011513.12%2C%2011364.91%2C%2011361.89%2C%2011437.14%2C%2011423.33%2C%2011506.19%2C%2011456.37%2C%2011554.24%2C%2011595.25%2C%2011546.04%2C%2011447.23%2C%2011522.97%2C%2011564.73%2C%2011578.25%2C%2011519.87%2C%2011437.78%2C%2011571.16%2C%2011553.23%2C%2011484.9%2C%2011383.14%2C%2011325.26%2C%2011434.24%2C%2011282.45%2C%2011217.89%2C%2011296.28%2C%2011443.35%2C%2011415%2C%2011468.27%2C%2011348.11%2C%2011308.9%2C%2011254.42%2C%2011301.25%2C%2011327.27%2C%2011278.3%2C%2011302.83%2C%2011386.26%2C%2011306.64%2C%2011215.91%2C%2011173.65%2C%2011183.42%2C%2011221.22%2C%2011141.9%2C%2011142.65%2C%2011183.55%2C%2011170.51%2C%2011280.29%5D%3B%0A%0A%2F%2F%20further%20constants%0Aconst%20PREDICTION_LIMIT%20%3D%20trainingData.length%20%2F%202%3B%0Aconst%20GRAPH_WIDH%20%3D%20800%3B%0A%0A%2F%2F%20neural%20network%20structure%0Aconst%20MODEL_LAYERS%20%3D%20%5B%0A%09tf.layers.dense%28%7B%0A%09%09name%3A%20%27HiddenLayer1%27%2C%0A%09%09inputShape%3A%20%5BTIMESERIES_FEATURES%5D%2C%0A%09%09units%3A%20ANZAHL_HIDDEN_NEURONS%2C%0A%09%09activation%3A%20%27LeakyReLU%27%0A%09%7D%29%2C%0A%09tf.layers.dense%28%7B%0A%09%09name%3A%20%27HiddenLayer2%27%2C%0A%09%09units%3A%20ANZAHL_HIDDEN_NEURONS%2C%0A%09%09activation%3A%20%27LeakyReLU%27%0A%09%7D%29%2C%0A%09tf.layers.dense%28%7B%0A%09%09name%3A%20%27OutputLayer%27%2C%0A%09%09units%3A%201%2C%0A%09%09activation%3A%20%27linear%27%0A%09%7D%29%0A%5D%3B%0A%0A%2F%2F%20neural%20network%20algorithms%0Aconst%20MODEL_COMPILE%20%3D%20%7B%0A%09optimizer%3A%20tf.train.adam%28LERNRATE%29%2C%0A%09loss%3A%20tf.losses.absoluteDifference%0A%7D%3B%0A%0A%0A%0A%2F%2F%20%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%0A%2F%2F%20DATA%20HANDLING%20FUNCTIONS%0A%2F%2F%20%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%0A%0A%0A%2F%2F%0A%2F%2F%20create%20input%20data%0A%2F%2F%0Afunction%20createInputArray%28valueArray%29%20%7B%0A%09let%20inputArray%20%3D%20new%20Array%28valueArray.length%20-%20TIMESERIES_FEATURES%29.fill%280%29.map%28%28%29%20%3D%3E%20new%20Array%28TIMESERIES_FEATURES%29.fill%280%29%29%3B%20%2F%2F%20empty%20two-dimensional%20array%0A%09for%20%28let%20v%20%3D%200%3B%20v%20%3C%20valueArray.length%20-%20TIMESERIES_FEATURES%3B%20v%2B%2B%29%20%7B%0A%09%09for%20%28let%20f%20%3D%200%3B%20f%20%3C%20TIMESERIES_FEATURES%3B%20f%2B%2B%29%20%7B%0A%09%09%09inputArray%5Bv%5D%5Bf%5D%20%3D%20valueArray%5Bv%20%2B%20f%5D%3B%0A%09%09%7D%0A%09%7D%0A%09return%20inputArray%3B%0A%7D%0A%0A%0A%2F%2F%0A%2F%2F%20create%20output%20data%0A%2F%2F%0Afunction%20createOutputArray%28valueArray%29%20%7B%0A%09let%20outputArray%20%3D%20new%20Array%28valueArray.length%20-%20TIMESERIES_FEATURES%29.fill%280%29%3B%0A%09for%20%28v%20%3D%200%3B%20v%20%3C%20valueArray.length%20-%20TIMESERIES_FEATURES%3B%20v%2B%2B%29%20%7B%0A%09%09outputArray%5Bv%5D%20%3D%20valueArray%5Bv%20%2B%20TIMESERIES_FEATURES%5D%3B%0A%09%7D%0A%09return%20outputArray%3B%0A%7D%0A%0A%0A%0A%2F%2F%20%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%0A%2F%2F%20NEURAL%20NETWORK%20FUNCTIONS%0A%2F%2F%20%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%0A%0A%0A%2F%2F%0A%2F%2F%20build%20model%0A%2F%2F%0Afunction%20buildModel%28%29%20%7B%0A%09const%20model%20%3D%20tf.sequential%28%7B%0A%09%09layers%3A%20MODEL_LAYERS%0A%09%7D%29%3B%0A%09%2F%2F%20neural%20network%20training%0A%09model.compile%28MODEL_COMPILE%29%3B%0A%09return%20model%3B%0A%7D%0A%0A%0A%2F%2F%0A%2F%2F%20train%20model%0A%2F%2F%0Aasync%20function%20trainModel%28model%2C%20trainInput%2C%20trainOutput%29%20%7B%0A%09let%20history%20%3D%20await%20model.fit%28%0A%09%09tf.tensor%28trainInput%29%2C%20tf.tensor%28trainOutput%29%2C%20%7B%0A%09%09%09epochs%3A%20ANZAHL_EPOCHEN%20%2B%201%2C%0A%09%09%09batchSize%3A%20trainInput.length%2C%0A%09%09%09shuffle%3A%20true%2C%0A%09%09%09callbacks%3A%20%5B%0A%09%09%09%09tfvis.show.fitCallbacks%28%7B%0A%09%09%09%09%09name%3A%20%27Trainingsfehler%27%2C%0A%09%09%09%09%09tab%3A%20%27Training%27%0A%09%09%09%09%7D%2C%20%5B%27loss%27%5D%2C%20%7B%0A%09%09%09%09%09height%3A%20200%2C%0A%09%09%09%09%09callbacks%3A%20%5B%27onEpochEnd%27%5D%2C%0A%09%09%09%09%09yLabel%3A%20%27MSE%27%0A%09%09%09%09%7D%29%2C%0A%09%09%09%5D%0A%09%09%7D%29%3B%0A%09return%20history%3B%0A%7D%0A%0A%0A%2F%2F%0A%2F%2F%20predict%20timeseries%20ahead%20and%20return%20object%20for%20tfvis%0A%2F%2F%0Aasync%20function%20predictTimeseries%28model%2C%20inputArray%2C%20observedArray%29%20%7B%0A%0A%09%2F%2F%20create%20last%20known%20input%0A%09let%20inputSample%20%3D%20%5B%5D%3B%0A%09inputSample.push%28%5B%5D%29%3B%0A%09for%20%28let%20t%20%3D%200%3B%20t%20%3C%20TIMESERIES_FEATURES%3B%20t%20%3D%20t%20%2B%201%29%20%7B%0A%09%09inputSample%5B0%5D.push%28inputArray%5BinputArray.length%20-%20TIMESERIES_FEATURES%20%2B%20t%5D%29%3B%0A%09%7D%0A%0A%09%2F%2F%20predict%20ahead%0A%09let%20outputTensor%2C%20outputArray%3B%0A%09let%20predictedOutput%20%3D%20%5B%5D%3B%0A%09for%20%28t%20%3D%200%3B%20t%20%3C%20observedArray.length%3B%20t%20%3D%20t%20%2B%201%29%20%7B%0A%09%09%2F%2F%20predict%20one%20timestep%0A%09%09outputTensor%20%3D%20await%20model.predict%28tf.tensor%28inputSample%29%29%3B%0A%09%09outputArray%20%3D%20await%20outputTensor.arraySync%28%29%3B%0A%09%09predictedOutput.push%28outputArray%5B0%5D%5B0%5D%29%3B%0A%09%09%2F%2F%20compose%20new%20input%20sample%0A%09%09inputSample%5B0%5D.shift%28%29%3B%0A%09%09inputSample%5B0%5D.push%28predictedOutput%5Bt%5D%29%3B%0A%09%7D%0A%09return%20predictedOutput%3B%0A%7D%0A%0A%0A%0A%2F%2F%20%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%0A%2F%2F%20FUNCTIONS%20FOR%20VISUALISATION%0A%2F%2F%20%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%0A%0A%2F%2F%0A%2F%2F%20draw%20timeseries%20prediction%0A%2F%2F%0Afunction%20drawTrainingData%28trainingData%29%20%7B%0A%09%2F%2F%20training%20values%0A%09let%20trainingArrayObject%20%3D%20%5B%5D%3B%0A%09for%20%28let%20t%20%3D%200%3B%20t%20%3C%20trainingData.length%3B%20t%20%3D%20t%20%2B%201%29%20%7B%0A%09%09trainingArrayObject.push%28%7B%0A%09%09%09x%3A%20t%2C%0A%09%09%09y%3A%20trainingData%5Bt%5D%20%2a%2010%0A%09%09%7D%29%3B%0A%09%7D%0A%09%2F%2F%20draw%20everything%0A%09data%20%3D%20%7B%0A%09%09values%3A%20%5BtrainingArrayObject%5D%2C%0A%09%09series%3A%20%5B%22Trainingsdaten%22%5D%0A%09%7D%3B%0A%09surface%20%3D%20%7B%0A%09%09name%3A%20%22SMI%20Trainingsdaten%202021%20%26%202022%22%2C%0A%09%09tab%3A%20%27Trainingsdaten%27%2C%0A%09%09styles%3A%20%7B%0A%09%09%09width%3A%20GRAPH_WIDH%0A%09%09%7D%0A%09%7D%3B%0A%09look%20%3D%20%7B%0A%09%09xLabel%3A%20%27Aufeinanderfolgende%20B%C3%B6rsentage%27%2C%0A%09%09yLabel%3A%20%27SMI-Index%27%2C%0A%09%09zoomToFit%3A%20true%2C%0A%09%09seriesColors%3A%20%5B%22limegreen%22%5D%0A%09%7D%3B%0A%09tfvis.render.linechart%28surface%2C%20data%2C%20look%29%3B%0A%7D%0A%0A%0A%2F%2F%0A%2F%2F%20draw%20timeseries%20prediction%0A%2F%2F%0Afunction%20drawTimeseries%28pastArray%2C%20observedArray%2C%20predictedArray%29%20%7B%0A%09%2F%2F%20past%0A%09let%20pastArrayObject%20%3D%20%5B%5D%3B%0A%09%2F%2F%20get%20past%20values%0A%09for%20%28let%20t%20%3D%200%3B%20t%20%3C%20TIMESERIES_FEATURES%3B%20t%20%3D%20t%20%2B%201%29%20%7B%0A%09%09pastArrayObject.push%28%7B%0A%09%09%09x%3A%20t%2C%0A%09%09%09y%3A%20pastArray%5Bt%20%2B%20pastArray.length%20-%20TIMESERIES_FEATURES%5D%20%2a%2010%0A%09%09%7D%29%3B%0A%09%7D%0A%09for%20%28let%20t%20%3D%20TIMESERIES_FEATURES%3B%20t%20%3C%20TIMESERIES_FEATURES%20%2B%20observedArray.length%3B%20t%20%3D%20t%20%2B%201%29%20%7B%0A%09%09pastArrayObject.push%28%7B%0A%09%09%09x%3A%20t%2C%0A%09%09%09y%3A%20null%0A%09%09%7D%29%3B%0A%09%7D%0A%09%2F%2F%20observed%20values%0A%09let%20observedArrayObject%20%3D%20%5B%5D%3B%0A%09for%20%28let%20t%20%3D%200%3B%20t%20%3C%20TIMESERIES_FEATURES%20-%201%3B%20t%20%3D%20t%20%2B%201%29%20%7B%0A%09%09observedArrayObject.push%28%7B%0A%09%09%09x%3A%20t%2C%0A%09%09%09y%3A%20null%0A%09%09%7D%29%3B%0A%09%7D%0A%09observedArrayObject.push%28%7B%0A%09%09x%3A%20TIMESERIES_FEATURES%20-%201%2C%0A%09%09y%3A%20pastArray%5BpastArray.length%20-%201%5D%20%2a%2010%0A%09%7D%29%3B%0A%09for%20%28let%20t%20%3D%20TIMESERIES_FEATURES%3B%20t%20%3C%20TIMESERIES_FEATURES%20%2B%20observedArray.length%3B%20t%20%3D%20t%20%2B%201%29%20%7B%0A%09%09observedArrayObject.push%28%7B%0A%09%09%09x%3A%20t%2C%0A%09%09%09y%3A%20observedArray%5Bt%20-%20TIMESERIES_FEATURES%5D%20%2a%2010%0A%09%09%7D%29%3B%0A%09%7D%0A%09%2F%2F%20predicted%20values%0A%09let%20predictedArrayObject%20%3D%20%5B%5D%3B%0A%09for%20%28let%20t%20%3D%200%3B%20t%20%3C%20TIMESERIES_FEATURES%20-%201%3B%20t%20%3D%20t%20%2B%201%29%20%7B%0A%09%09predictedArrayObject.push%28%7B%0A%09%09%09x%3A%20t%2C%0A%09%09%09y%3A%20null%0A%09%09%7D%29%3B%0A%09%7D%0A%09predictedArrayObject.push%28%7B%0A%09%09x%3A%20TIMESERIES_FEATURES%20-%201%2C%0A%09%09y%3A%20pastArray%5BpastArray.length%20-%201%5D%20%2a%2010%0A%09%7D%29%3B%0A%09for%20%28let%20t%20%3D%20TIMESERIES_FEATURES%3B%20t%20%3C%20TIMESERIES_FEATURES%20%2B%20observedArray.length%3B%20t%20%3D%20t%20%2B%201%29%20%7B%0A%09%09predictedArrayObject.push%28%7B%0A%09%09%09x%3A%20t%2C%0A%09%09%09y%3A%20predictedArray%5Bt%20-%20TIMESERIES_FEATURES%5D%20%2a%2010%0A%09%09%7D%29%3B%0A%09%7D%0A%09%2F%2F%20draw%20everything%0A%09data%20%3D%20%7B%0A%09%09values%3A%20%5BobservedArrayObject%2C%20predictedArrayObject%2C%20pastArrayObject%5D%2C%0A%09%09series%3A%20%5B%22Beobachtete%20Zukunft%22%2C%20%22Vorhergesagte%20Zukunft%22%2C%20%22Beobachtete%20Vergangenheit%22%5D%0A%09%7D%3B%0A%09surface%20%3D%20%7B%0A%09%09name%3A%20%22SMI%20Vorhersage%201te%20Jahresh%C3%A4lfte%202023%22%2C%0A%09%09tab%3A%20%27Resultat%27%2C%0A%09%09styles%3A%20%7B%0A%09%09%09width%3A%20GRAPH_WIDH%0A%09%09%7D%0A%09%7D%3B%0A%09look%20%3D%20%7B%0A%09%09xLabel%3A%20%27Aufeinanderfolgende%20B%C3%B6rsentage%27%2C%0A%09%09yLabel%3A%20%27SMI-Index%27%2C%0A%09%09zoomToFit%3A%20true%2C%0A%09%09seriesColors%3A%20%5B%22limegreen%22%2C%20%22steelblue%22%2C%20%22darkorange%22%5D%0A%09%7D%3B%0A%09tfvis.render.linechart%28surface%2C%20data%2C%20look%29%3B%0A%7D%0A%0A%0A%0A%2F%2F%20%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%0A%2F%2F%20MAIN%20PROGRAM%0A%2F%2F%20%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%0A%0A%0A%2F%2F%0A%2F%2F%20main%20function%0A%2F%2F%0Aasync%20function%20run%28%29%20%7B%0A%09%2F%2Fnoprotect%0A%0A%20%20%20%20%2F%2F%20check%20for%20too%20many%20input%20features%0A%20%20%20%20if%28TIMESERIES_FEATURES%20%3E%20PREDICTION_LIMIT%29%20%7B%0A%20%20%20%20%20%20%20%20console.log%28%22%E2%9A%A0%EF%B8%8F%20Die%20Anzahl%20TIMESERIES_FEATURES%20ist%20zu%20hoch%21%22%29%3B%0A%20%20%20%20%20%20%20%20return%3B%0A%20%20%20%20%7D%0A%0A%09%2F%2F%20write%20preferences%20on%20console%0A%09console.log%28%22SMI-Vorhersage%22%29%3B%0A%09console.log%28%22Neuronales%20Netz%3A%20Anzahl%20Eingangsgr%C3%B6ssen%3A%20%22%20%2B%20TIMESERIES_FEATURES%20%2B%20%22%2C%20Anzahl%20Hidden%20Neuronen%3A%20%22%20%2B%20ANZAHL_HIDDEN_NEURONS%29%3B%0A%09console.log%28%22Training%3A%20Lernrate%3A%20%22%20%2B%20LERNRATE%20%2B%20%22%2C%20Epochen%3A%20%22%20%2B%20ANZAHL_EPOCHEN%29%3B%0A%0A%09drawTrainingData%28trainingData%29%3B%0A%0A%09%2F%2F%20create%20input%20and%20output%20data%0A%09let%20inputArray%20%3D%20createInputArray%28trainingData%29%3B%0A%09let%20outputArray%20%3D%20createOutputArray%28trainingData%29%3B%0A%0A%09%2F%2F%20build%20and%20show%20model%0A%09let%20model%20%3D%20buildModel%28%29%3B%0A%09tfvis.show.modelSummary%28%7B%0A%09%09name%3A%20%27Neuronales%20Netz%27%2C%0A%09%09tab%3A%20%27Modell%27%0A%09%7D%2C%20model%29%3B%0A%0A%09%2F%2F%20train%20model%0A%09let%20history%20%3D%20await%20trainModel%28model%2C%20inputArray%2C%20outputArray%29%3B%0A%09console.log%28%22Entg%C3%BCltiger%20Trainingsfehler%20%28MSE%29%3A%20%22%20%2B%20history.history.loss%5BANZAHL_EPOCHEN%5D%29%3B%0A%0A%09%2F%2F%20predict%20and%20show%20timeseries%0A%09let%20predictedTimeseries%20%3D%20await%20predictTimeseries%28model%2C%20trainingData%2C%20testingData%29%3B%0A%09drawTimeseries%28trainingData%2C%20testingData%2C%20predictedTimeseries%29%3B%0A%0A%7D%0A%0A%0Adocument.addEventListener%28%27DOMContentLoaded%27%2C%20run%29%3B&css=undefined&html=%3Cscript%20src%3D%22https%3A%2F%2Fcdn.jsdelivr.net%2Fnpm%2Fp5%22%3E%3C%2Fscript%3E%0A%3Cscript%20src%3D%22https%3A%2F%2Fcdn.jsdelivr.net%2Fnpm%2F%40tensorflow%2Ftfjs%40latest%2Fdist%2Ftf.min.js%22%3E%3C%2Fscript%3E%0A%3Cscript%20src%3D%22https%3A%2F%2Fcdn.jsdelivr.net%2Fnpm%2F%40tensorflow%2Ftfjs-vis%22%3E%3C%2Fscript%3E&autorun=off&height=700px#SMI}}+{{exorciser/jspg?javascript=%2F%2F%20%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%0A%2F%2F%20%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%0A%0A%2F%2F%20Diese%20Trainings-%20und%20Updateparameter%20d%C3%BCrfen%20ge%C3%A4ndert%20werden.%0A%0Aconst%20TIMESERIES_FEATURES%20%3D%20100%3B%20%2F%2F%20ganzahliger%20Wert%20von%201%20bis%20250%0A%0Aconst%20LERNRATE%20%3D%200.0001%3B%20%2F%2F%20Dezimalzahl%20%3E%200%0Aconst%20ANZAHL_HIDDEN_NEURONS%20%3D%2050%3B%20%2F%2F%20ganzzahliger%20Wert%20%3E%200%0Aconst%20ANZAHL_EPOCHEN%20%3D%20500%3B%20%2F%2F%20ganzzahliger%20Wert%20%3E%200%0A%0A%2F%2F%20%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%0A%2F%2F%20%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%0A%0A%0A%0A%2F%2F%20%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%0A%2F%2F%20CONSTANTS%20AND%20GLOBAL%20VARIABLES%0A%2F%2F%20%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%0A%0A%0A%2F%2F%20data%0Aconst%20trainingData%20%3D%20%5B10738.39%2C%2010694.09%2C%2010747.08%2C%2010778.67%2C%2010797.99%2C%2010870.42%2C%2010875.25%2C%2010846.88%2C%2010850.81%2C%2010877.06%2C%2010888.54%2C%2010876.98%2C%2010945.46%2C%2010913.11%2C%2010930.81%2C%2010925.7%2C%2010964.05%2C%2010904.24%2C%2010849.82%2C%2010591.06%2C%2010740.22%2C%2010803.57%2C%2010775.68%2C%2010860.95%2C%2010755.47%2C%2010778.83%2C%2010803.67%2C%2010825.75%2C%2010852.91%2C%2010880.37%2C%2010940.99%2C%2010907.6%2C%2010809.28%2C%2010717.71%2C%2010704.75%2C%2010697.38%2C%2010609.03%2C%2010727.7%2C%2010658.87%2C%2010522.22%2C%2010706.59%2C%2010817.15%2C%2010771.88%2C%2010750.09%2C%2010607.79%2C%2010830.38%2C%2010857.97%2C%2010909.77%2C%2010883.23%2C%2010839.93%2C%2010867.33%2C%2010944.48%2C%2010922.49%2C%2010973.76%2C%2010967.37%2C%2011048.58%2C%2011098.66%2C%2011063.87%2C%2011098.81%2C%2011116.81%2C%2011089.6%2C%2011121.42%2C%2011047.37%2C%2011118.03%2C%2011182.95%2C%2011128.18%2C%2011206.88%2C%2011238.52%2C%2011181.35%2C%2011122.37%2C%2011156.21%2C%2011198.7%2C%2011262.97%2C%2011209.84%2C%2011078.98%2C%2011209.09%2C%2011224.9%2C%2011200.54%2C%2011162.09%2C%2011092.08%2C%2011103.46%2C%2011079.51%2C%2011022.34%2C%2011119%2C%2010970.93%2C%2011108.88%2C%2011111.1%2C%2011173.57%2C%2011123.67%2C%2010989.32%2C%2011033.9%2C%2011120.77%2C%2011135.37%2C%2011141.75%2C%2011045.2%2C%2011152.08%2C%2011225.58%2C%2011305.74%2C%2011348.74%2C%2011340.27%2C%2011426.15%2C%2011363.45%2C%2011434.88%2C%2011470.35%2C%2011510.6%2C%2011570.68%2C%2011630.66%2C%2011656.89%2C%2011788.1%2C%2011810.8%2C%2011841.3%2C%2011866.41%2C%2011921.97%2C%2011982.03%2C%2012011.11%2C%2011941.25%2C%2011995.63%2C%2011982.48%2C%2011898.62%2C%2011993.64%2C%2011999.7%2C%2012009.17%2C%2012028.45%2C%2011942.72%2C%2011977.03%2C%2011964.84%2C%2011967.57%2C%2011965.22%2C%2012085.51%2C%2011924.66%2C%2011989.81%2C%2012081.62%2C%2012071.05%2C%2012043.35%2C%2011976.79%2C%2012026.5%2C%2011862.08%2C%2011945.68%2C%2012021.58%2C%2011977%2C%2012130.83%2C%2012049.63%2C%2012021.09%2C%2012073.23%2C%2012086.74%2C%2012116.82%2C%2012171.02%2C%2012163.22%2C%2012178.74%2C%2012199.82%2C%2012176.3%2C%2012310.75%2C%2012361.69%2C%2012387.9%2C%2012429.17%2C%2012464.44%2C%2012419.14%2C%2012477.44%2C%2012545.35%2C%2012403.58%2C%2012415.66%2C%2012476.87%2C%2012436.66%2C%2012364.57%2C%2012409.03%2C%2012439%2C%2012436.58%2C%2012411.11%2C%2012432.79%2C%2012432.46%2C%2012351.84%2C%2012430.23%2C%2012344.38%2C%2012215.14%2C%2012116.43%2C%2012060.64%2C%2012074.81%2C%2012097.28%2C%2011984.83%2C%2012028.44%2C%2011935.53%2C%2011766.42%2C%2011789.17%2C%2011837.57%2C%2011938.62%2C%2011817.2%2C%2011691.18%2C%2011485.58%2C%2011628.33%2C%2011642.45%2C%2011575.37%2C%2011582.35%2C%2011587%2C%2011569.39%2C%2011763.64%2C%2011764.99%2C%2011771.57%2C%2011756.76%2C%2011814.59%2C%2011892.52%2C%2011961.34%2C%2011968.08%2C%2011942.74%2C%2012013.15%2C%2012039.14%2C%2012056.21%2C%2012063.17%2C%2012146.52%2C%2012087.45%2C%2012153.1%2C%2012108.17%2C%2012216.33%2C%2012321%2C%2012383.27%2C%2012403.05%2C%2012321.85%2C%2012353.35%2C%2012367.52%2C%2012401.4%2C%2012421.08%2C%2012516.05%2C%2012517.12%2C%2012557.34%2C%2012600.15%2C%2012553.19%2C%2012545.01%2C%2012510.81%2C%2012366.73%2C%2012395.72%2C%2012449.68%2C%2012199.21%2C%2012220.74%2C%2012159.69%2C%2012266.46%2C%2012177.52%2C%2012175.77%2C%2012375.35%2C%2012513.62%2C%2012597.43%2C%2012607.63%2C%2012607.73%2C%2012551.28%2C%2012411.58%2C%2012530.95%2C%2012790.89%2C%2012715.48%2C%2012589.89%2C%2012682.53%2C%2012713.9%2C%2012785.32%2C%2012866.9%2C%2012970.53%2C%2012926.56%2C%2012875.66%2C%2012939.17%2C%2012900.97%2C%2012906.37%2C%2012792.28%2C%2012797.94%2C%2012597.35%2C%2012709.71%2C%2012670.47%2C%2012620.44%2C%2012525.63%2C%2012633.21%2C%2012529.56%2C%2012525.69%2C%2012560.7%2C%2012355.54%2C%2011881.3%2C%2011945.69%2C%2012098.26%2C%2012176.9%2C%2012104.44%2C%2012226.7%2C%2012359.8%2C%2012360.37%2C%2012234.15%2C%2012140.25%2C%2012193.81%2C%2012155.66%2C%2012367.82%2C%2012313.16%2C%2012231.97%2C%2012026.37%2C%2012181.86%2C%2012191.57%2C%2012075.27%2C%2012010.09%2C%2011891.88%2C%2011959.39%2C%2011941.89%2C%2011636.76%2C%2011987.31%2C%2011986.78%2C%2011862.28%2C%2011871.59%2C%2011675.7%2C%2011300.13%2C%2011204.67%2C%2011057.06%2C%2011493.36%2C%2011391.1%2C%2011495.69%2C%2011678.94%2C%2011682.22%2C%2011900.96%2C%2012061.87%2C%2012184.99%2C%2012171.28%2C%2012202.62%2C%2012099.5%2C%2012131.45%2C%2012121.67%2C%2012155.95%2C%2012325.58%2C%2012243.73%2C%2012161.53%2C%2012179.08%2C%2012340.87%2C%2012376.97%2C%2012320.1%2C%2012372.46%2C%2012507.69%2C%2012528.61%2C%2012378.87%2C%2012378.68%2C%2012475.08%2C%2012281.42%2C%2012310.17%2C%2012301.33%2C%2012258.33%2C%2012084.98%2C%2011933.28%2C%2012051.48%2C%2012068.41%2C%2012128.76%2C%2011971.73%2C%2012001.88%2C%2011880.24%2C%2011877.27%2C%2011730.42%2C%2011444.18%2C%2011541.72%2C%2011553.66%2C%2011506.13%2C%2011650.42%2C%2011672.23%2C%2011730.44%2C%2011579.14%2C%2011309.49%2C%2011308.98%2C%2011466.28%2C%2011483.56%2C%2011491.8%2C%2011647.17%2C%2011736.26%2C%2011611.38%2C%2011494.12%2C%2011550.2%2C%2011529.16%2C%2011534.18%2C%2011467.39%2C%2011322.43%2C%2011084.62%2C%2010896.25%2C%2010699.07%2C%2010783.59%2C%2010475.37%2C%2010451.31%2C%2010485.91%2C%2010479.84%2C%2010528.34%2C%2010453.31%2C%2010823.12%2C%2010906.82%2C%2010809.57%2C%2010811.75%2C%2010741.21%2C%2010770.4%2C%2010881.97%2C%2010702.5%2C%2010840.6%2C%2010940.98%2C%2011015.03%2C%2011027.16%2C%2011069.83%2C%2010904.85%2C%2010799.52%2C%2010982.09%2C%2011010.18%2C%2011122.08%2C%2011059.49%2C%2011134.74%2C%2011096.12%2C%2011129.35%2C%2011102.31%2C%2011056.74%2C%2011129.33%2C%2011145.91%2C%2011118.1%2C%2011178.99%2C%2011202.66%2C%2011123.07%2C%2011166.32%2C%2011132.48%2C%2011155.1%2C%2011154.58%2C%2011128.24%2C%2011171.54%2C%2011130.44%2C%2011128.19%2C%2011167.59%2C%2011156.72%2C%2011085.84%2C%2010933.06%2C%2011012.87%2C%2011063.88%2C%2010942.16%2C%2010896.74%2C%2010884.95%2C%2010855.03%2C%2010663.44%2C%2010891.71%2C%2010819.54%2C%2010834.18%2C%2010805.16%2C%2010790.32%2C%2010900.24%2C%2010990.75%2C%2010891.54%2C%2010754.4%2C%2010746.7%2C%2010610.65%2C%2010617.01%2C%2010476.54%2C%2010429.4%2C%2010297.65%2C%2010137.78%2C%2010072.62%2C%2010126.43%2C%2010220.76%2C%2010126.99%2C%2010267.55%2C%2010290.71%2C%2010590.92%2C%2010477.69%2C%2010391.13%2C%2010308.57%2C%2010262.52%2C%2010207.83%2C%2010199.32%2C%2010227.9%2C%2010329.34%2C%2010498.71%2C%2010578.76%2C%2010484.14%2C%2010473.45%2C%2010418.6%2C%2010595.53%2C%2010773.34%2C%2010817.21%2C%2010706.62%2C%2010772.37%2C%2010827.93%2C%2010783.65%2C%2010806.23%2C%2010710.59%2C%2010787.77%2C%2010750.39%2C%2010827.04%2C%2010904.33%2C%2011120.49%2C%2011127.15%2C%2010999.59%2C%2011026.22%2C%2010936.62%2C%2010917.88%2C%2011045.49%2C%2011085.04%2C%2011074.3%2C%2011094.46%2C%2011157.56%2C%2011168.03%2C%2011162.16%2C%2011077.81%2C%2011127.77%2C%2011238.2%2C%2011198.13%2C%2011194.67%2C%2011109.33%2C%2011009.95%2C%2011004.53%2C%2011068.3%2C%2011033.64%2C%2011136.62%2C%2011160.69%2C%2010880.14%2C%2010770.38%2C%2010773.23%2C%2010659.19%2C%2010845.59%2C%2010774.64%2C%2010804.68%2C%2010839.22%2C%2010812.67%2C%2010857.35%2C%2010729.4%5D%3B%0Aconst%20testingData%20%3D%20%5B10978.64%2C%2011140.27%2C%2011057.39%2C%2011144.54%2C%2011212.57%2C%2011162.15%2C%2011246.01%2C%2011287.82%2C%2011290.79%2C%2011435.99%2C%2011401.99%2C%2011366.62%2C%2011258.97%2C%2011295.02%2C%2011406.27%2C%2011406.29%2C%2011404.77%2C%2011317.56%2C%2011332.3%2C%2011379.64%2C%2011285.78%2C%2011200.93%2C%2011188.42%2C%2011349.39%2C%2011283.25%2C%2011233.87%2C%2011276.28%2C%2011217.73%2C%2011130.46%2C%2011209.34%2C%2011231.91%2C%2011272.67%2C%2011194.91%2C%2011256.29%2C%2011266.68%2C%2011282.16%2C%2011300.29%2C%2011247.75%2C%2011181.77%2C%2011219.93%2C%2011098.35%2C%2011056.08%2C%2011165.58%2C%2011190.09%2C%2011147.25%2C%2011064.08%2C%2011025.26%2C%2010948.85%2C%2010765.26%2C%2010632.05%2C%2010716.72%2C%2010516.4%2C%2010719.1%2C%2010613.55%2C%2010643.64%2C%2010792.58%2C%2010782.28%2C%2010718.54%2C%2010634.04%2C%2010786.22%2C%2010839.11%2C%2010963.31%2C%2011032.21%2C%2011106.24%2C%2011093.09%2C%2011073.48%2C%2011115.4%2C%2011230.07%2C%2011265.3%2C%2011231.99%2C%2011258.95%2C%2011342.86%2C%2011311.76%2C%2011358.98%2C%2011366.22%2C%2011390.64%2C%2011460.58%2C%2011467.2%2C%2011513.12%2C%2011364.91%2C%2011361.89%2C%2011437.14%2C%2011423.33%2C%2011506.19%2C%2011456.37%2C%2011554.24%2C%2011595.25%2C%2011546.04%2C%2011447.23%2C%2011522.97%2C%2011564.73%2C%2011578.25%2C%2011519.87%2C%2011437.78%2C%2011571.16%2C%2011553.23%2C%2011484.9%2C%2011383.14%2C%2011325.26%2C%2011434.24%2C%2011282.45%2C%2011217.89%2C%2011296.28%2C%2011443.35%2C%2011415%2C%2011468.27%2C%2011348.11%2C%2011308.9%2C%2011254.42%2C%2011301.25%2C%2011327.27%2C%2011278.3%2C%2011302.83%2C%2011386.26%2C%2011306.64%2C%2011215.91%2C%2011173.65%2C%2011183.42%2C%2011221.22%2C%2011141.9%2C%2011142.65%2C%2011183.55%2C%2011170.51%2C%2011280.29%5D%3B%0A%0A%2F%2F%20further%20constants%0Aconst%20PREDICTION_LIMIT%20%3D%20trainingData.length%20%2F%202%3B%0Aconst%20GRAPH_WIDH%20%3D%20600%3B%0A%0A%2F%2F%20neural%20network%20structure%0Aconst%20MODEL_LAYERS%20%3D%20%5B%0A%09tf.layers.dense%28%7B%0A%09%09name%3A%20%27HiddenLayer1%27%2C%0A%09%09inputShape%3A%20%5BTIMESERIES_FEATURES%5D%2C%0A%09%09units%3A%20ANZAHL_HIDDEN_NEURONS%2C%0A%09%09activation%3A%20%27LeakyReLU%27%0A%09%7D%29%2C%0A%09tf.layers.dense%28%7B%0A%09%09name%3A%20%27HiddenLayer2%27%2C%0A%09%09units%3A%20ANZAHL_HIDDEN_NEURONS%2C%0A%09%09activation%3A%20%27LeakyReLU%27%0A%09%7D%29%2C%0A%09tf.layers.dense%28%7B%0A%09%09name%3A%20%27OutputLayer%27%2C%0A%09%09units%3A%201%2C%0A%09%09activation%3A%20%27linear%27%0A%09%7D%29%0A%5D%3B%0A%0A%2F%2F%20neural%20network%20algorithms%0Aconst%20MODEL_COMPILE%20%3D%20%7B%0A%09optimizer%3A%20tf.train.adam%28LERNRATE%29%2C%0A%09loss%3A%20tf.losses.absoluteDifference%0A%7D%3B%0A%0A%0A%0A%2F%2F%20%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%0A%2F%2F%20DATA%20HANDLING%20FUNCTIONS%0A%2F%2F%20%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%0A%0A%0A%2F%2F%0A%2F%2F%20create%20input%20data%0A%2F%2F%0Afunction%20createInputArray%28valueArray%29%20%7B%0A%09let%20inputArray%20%3D%20new%20Array%28valueArray.length%20-%20TIMESERIES_FEATURES%29.fill%280%29.map%28%28%29%20%3D%3E%20new%20Array%28TIMESERIES_FEATURES%29.fill%280%29%29%3B%20%2F%2F%20empty%20two-dimensional%20array%0A%09for%20%28let%20v%20%3D%200%3B%20v%20%3C%20valueArray.length%20-%20TIMESERIES_FEATURES%3B%20v%2B%2B%29%20%7B%0A%09%09for%20%28let%20f%20%3D%200%3B%20f%20%3C%20TIMESERIES_FEATURES%3B%20f%2B%2B%29%20%7B%0A%09%09%09inputArray%5Bv%5D%5Bf%5D%20%3D%20valueArray%5Bv%20%2B%20f%5D%3B%0A%09%09%7D%0A%09%7D%0A%09return%20inputArray%3B%0A%7D%0A%0A%0A%2F%2F%0A%2F%2F%20create%20output%20data%0A%2F%2F%0Afunction%20createOutputArray%28valueArray%29%20%7B%0A%09let%20outputArray%20%3D%20new%20Array%28valueArray.length%20-%20TIMESERIES_FEATURES%29.fill%280%29%3B%0A%09for%20%28v%20%3D%200%3B%20v%20%3C%20valueArray.length%20-%20TIMESERIES_FEATURES%3B%20v%2B%2B%29%20%7B%0A%09%09outputArray%5Bv%5D%20%3D%20valueArray%5Bv%20%2B%20TIMESERIES_FEATURES%5D%3B%0A%09%7D%0A%09return%20outputArray%3B%0A%7D%0A%0A%0A%0A%2F%2F%20%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%0A%2F%2F%20NEURAL%20NETWORK%20FUNCTIONS%0A%2F%2F%20%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%0A%0A%0A%2F%2F%0A%2F%2F%20build%20model%0A%2F%2F%0Afunction%20buildModel%28%29%20%7B%0A%09const%20model%20%3D%20tf.sequential%28%7B%0A%09%09layers%3A%20MODEL_LAYERS%0A%09%7D%29%3B%0A%09%2F%2F%20neural%20network%20training%0A%09model.compile%28MODEL_COMPILE%29%3B%0A%09return%20model%3B%0A%7D%0A%0A%0A%2F%2F%0A%2F%2F%20train%20model%0A%2F%2F%0Aasync%20function%20trainModel%28model%2C%20trainInput%2C%20trainOutput%29%20%7B%0A%09let%20history%20%3D%20await%20model.fit%28%0A%09%09tf.tensor%28trainInput%29%2C%20tf.tensor%28trainOutput%29%2C%20%7B%0A%09%09%09epochs%3A%20ANZAHL_EPOCHEN%20%2B%201%2C%0A%09%09%09batchSize%3A%20trainInput.length%2C%0A%09%09%09shuffle%3A%20true%2C%0A%09%09%09callbacks%3A%20%5B%0A%09%09%09%09tfvis.show.fitCallbacks%28%7B%0A%09%09%09%09%09name%3A%20%27Trainingsfehler%27%2C%0A%09%09%09%09%09tab%3A%20%27Training%27%2C%0A%09%09%09%09%09styles%3A%20%7B%0A%09%09%09%09%09%09width%3A%20GRAPH_WIDH%0A%09%09%09%09%09%7D%0A%09%09%09%09%7D%2C%20%5B%27loss%27%5D%2C%20%7B%0A%09%09%09%09%09height%3A%20200%2C%0A%09%09%09%09%09callbacks%3A%20%5B%27onEpochEnd%27%5D%2C%0A%09%09%09%09%09yLabel%3A%20%27MSE%27%0A%09%09%09%09%7D%29%2C%0A%09%09%09%5D%0A%09%09%7D%29%3B%0A%09return%20history%3B%0A%7D%0A%0A%0A%2F%2F%0A%2F%2F%20predict%20timeseries%20ahead%20and%20return%20object%20for%20tfvis%0A%2F%2F%0Aasync%20function%20predictTimeseries%28model%2C%20inputArray%2C%20observedArray%29%20%7B%0A%0A%09%2F%2F%20create%20last%20known%20input%0A%09let%20inputSample%20%3D%20%5B%5D%3B%0A%09inputSample.push%28%5B%5D%29%3B%0A%09for%20%28let%20t%20%3D%200%3B%20t%20%3C%20TIMESERIES_FEATURES%3B%20t%20%3D%20t%20%2B%201%29%20%7B%0A%09%09inputSample%5B0%5D.push%28inputArray%5BinputArray.length%20-%20TIMESERIES_FEATURES%20%2B%20t%5D%29%3B%0A%09%7D%0A%0A%09%2F%2F%20predict%20ahead%0A%09let%20outputTensor%2C%20outputArray%3B%0A%09let%20predictedOutput%20%3D%20%5B%5D%3B%0A%09for%20%28t%20%3D%200%3B%20t%20%3C%20observedArray.length%3B%20t%20%3D%20t%20%2B%201%29%20%7B%0A%09%09%2F%2F%20predict%20one%20timestep%0A%09%09outputTensor%20%3D%20await%20model.predict%28tf.tensor%28inputSample%29%29%3B%0A%09%09outputArray%20%3D%20await%20outputTensor.arraySync%28%29%3B%0A%09%09predictedOutput.push%28outputArray%5B0%5D%5B0%5D%29%3B%0A%09%09%2F%2F%20compose%20new%20input%20sample%0A%09%09inputSample%5B0%5D.shift%28%29%3B%0A%09%09inputSample%5B0%5D.push%28predictedOutput%5Bt%5D%29%3B%0A%09%7D%0A%09return%20predictedOutput%3B%0A%7D%0A%0A%0A%0A%2F%2F%20%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%0A%2F%2F%20FUNCTIONS%20FOR%20VISUALISATION%0A%2F%2F%20%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%0A%0A%2F%2F%0A%2F%2F%20draw%20timeseries%20prediction%0A%2F%2F%0Afunction%20drawTrainingData%28trainingData%29%20%7B%0A%09%2F%2F%20training%20values%0A%09let%20trainingArrayObject%20%3D%20%5B%5D%3B%0A%09for%20%28let%20t%20%3D%200%3B%20t%20%3C%20trainingData.length%3B%20t%20%3D%20t%20%2B%201%29%20%7B%0A%09%09trainingArrayObject.push%28%7B%0A%09%09%09x%3A%20t%2C%0A%09%09%09y%3A%20trainingData%5Bt%5D%20%2a%2010%0A%09%09%7D%29%3B%0A%09%7D%0A%09%2F%2F%20draw%20everything%0A%09data%20%3D%20%7B%0A%09%09values%3A%20%5BtrainingArrayObject%5D%2C%0A%09%09series%3A%20%5B%22Trainingsdaten%22%5D%0A%09%7D%3B%0A%09surface%20%3D%20%7B%0A%09%09name%3A%20%22SMI%20Trainingsdaten%202021%20%26%202022%22%2C%0A%09%09tab%3A%20%27Trainingsdaten%27%2C%0A%09%09styles%3A%20%7B%0A%09%09%09width%3A%20GRAPH_WIDH%0A%09%09%7D%0A%09%7D%3B%0A%09look%20%3D%20%7B%0A%09%09xLabel%3A%20%27Aufeinanderfolgende%20B%C3%B6rsentage%27%2C%0A%09%09yLabel%3A%20%27SMI-Index%27%2C%0A%09%09zoomToFit%3A%20true%2C%0A%09%09seriesColors%3A%20%5B%22limegreen%22%5D%0A%09%7D%3B%0A%09tfvis.render.linechart%28surface%2C%20data%2C%20look%29%3B%0A%7D%0A%0A%0A%2F%2F%0A%2F%2F%20draw%20timeseries%20prediction%0A%2F%2F%0Afunction%20drawTimeseries%28pastArray%2C%20observedArray%2C%20predictedArray%29%20%7B%0A%09%2F%2F%20past%0A%09let%20pastArrayObject%20%3D%20%5B%5D%3B%0A%09%2F%2F%20get%20past%20values%0A%09for%20%28let%20t%20%3D%200%3B%20t%20%3C%20TIMESERIES_FEATURES%3B%20t%20%3D%20t%20%2B%201%29%20%7B%0A%09%09pastArrayObject.push%28%7B%0A%09%09%09x%3A%20t%2C%0A%09%09%09y%3A%20pastArray%5Bt%20%2B%20pastArray.length%20-%20TIMESERIES_FEATURES%5D%20%2a%2010%0A%09%09%7D%29%3B%0A%09%7D%0A%09for%20%28let%20t%20%3D%20TIMESERIES_FEATURES%3B%20t%20%3C%20TIMESERIES_FEATURES%20%2B%20observedArray.length%3B%20t%20%3D%20t%20%2B%201%29%20%7B%0A%09%09pastArrayObject.push%28%7B%0A%09%09%09x%3A%20t%2C%0A%09%09%09y%3A%20null%0A%09%09%7D%29%3B%0A%09%7D%0A%09%2F%2F%20observed%20values%0A%09let%20observedArrayObject%20%3D%20%5B%5D%3B%0A%09for%20%28let%20t%20%3D%200%3B%20t%20%3C%20TIMESERIES_FEATURES%20-%201%3B%20t%20%3D%20t%20%2B%201%29%20%7B%0A%09%09observedArrayObject.push%28%7B%0A%09%09%09x%3A%20t%2C%0A%09%09%09y%3A%20null%0A%09%09%7D%29%3B%0A%09%7D%0A%09observedArrayObject.push%28%7B%0A%09%09x%3A%20TIMESERIES_FEATURES%20-%201%2C%0A%09%09y%3A%20pastArray%5BpastArray.length%20-%201%5D%20%2a%2010%0A%09%7D%29%3B%0A%09for%20%28let%20t%20%3D%20TIMESERIES_FEATURES%3B%20t%20%3C%20TIMESERIES_FEATURES%20%2B%20observedArray.length%3B%20t%20%3D%20t%20%2B%201%29%20%7B%0A%09%09observedArrayObject.push%28%7B%0A%09%09%09x%3A%20t%2C%0A%09%09%09y%3A%20observedArray%5Bt%20-%20TIMESERIES_FEATURES%5D%20%2a%2010%0A%09%09%7D%29%3B%0A%09%7D%0A%09%2F%2F%20predicted%20values%0A%09let%20predictedArrayObject%20%3D%20%5B%5D%3B%0A%09for%20%28let%20t%20%3D%200%3B%20t%20%3C%20TIMESERIES_FEATURES%20-%201%3B%20t%20%3D%20t%20%2B%201%29%20%7B%0A%09%09predictedArrayObject.push%28%7B%0A%09%09%09x%3A%20t%2C%0A%09%09%09y%3A%20null%0A%09%09%7D%29%3B%0A%09%7D%0A%09predictedArrayObject.push%28%7B%0A%09%09x%3A%20TIMESERIES_FEATURES%20-%201%2C%0A%09%09y%3A%20pastArray%5BpastArray.length%20-%201%5D%20%2a%2010%0A%09%7D%29%3B%0A%09for%20%28let%20t%20%3D%20TIMESERIES_FEATURES%3B%20t%20%3C%20TIMESERIES_FEATURES%20%2B%20observedArray.length%3B%20t%20%3D%20t%20%2B%201%29%20%7B%0A%09%09predictedArrayObject.push%28%7B%0A%09%09%09x%3A%20t%2C%0A%09%09%09y%3A%20predictedArray%5Bt%20-%20TIMESERIES_FEATURES%5D%20%2a%2010%0A%09%09%7D%29%3B%0A%09%7D%0A%09%2F%2F%20draw%20everything%0A%09data%20%3D%20%7B%0A%09%09values%3A%20%5BobservedArrayObject%2C%20predictedArrayObject%2C%20pastArrayObject%5D%2C%0A%09%09series%3A%20%5B%22beobachtet%22%2C%20%22vorhergesagt%22%2C%20%22vergangen%22%5D%0A%09%7D%3B%0A%09surface%20%3D%20%7B%0A%09%09name%3A%20%22SMI%20Vorhersage%201te%20Jahresh%C3%A4lfte%202023%22%2C%0A%09%09tab%3A%20%27Resultat%27%2C%0A%09%09styles%3A%20%7B%0A%09%09%09width%3A%20GRAPH_WIDH%0A%09%09%7D%0A%09%7D%3B%0A%09look%20%3D%20%7B%0A%09%09xLabel%3A%20%27Aufeinanderfolgende%20B%C3%B6rsentage%27%2C%0A%09%09yLabel%3A%20%27SMI-Index%27%2C%0A%09%09zoomToFit%3A%20true%2C%0A%09%09seriesColors%3A%20%5B%22coral%22%2C%20%22saddlebrown%22%2C%20%22limegreen%22%5D%0A%09%7D%3B%0A%09tfvis.render.linechart%28surface%2C%20data%2C%20look%29%3B%0A%7D%0A%0A%0A%0A%2F%2F%20%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%0A%2F%2F%20MAIN%20PROGRAM%0A%2F%2F%20%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%0A%0A%0A%2F%2F%0A%2F%2F%20main%20function%0A%2F%2F%0Aasync%20function%20run%28%29%20%7B%0A%09%2F%2Fnoprotect%0A%0A%09%2F%2F%20check%20for%20too%20many%20input%20features%0A%09if%20%28TIMESERIES_FEATURES%20%3E%20PREDICTION_LIMIT%29%20%7B%0A%09%09console.log%28%22%E2%9A%A0%EF%B8%8F%20Die%20Anzahl%20TIMESERIES_FEATURES%20ist%20zu%20hoch%21%22%29%3B%0A%09%09return%3B%0A%09%7D%0A%0A%09%2F%2F%20write%20preferences%20on%20console%0A%09console.log%28%22SMI-Vorhersage%22%29%3B%0A%09console.log%28%22Neuronales%20Netz%3A%20Anzahl%20Eingangsgr%C3%B6ssen%3A%20%22%20%2B%20TIMESERIES_FEATURES%20%2B%20%22%2C%20Anzahl%20Hidden%20Neuronen%3A%20%22%20%2B%20ANZAHL_HIDDEN_NEURONS%29%3B%0A%09console.log%28%22Training%3A%20Lernrate%3A%20%22%20%2B%20LERNRATE%20%2B%20%22%2C%20Epochen%3A%20%22%20%2B%20ANZAHL_EPOCHEN%29%3B%0A%0A%09drawTrainingData%28trainingData%29%3B%0A%0A%09%2F%2F%20create%20input%20and%20output%20data%0A%09let%20inputArray%20%3D%20createInputArray%28trainingData%29%3B%0A%09let%20outputArray%20%3D%20createOutputArray%28trainingData%29%3B%0A%0A%09%2F%2F%20build%20and%20show%20model%0A%09let%20model%20%3D%20buildModel%28%29%3B%0A%09if%20%28%21tfvis.visor%28%29.isFullscreen%28%29%29%20%7B%0A%09%09tfvis.visor%28%29.toggleFullScreen%28%29%3B%0A%09%7D%0A%09tfvis.show.modelSummary%28%7B%0A%09%09name%3A%20%27Neuronales%20Netz%27%2C%0A%09%09tab%3A%20%27Modell%27%2C%0A%09%09styles%3A%20%7B%0A%09%09%09width%3A%20GRAPH_WIDH%0A%09%09%7D%0A%09%7D%2C%20model%29%3B%0A%0A%09%2F%2F%20train%20model%0A%09let%20history%20%3D%20await%20trainModel%28model%2C%20inputArray%2C%20outputArray%29%3B%0A%09console.log%28%22Entg%C3%BCltiger%20Trainingsfehler%20%28MSE%29%3A%20%22%20%2B%20history.history.loss%5BANZAHL_EPOCHEN%5D%29%3B%0A%0A%09%2F%2F%20predict%20and%20show%20timeseries%0A%09let%20predictedTimeseries%20%3D%20await%20predictTimeseries%28model%2C%20trainingData%2C%20testingData%29%3B%0A%09drawTimeseries%28trainingData%2C%20testingData%2C%20predictedTimeseries%29%3B%0A%0A%7D%0A%0A%0Adocument.addEventListener%28%27DOMContentLoaded%27%2C%20run%29%3B&css=undefined&html=%3Cscript%20src%3D%22https%3A%2F%2Fapp.exorciser.ch%2Flib%2Fp5.js%22%3E%3C%2Fscript%3E%0A%3Cscript%20src%3D%22https%3A%2F%2Fcdn.jsdelivr.net%2Fnpm%2F%40tensorflow%2Ftfjs%40latest%2Fdist%2Ftf.min.js%22%3E%3C%2Fscript%3E%0A%3Cscript%20src%3D%22https%3A%2F%2Fcdn.jsdelivr.net%2Fnpm%2F%40tensorflow%2Ftfjs-vis%22%3E%3C%2Fscript%3E&autorun=off&height=700px#SMI}}
  
 == ✍ Auftrag SMI – Teil 2 == == ✍ Auftrag SMI – Teil 2 ==