From ce5ff7d8948c5a35e199bb18e11359f898d5c680 Mon Sep 17 00:00:00 2001 From: ZarebaMichal Date: Mon, 23 May 2022 11:08:56 +0200 Subject: [PATCH] test new nn --- run3.py | 56 ++ test-A/out.tsv | 1440 ++++++++++++++++++++++++------------------------ 2 files changed, 776 insertions(+), 720 deletions(-) create mode 100644 run3.py diff --git a/run3.py b/run3.py new file mode 100644 index 0000000..3b9a3f1 --- /dev/null +++ b/run3.py @@ -0,0 +1,56 @@ +import pandas as pd + +import tensorflow.keras + +import numpy as np +import pandas as pd +import xgboost as xg + +import tensorflow.keras +from tensorflow.keras.models import Sequential +from tensorflow.keras.layers import Dense + +in_columns = ["id_stacji", "nazwa_stacji", "typ_zbioru", "rok", "miesiąc"] +df = pd.read_csv("train/in.tsv", names=in_columns, sep="\t") +df_test = pd.read_csv("dev-0/in.tsv", names=in_columns, sep="\t") + +df = pd.concat([df, df_test]) +x = pd.get_dummies(df, columns=["id_stacji", "rok", "miesiąc"]) +x = x.drop(["nazwa_stacji", "typ_zbioru"], axis=1) +x = x.iloc[:-600] +y = pd.read_csv("train/expected.tsv", sep="\t", names=["rainfall"]) + +model = Sequential( + [ + Dense(1024, activation="relu", input_dim=73), + Dense(512, activation="relu"), + tensorflow.keras.layers.BatchNormalization(), + Dense(512 // 2, activation="relu"), + tensorflow.keras.layers.BatchNormalization(), + Dense(512 // 4, activation="relu"), + tensorflow.keras.layers.BatchNormalization(), + Dense(512 // 8, activation="relu"), + tensorflow.keras.layers.BatchNormalization(), + Dense(32, activation="relu"), + tensorflow.keras.layers.BatchNormalization(), + Dense(1, activation="linear"), + ] +) + +model.compile( + loss="mean_squared_error", optimizer="adam", metrics=["mean_squared_error"] +) +model.fit(x, y, epochs=100) + +x_test = pd.read_csv("test-A/in.tsv", sep="\t", names=in_columns) +df_train = pd.read_csv("train/in.tsv", names=in_columns, sep="\t") + +x_test = pd.concat([x_test, df_train]) + +x_test = x_test.drop(["nazwa_stacji", "typ_zbioru"], axis=1) +x_test = pd.get_dummies(x_test, columns=["id_stacji", "rok", "miesiąc"]) +x_test = x_test.iloc[:-8760] + +pred = model.predict(x_test) +out = pd.DataFrame(pred) +out.to_csv("test-A/out.tsv", sep="\t", header=False, index=False) diff --git a/test-A/out.tsv b/test-A/out.tsv index e676e98..e65d9bc 100644 --- a/test-A/out.tsv +++ b/test-A/out.tsv @@ -1,720 +1,720 @@ -33.892586 -29.666046 -33.892586 -33.892586 -65.426674 -85.68984 -191.33154 -63.550583 -38.897713 -33.892586 -32.94632 -33.892586 -33.892586 -29.666046 -33.892586 -33.892586 -56.884327 -71.790726 -191.33154 -63.550583 -38.897713 -33.892586 -32.94632 -33.892586 -33.892586 -29.666046 -33.892586 -33.892586 -56.884327 -71.790726 -191.33154 -63.550583 -38.897713 -33.892586 -32.94632 -33.892586 -33.892586 -29.666046 -33.892586 -33.892586 -55.80433 -71.790726 -191.33154 -63.550583 -38.897713 -33.892586 -32.94632 -33.892586 -33.892586 -29.666046 -33.892586 -33.892586 -56.434795 -71.790726 -191.33154 -63.550583 -38.897713 -33.892586 -32.94632 -33.892586 -33.892586 -29.666046 -33.892586 -33.892586 -56.884327 -71.790726 -191.33154 -63.550583 -38.897713 -33.892586 -32.94632 -33.892586 -35.661835 -29.7 -35.661835 -35.661835 -65.426674 -85.68984 -76.97859 -63.550583 -49.30011 -35.661835 -35.661835 -35.661835 -35.661835 -29.7 -35.661835 -35.661835 -56.884327 -71.790726 -76.37664 -63.550583 -49.30011 -35.661835 -35.661835 -35.661835 -35.661835 -29.7 -35.661835 -35.661835 -56.884327 -71.790726 -76.37664 -63.550583 -49.30011 -35.661835 -35.661835 -35.661835 -35.661835 -29.7 -35.661835 -35.661835 -55.80433 -71.790726 -76.37664 -63.550583 -49.30011 -35.661835 -35.661835 -35.661835 -35.661835 -29.7 -35.661835 -35.661835 -56.434795 -71.790726 -76.37664 -63.550583 -49.30011 -35.661835 -35.661835 -35.661835 -35.661835 -29.7 -35.661835 -35.661835 -56.884327 -71.790726 -76.37664 -63.550583 -49.30011 -35.661835 -35.661835 -35.661835 -35.661835 -29.7 -35.661835 -35.661835 -66.628815 -85.68984 -72.01687 -63.550583 -49.30011 -35.661835 -35.661835 -35.661835 -35.661835 -29.7 -35.661835 -35.661835 -58.5 -71.790726 -71.42559 -63.550583 -49.30011 -35.661835 -35.661835 -35.661835 -35.661835 -29.7 -35.661835 -35.661835 -58.5 -71.790726 -71.42559 -63.550583 -49.30011 -35.661835 -35.661835 -35.661835 -35.661835 -29.7 -35.661835 -35.661835 -57.453407 -71.790726 -71.42559 -63.550583 -49.30011 -35.661835 -35.661835 -35.661835 -35.661835 -29.7 -35.661835 -35.661835 -58.075397 -71.790726 -71.42559 -63.550583 -49.30011 -35.661835 -35.661835 -35.661835 -35.661835 -29.7 -35.661835 -35.661835 -58.5 -71.790726 -71.42559 -63.550583 -49.30011 -35.661835 -35.661835 -35.661835 -35.661835 -29.7 -35.661835 -35.661835 -65.426674 -85.68984 -76.97859 -63.550583 -49.30011 -35.661835 -35.661835 -35.661835 -35.661835 -29.7 -35.661835 -35.661835 -56.884327 -71.790726 -76.37664 -63.550583 -49.30011 -35.661835 -35.661835 -35.661835 -35.661835 -29.7 -35.661835 -35.661835 -56.884327 -71.790726 -76.37664 -63.550583 -49.30011 -35.661835 -35.661835 -35.661835 -35.661835 -29.7 -35.661835 -35.661835 -55.80433 -71.790726 -76.37664 -63.550583 -49.30011 -35.661835 -35.661835 -35.661835 -35.661835 -29.7 -35.661835 -35.661835 -56.434795 -71.790726 -76.37664 -63.550583 -49.30011 -35.661835 -35.661835 -35.661835 -35.661835 -29.7 -35.661835 -35.661835 -56.884327 -71.790726 -76.37664 -63.550583 -49.30011 -35.661835 -35.661835 -35.661835 -35.661835 -29.7 -35.661835 -35.661835 -65.426674 -29.935213 -76.97859 -10.856379 -49.30011 -35.661835 -35.661835 -35.661835 -35.661835 -29.7 -35.661835 -35.661835 -56.884327 -25.389996 -76.37664 -10.856379 -49.30011 -35.661835 -35.661835 -35.661835 -35.661835 -29.7 -35.661835 -35.661835 -56.884327 -25.389996 -76.37664 -10.856379 -49.30011 -35.661835 -35.661835 -35.661835 -35.661835 -29.7 -35.661835 -35.661835 -55.80433 -25.389996 -76.37664 -10.856379 -49.30011 -35.661835 -35.661835 -35.661835 -35.661835 -29.7 -35.661835 -35.661835 -56.434795 -25.389996 -76.37664 -10.856379 -49.30011 -35.661835 -35.661835 -35.661835 -35.661835 -29.7 -35.661835 -35.661835 -56.884327 -25.389996 -76.37664 -10.856379 -49.30011 -35.661835 -35.661835 -35.661835 -35.661835 -33.2 -35.661835 -35.661835 -65.426674 -85.68984 -76.97859 -63.550583 -49.30011 -35.661835 -35.661835 -35.661835 -35.661835 -33.2 -35.661835 -35.661835 -56.884327 -71.790726 -76.37664 -63.550583 -49.30011 -35.661835 -35.661835 -35.661835 -35.661835 -33.2 -35.661835 -35.661835 -56.884327 -71.790726 -76.37664 -63.550583 -49.30011 -35.661835 -35.661835 -35.661835 -35.661835 -33.2 -35.661835 -35.661835 -55.80433 -71.790726 -76.37664 -63.550583 -49.30011 -35.661835 -35.661835 -35.661835 -35.661835 -33.2 -35.661835 -35.661835 -56.434795 -71.790726 -76.37664 -63.550583 -49.30011 -35.661835 -35.661835 -35.661835 -35.661835 -33.2 -35.661835 -35.661835 -56.884327 -71.790726 -76.37664 -63.550583 -49.30011 -35.661835 -35.661835 -35.661835 -35.661835 -29.7 -35.661835 -35.661835 -65.426674 -85.68984 -76.97859 -63.550583 -66.368546 -35.661835 -35.661835 -35.661835 -35.661835 -29.7 -35.661835 -35.661835 -56.884327 -71.790726 -76.37664 -63.550583 -66.368546 -35.661835 -35.661835 -35.661835 -35.661835 -29.7 -35.661835 -35.661835 -56.884327 -71.790726 -76.37664 -63.550583 -66.368546 -35.661835 -35.661835 -35.661835 -35.661835 -29.7 -35.661835 -35.661835 -55.80433 -71.790726 -76.37664 -63.550583 -66.368546 -35.661835 -35.661835 -35.661835 -35.661835 -29.7 -35.661835 -35.661835 -56.434795 -71.790726 -76.37664 -63.550583 -66.368546 -35.661835 -35.661835 -35.661835 -35.661835 -29.7 -35.661835 -35.661835 -56.884327 -71.790726 -76.37664 -63.550583 -66.368546 -35.661835 -35.661835 -35.661835 -35.661835 -29.7 -35.661835 -35.661835 -65.426674 -85.68984 -76.97859 -63.550583 -49.30011 -35.661835 -35.661835 -35.661835 -35.661835 -29.7 -35.661835 -35.661835 -56.884327 -71.790726 -76.37664 -63.550583 -49.30011 -35.661835 -35.661835 -35.661835 -35.661835 -29.7 -35.661835 -35.661835 -56.884327 -71.790726 -76.37664 -63.550583 -49.30011 -35.661835 -35.661835 -35.661835 -35.661835 -29.7 -35.661835 -35.661835 -55.80433 -71.790726 -76.37664 -63.550583 -49.30011 -35.661835 -35.661835 -35.661835 -35.661835 -29.7 -35.661835 -35.661835 -56.434795 -71.790726 -76.37664 -63.550583 -49.30011 -35.661835 -35.661835 -35.661835 -35.661835 -29.7 -35.661835 -35.661835 -56.884327 -71.790726 -76.37664 -63.550583 -49.30011 -35.661835 -35.661835 -35.661835 -35.661835 -29.7 -35.661835 -35.661835 -65.426674 -44.623817 -76.97859 -63.550583 -49.30011 -35.661835 -35.661835 -35.661835 -35.661835 -29.7 -35.661835 -35.661835 -56.884327 -37.2 -76.37664 -63.550583 -49.30011 -35.661835 -35.661835 -35.661835 -35.661835 -29.7 -35.661835 -35.661835 -56.884327 -37.2 -76.37664 -63.550583 -49.30011 -35.661835 -35.661835 -35.661835 -35.661835 -29.7 -35.661835 -35.661835 -55.80433 -37.2 -76.37664 -63.550583 -49.30011 -35.661835 -35.661835 -35.661835 -35.661835 -29.7 -35.661835 -35.661835 -56.434795 -37.2 -76.37664 -63.550583 -49.30011 -35.661835 -35.661835 -35.661835 -35.661835 -29.7 -35.661835 -35.661835 -56.884327 -37.2 -76.37664 -63.550583 -49.30011 -35.661835 -35.661835 -35.661835 -35.661835 -29.7 -35.661835 -35.661835 -65.426674 -85.68984 -76.97859 -63.550583 -49.30011 -35.661835 -35.661835 -35.661835 -35.661835 -29.7 -35.661835 -35.661835 -56.884327 -71.790726 -76.37664 -63.550583 -49.30011 -35.661835 -35.661835 -35.661835 -35.661835 -29.7 -35.661835 -35.661835 -56.884327 -71.790726 -76.37664 -63.550583 -49.30011 -35.661835 -35.661835 -35.661835 -35.661835 -29.7 -35.661835 -35.661835 -55.80433 -71.790726 -76.37664 -63.550583 -49.30011 -35.661835 -35.661835 -35.661835 -35.661835 -29.7 -35.661835 -35.661835 -56.434795 -71.790726 -76.37664 -63.550583 -49.30011 -35.661835 -35.661835 -35.661835 -35.661835 -29.7 -35.661835 -35.661835 -56.884327 -71.790726 -76.37664 -63.550583 -49.30011 -35.661835 -35.661835 -35.661835 +33.33115 +25.774557 +32.62025 +47.01106 +102.79405 +118.389824 +305.94064 +72.66539 +24.457855 +46.11544 +-2.2919116 +39.60803 +29.587166 +23.014507 +24.079273 +37.66923 +88.056 +94.00244 +232.36874 +59.504307 +19.15193 +42.188404 +-0.7887874 +33.659683 +32.449627 +33.86618 +26.101343 +33.105316 +58.999187 +53.247334 +211.71944 +55.825382 +13.263187 +31.62433 +4.76395 +36.38599 +46.25124 +21.031141 +15.771586 +35.99354 +39.188156 +34.763676 +150.2383 +43.648514 +11.925796 +22.955873 +7.7476063 +33.396282 +39.32974 +23.88153 +18.886833 +43.830807 +37.586285 +47.837406 +287.3785 +57.14909 +11.505504 +28.32895 +9.550438 +32.76406 +40.81348 +35.898582 +20.10094 +42.821693 +64.10017 +59.59196 +154.89467 +57.374756 +31.909016 +29.472647 +9.735096 +37.03486 +83.7425 +58.001377 +44.740097 +48.84254 +86.98155 +133.82112 +128.1443 +66.22949 +56.166927 +91.48869 +35.840282 +35.783978 +47.96712 +33.73058 +25.237259 +45.165905 +38.636517 +86.457886 +77.883736 +36.926525 +39.71773 +88.4716 +27.015041 +24.508987 +57.19738 +29.488651 +26.16687 +34.1575 +49.8103 +53.719757 +85.10645 +40.370594 +32.925747 +55.221153 +32.27791 +30.749619 +63.13213 +23.408428 +23.83663 +29.87712 +30.252777 +50.917774 +61.511883 +39.53704 +32.566456 +54.899113 +35.656254 +38.009644 +63.259937 +27.172676 +23.02349 +42.871464 +43.857216 +66.526794 +69.19168 +51.890553 +33.99715 +61.95657 +34.401596 +36.090706 +65.18982 +35.975803 +38.863045 +57.196716 +83.48476 +73.42712 +80.56126 +63.139606 +45.476875 +67.662674 +39.059834 +39.311848 +66.06819 +46.90759 +65.4706 +42.63906 +107.55908 +185.17505 +44.338802 +85.5622 +99.58052 +26.917734 +62.897373 +26.565472 +50.792377 +32.93986 +50.985527 +41.72007 +103.07778 +104.74053 +47.679523 +48.07136 +97.05017 +26.981789 +48.0743 +21.064205 +54.19911 +40.412895 +56.571964 +31.740253 +92.51033 +78.535866 +51.8407 +58.186802 +89.27605 +18.15468 +45.344173 +28.091211 +68.301994 +38.259335 +52.063168 +32.509907 +101.64395 +87.3611 +42.142048 +28.215836 +84.803566 +20.03694 +52.80368 +34.401295 +59.03263 +37.04216 +49.63654 +31.096771 +66.51346 +61.85341 +45.10043 +29.571943 +73.89264 +21.227028 +39.847042 +30.366486 +49.27275 +37.779564 +47.64458 +53.947994 +96.33113 +84.64943 +38.659065 +29.64724 +99.12156 +28.813053 +46.660824 +29.605616 +34.694584 +33.910213 +65.3078 +77.69229 +218.25587 +68.71698 +172.35823 +111.02654 +67.27016 +54.488518 +23.875584 +33.81764 +33.116817 +19.012852 +48.083942 +47.356556 +114.599686 +72.04959 +119.87623 +83.32821 +55.66306 +40.448063 +25.56031 +25.93074 +43.97121 +19.457222 +40.26323 +42.5294 +67.34179 +54.791916 +82.11747 +67.436264 +20.139685 +25.948902 +22.760311 +54.70743 +51.74751 +17.563705 +40.0936 +54.194298 +47.55448 +55.838757 +65.94196 +81.028656 +31.568253 +22.981197 +23.580841 +66.6569 +45.046562 +16.63411 +31.777763 +49.968395 +55.283978 +62.60431 +62.008762 +87.62891 +20.49332 +21.438759 +27.558617 +65.89465 +51.4098 +21.547222 +38.881428 +49.117092 +79.68316 +69.87935 +62.787556 +64.61188 +27.184841 +21.490543 +28.252094 +64.6727 +73.14146 +34.18241 +60.655666 +45.08775 +107.74944 +46.127285 +68.8168 +32.21666 +102.24794 +49.36497 +83.81883 +23.27288 +50.203342 +19.96442 +44.88846 +33.55085 +87.47673 +27.806564 +58.819996 +30.391632 +64.94986 +40.475048 +66.65708 +14.489675 +52.53087 +20.00814 +41.290073 +31.139324 +63.24765 +16.001972 +56.20155 +27.82849 +27.802776 +37.34219 +48.055763 +28.359291 +65.18175 +17.194637 +48.34859 +30.762707 +50.203228 +24.15602 +59.224922 +26.378145 +34.58577 +30.831028 +52.473484 +47.2522 +58.67613 +19.478994 +37.17262 +35.16567 +48.090576 +21.396713 +45.604336 +29.842041 +31.101809 +34.39603 +48.220608 +32.061207 +61.133926 +13.061402 +45.525925 +37.235363 +74.725525 +27.294546 +61.862885 +5.063665 +44.206844 +27.946732 +68.060745 +42.49656 +48.064625 +91.84654 +40.755753 +75.471054 +80.937874 +91.62353 +145.75414 +75.50539 +42.328526 +111.068634 +54.956917 +54.356937 +31.431868 +80.63228 +30.805683 +57.82146 +45.978664 +73.36685 +107.221924 +52.47182 +35.672413 +103.31047 +37.337437 +37.89095 +30.876488 +65.71541 +44.258556 +31.209381 +29.179996 +38.46411 +94.55202 +43.338364 +10.108077 +78.01058 +37.79131 +42.208015 +45.809948 +54.87938 +54.524532 +42.39081 +24.592833 +42.178513 +80.673416 +50.625633 +29.085333 +94.75247 +47.99725 +46.86017 +27.276882 +63.111256 +41.610588 +36.37559 +25.935791 +36.87005 +74.9906 +45.931164 +22.477467 +84.17645 +37.181164 +42.35867 +31.802166 +66.05354 +50.780876 +44.84682 +46.86106 +52.351192 +90.387505 +55.02396 +16.464891 +112.6284 +57.024006 +47.89606 +28.354424 +40.05043 +52.876324 +117.94791 +88.15607 +98.89781 +126.928696 +88.39539 +139.66182 +87.31986 +59.43957 +42.163754 +22.882427 +40.00003 +47.707138 +121.17689 +74.07817 +61.315315 +79.95505 +78.898155 +130.6089 +85.65296 +50.62357 +30.330742 +12.085677 +38.743202 +49.53206 +49.819607 +41.737553 +59.581905 +123.2855 +64.58608 +85.10538 +57.11617 +43.046345 +42.726322 +17.705225 +40.67475 +43.266582 +59.689472 +35.60179 +67.4934 +116.96993 +64.28119 +76.90527 +93.22879 +48.280533 +41.175255 +14.619488 +40.120083 +49.69147 +60.127163 +40.18321 +47.900917 +103.77247 +63.300175 +75.037796 +76.18939 +45.039837 +35.00032 +15.86482 +33.47961 +46.30117 +56.749844 +44.103714 +77.65045 +88.312546 +50.523502 +104.5366 +90.23241 +48.754673 +41.46471 +24.6656 +31.068039 +45.50609 +25.958727 +83.83094 +104.62266 +119.89091 +92.40983 +68.26745 +61.66059 +16.539827 +68.17172 +24.262291 +19.774036 +26.153534 +21.00843 +81.0227 +103.909355 +98.305336 +51.87306 +43.145332 +51.055153 +14.314572 +59.849243 +29.505047 +25.256166 +30.236876 +26.188835 +41.327114 +42.19491 +113.44598 +43.989384 +31.533815 +36.85807 +17.512665 +58.42911 +43.2227 +17.512482 +28.68562 +31.256763 +34.45438 +35.819695 +91.4854 +50.09736 +31.752567 +35.440075 +20.790382 +62.142162 +38.183826 +18.237267 +25.745388 +34.100677 +41.251186 +40.45164 +98.10728 +48.674232 +33.764545 +37.496284 +18.459341 +59.82885 +36.158497 +28.399536 +28.378975 +47.00145 +42.353092 +38.280365 +111.428024 +57.32303 +48.57062 +50.896454 +23.87004 +66.11594 +78.96204 +30.152824 +48.7548 +55.689884 +122.46475 +66.65101 +77.55439 +105.66431 +77.31966 +42.70169 +52.678127 +60.553684 +59.174324 +29.59549 +41.323685 +50.448956 +115.2337 +46.22728 +71.31791 +103.33736 +83.424255 +37.35537 +42.801884 +43.408264 +42.206585 +19.129583 +37.341843 +23.449131 +80.31066 +17.646309 +67.64615 +59.463108 +40.058582 +29.87539 +19.833231 +47.427555 +49.14266 +24.959606 +30.039341 +20.258577 +76.54734 +21.979223 +64.766914 +52.714252 +40.81725 +27.446238 +23.20452 +47.60533 +43.47174 +23.482414 +32.026947 +18.005304 +71.80657 +20.652346 +58.44563 +58.69355 +44.512745 +31.002764 +22.3149 +41.09611 +55.478443 +21.324425 +40.06915 +27.031998 +92.3869 +32.54215 +55.960407 +57.97925 +64.86492 +33.09129 +27.298119 +43.212246 +20.22256 +89.051994 +38.08531 +22.157505 +131.72966 +142.26523 +106.95498 +89.94412 +73.845116 +96.8925 +19.67561 +41.042995 +21.296553 +62.621487 +27.848934 +14.069723 +96.35399 +138.60774 +71.45557 +77.19742 +59.02123 +103.47969 +22.858793 +26.368277 +29.894642 +50.157154 +27.592041 +22.046045 +79.52367 +80.14101 +36.224396 +87.60098 +32.337246 +64.740074 +18.645044 +40.673523 +39.94306 +40.85007 +33.662457 +17.055511 +56.713104 +73.11963 +40.361774 +85.49832 +30.969715 +74.17249 +27.017136 +36.985176 +29.024412 +41.1488 +22.051533 +21.178905 +68.58583 +77.37372 +42.612103 +97.17133 +34.413418 +73.77813 +21.59378 +37.188988 +38.661663 +57.81132 +34.92458 +16.581732 +103.927185 +123.57844 +69.50271 +70.434616 +49.216755 +75.77768 +22.204298 +41.84702