dev
All checks were successful
s434765-training/pipeline/head This commit looks good

This commit is contained in:
Karolina Oparczyk 2021-05-17 20:04:15 +02:00
parent ed16ad4d5c
commit 3d254d98a6
3 changed files with 426 additions and 11 deletions

View File

@ -12,7 +12,7 @@ node {
}
stage('Clone repo') {
docker.image("karopa/ium:05").inside {
docker.image("karopa/ium:06").inside {
stage('Test') {
checkout([$class: 'GitSCM', branches: [[name: '*/master']], doGenerateSubmoduleConfigurations: false, extensions: [], submoduleCfg: [], userRemoteConfigs: [[url: 'https://git.wmi.amu.edu.pl/s434765/ium_434765']]])
copyArtifacts fingerprintArtifacts: true, projectName: 's434765-create-dataset', selector: buildParameter("BUILD_SELECTOR")

View File

@ -1,6 +1,7 @@
import pandas as pd
import numpy as np
from keras import optimizers
from sklearn.metrics import mean_squared_error
from tensorflow import keras
@ -28,18 +29,20 @@ print(max_val_like)
model = keras.Sequential([
keras.layers.Dense(32,input_dim = X.shape[1], activation='relu'),
keras.layers.Dense(64, activation='relu'),
keras.layers.Dense(1,activation='relu'),
keras.layers.Dense(512,input_dim = X.shape[1], activation='relu'),
keras.layers.Dense(256, activation='relu'),
keras.layers.Dense(256, activation='relu'),
keras.layers.Dense(128, activation='relu'),
keras.layers.Dense(1,activation='linear'),
])
model.compile(loss='mean_absolute_error', optimizer="Adam", metrics=['mean_absolute_error'])
model.fit(X, y, epochs=15, validation_split = 0.3)
model.fit(X, y, epochs=30, validation_split = 0.3)
data = pd.read_csv("data_dev", sep=',', error_bad_lines=False).dropna()
X_test = data.loc[:,data.columns == "2805317"].astype(int)
y_test = data.loc[:,data.columns == "198909"].astype(int)
X_test = data.loc[:,data.columns == "440265"].astype(int)
y_test = data.loc[:,data.columns == "21629"].astype(int)
min_val_sub = np.min(X_test)
max_val_sub = np.max(X_test)
@ -49,13 +52,19 @@ print(max_val_sub)
min_val_like = np.min(y_test)
max_val_like = np.max(y_test)
y_test = (y_test - min_val_like) / (max_val_like - min_val_like)
print(min_val_like)
print(max_val_like)
prediction = model.predict(X_test)
prediction_denormalized = []
for pred in prediction:
denorm = pred[0] * (max_val_like[0] - min_val_like[0]) + min_val_like[0]
prediction_denormalized.append(denorm)
f = open("predictions.txt", "w")
for (pred, test) in zip(prediction, y_test.values):
f.write("predicted: %s expected: %s\n" % (str(pred), str(test)))
for (pred, test) in zip(prediction_denormalized, y_test.values):
f.write("predicted: %s expected: %s\n" % (str(pred), str(test[0])))
error = mean_squared_error(y_test, prediction_denormalized)
print(error)

406
predictions.txt Normal file
View File

@ -0,0 +1,406 @@
predicted: 42803.13399100304 expected: 99803
predicted: -440.50057288474636 expected: 12436
predicted: 9096.48258971516 expected: 26510
predicted: 15059.254331899807 expected: 54016
predicted: 14779.027984969318 expected: 8335
predicted: -1048.419759948505 expected: 523
predicted: 4162.728378499858 expected: 11434
predicted: 6076.9264799859375 expected: 6045
predicted: 8906.77706775628 expected: 17659
predicted: -275.11887871992076 expected: 6673
predicted: 22976.2852220349 expected: 230
predicted: -873.6253243730753 expected: 1395
predicted: 7387.914224016946 expected: 33556
predicted: 20133.238321926445 expected: 62338
predicted: -1394.7200996365864 expected: 6490
predicted: 43515.973756019026 expected: 73435
predicted: -2354.6053545435425 expected: 213
predicted: -852.5803109296248 expected: 8963
predicted: 12757.92553338036 expected: 12414
predicted: -2684.9189116803464 expected: 427
predicted: -306.64225712552434 expected: 1351
predicted: -509.9318278985447 expected: 1116
predicted: -2397.3568560665008 expected: 634
predicted: 24697.15639975667 expected: 13688
predicted: -1773.096863614628 expected: 4171
predicted: 41920.75953288004 expected: 100843
predicted: -2671.4035936596338 expected: 15
predicted: 3184.862200021278 expected: 2231
predicted: -2487.3598300600424 expected: 1345
predicted: -2092.4485702079255 expected: 381
predicted: -1689.760539580835 expected: 3131
predicted: -1666.0559999358375 expected: 1192
predicted: 370.37027830124134 expected: 8909
predicted: -2122.778047331143 expected: 2883
predicted: -2211.753614464309 expected: 2465
predicted: -1431.4453325923532 expected: 3970
predicted: 3469.6212242769543 expected: 6464
predicted: 5293.091123397462 expected: 14139
predicted: 1483.9084952266421 expected: 8665
predicted: 334.81358733511297 expected: 6932
predicted: 4162.98386744922 expected: 17620
predicted: 11045.168381326832 expected: 12060
predicted: 1064.0826782610966 expected: 10933
predicted: 12786.04164195247 expected: 2435
predicted: -2191.8138632799964 expected: 1633
predicted: 6911.031064881943 expected: 32256
predicted: -1571.349943649955 expected: 3331
predicted: 5319.175644516945 expected: 6686
predicted: 481.45677868282655 expected: 5293
predicted: 45439.83303703368 expected: 38119
predicted: 5489.951757954899 expected: 2622
predicted: 723.9620071610552 expected: 5214
predicted: 2110.069723626366 expected: 5979
predicted: -1425.5389874095563 expected: 3885
predicted: -2457.1085638396908 expected: 125
predicted: 14688.27489731647 expected: 43318
predicted: -2166.875013386132 expected: 5873
predicted: -1613.0915765149985 expected: 4889
predicted: -1595.8086260007694 expected: 7932
predicted: 36791.20503734797 expected: 56187
predicted: -1489.061645714566 expected: 2305
predicted: 75515.34371646494 expected: 172739
predicted: 12668.516725245863 expected: 3192
predicted: -2702.8770829893183 expected: 19
predicted: 3522.9800202504266 expected: 6959
predicted: 3488.98624382657 expected: 4028
predicted: 66826.59589363635 expected: 123947
predicted: 68479.44159807265 expected: 53461
predicted: -2524.766208878951 expected: 648
predicted: 3671.017617195146 expected: 8920
predicted: 4001.410096243024 expected: 111
predicted: -497.78330465609906 expected: 511
predicted: 44362.67266630381 expected: 60229
predicted: -2444.223910099361 expected: 534
predicted: -108.80931884382153 expected: 2939
predicted: 6862.722323206253 expected: 39810
predicted: 5542.175310823135 expected: 13978
predicted: 8415.240977467969 expected: 3202
predicted: 774.9377406244748 expected: 5446
predicted: 67739.21948495507 expected: 221868
predicted: 52618.626948967576 expected: 35529
predicted: 95409.44438178837 expected: 228488
predicted: -877.0724106662092 expected: 2728
predicted: 12803.751434394158 expected: 18257
predicted: 54066.288956765085 expected: 11808
predicted: 15310.877292633057 expected: 57879
predicted: 8985.425003667362 expected: 22885
predicted: 37805.15203834325 expected: 62409
predicted: -706.234084010066 expected: 5717
predicted: 26494.202152837068 expected: 29851
predicted: 375.1911509533529 expected: 5943
predicted: -2401.6364144696854 expected: 2618
predicted: -2127.7776200461667 expected: 4333
predicted: 32063.65647856891 expected: 66687
predicted: -2241.857227980159 expected: 2286
predicted: 206329.07587704062 expected: 15412
predicted: -844.2704025001149 expected: 1263
predicted: 11157.540858553723 expected: 28956
predicted: 1361.0458029008005 expected: 21855
predicted: -2159.753081170609 expected: 445
predicted: 7302.100747386925 expected: 15528
predicted: -1838.6186399974395 expected: 4936
predicted: 46020.956161513925 expected: 28926
predicted: -1564.7548685164656 expected: 1767
predicted: 1498.0333842842374 expected: 9086
predicted: 81540.62066420913 expected: 80332
predicted: 5210.826525735669 expected: 18968
predicted: -2697.8782212825026 expected: 144
predicted: 51330.22319564596 expected: 117929
predicted: 57471.8817588985 expected: 36090
predicted: 2150.457122858148 expected: 11346
predicted: 4862.355240986217 expected: 17500
predicted: 22091.49143998325 expected: 38761
predicted: 17955.213514827192 expected: 54093
predicted: -2681.825314967893 expected: 121
predicted: 6931.890149679035 expected: 11582
predicted: 5291.075178125408 expected: 36133
predicted: -2288.18723381334 expected: 399
predicted: 31874.145298853517 expected: 133400
predicted: -605.3616905400413 expected: 379
predicted: 1788.1199930415023 expected: 4527
predicted: 1306.2338246518048 expected: 8634
predicted: -2368.1962764370255 expected: 964
predicted: 6878.930466312915 expected: 19267
predicted: -2578.8670604187064 expected: 71
predicted: -841.6562623225036 expected: 4621
predicted: 36155.30204848945 expected: 65854
predicted: -2486.571321957512 expected: 263
predicted: -2360.2720899602864 expected: 1012
predicted: 18563.07433996722 expected: 9119
predicted: 5415.2522876248695 expected: 20302
predicted: -2723.742329857545 expected: 20
predicted: 412.1134516840684 expected: 12488
predicted: -2170.728677872801 expected: 449
predicted: -723.8989644332905 expected: 4496
predicted: 2271.0609421075787 expected: 2981
predicted: 3990.2344692316838 expected: 1623
predicted: -963.6382524815272 expected: 2280
predicted: -2665.7567664727103 expected: 29
predicted: 111514.67142038792 expected: 96880
predicted: -2615.0391289887484 expected: 356
predicted: 13072.417735875584 expected: 35273
predicted: 3856.859757555183 expected: 5958
predicted: 8213.829416374676 expected: 3377
predicted: 18014.126706920564 expected: 33670
predicted: -1679.3184360372834 expected: 1347
predicted: 2688.4037999098655 expected: 13606
predicted: -1208.652569674654 expected: 2924
predicted: 8930.75700458046 expected: 20573
predicted: 774109.0904205441 expected: 956937
predicted: -2260.430658391677 expected: 278
predicted: 12233.802514908835 expected: 15480
predicted: 4165.6596283381805 expected: 15051
predicted: 642307.3564224839 expected: 440650
predicted: -1624.4738699120935 expected: 307
predicted: 22807.80471709743 expected: 34007
predicted: 8605.740932597779 expected: 29399
predicted: 59306.719020243734 expected: 195382
predicted: 207.13008160784375 expected: 10926
predicted: 16845.367622775957 expected: 25277
predicted: -2208.323710869532 expected: 375
predicted: 3758.058767997427 expected: 3606
predicted: 8080.683175335638 expected: 35880
predicted: 233.50913787743775 expected: 14766
predicted: 38519.82336050272 expected: 148529
predicted: 9056.624417592771 expected: 36237
predicted: 70018.4577324614 expected: 66530
predicted: 39445.24889160693 expected: 81078
predicted: 20190.70674534142 expected: 32974
predicted: -2704.255016896175 expected: 21
predicted: 18002.560973405838 expected: 11645
predicted: 3527.5660231912043 expected: 14992
predicted: 272502.39363723993 expected: 208846
predicted: -2128.0582312855404 expected: 268
predicted: 41195.785227783024 expected: 37009
predicted: 79370.9042250216 expected: 155328
predicted: 9089.458776632324 expected: 19965
predicted: 16044.696539836004 expected: 9130
predicted: 124388.97856927663 expected: 127028
predicted: 6393.5479150610045 expected: 10023
predicted: 2001.1330750626512 expected: 1215
predicted: -1297.6295588242356 expected: 328
predicted: -500.2302394034923 expected: 4275
predicted: -1178.8622737757396 expected: 5684
predicted: -2678.802108068019 expected: 121
predicted: 2478.8654150005896 expected: 17784
predicted: 25806.854402100667 expected: 34531
predicted: 20466.968510504812 expected: 22875
predicted: -2487.1977201886475 expected: 1367
predicted: -1695.4026267130394 expected: 5983
predicted: -2130.2538246314507 expected: 415
predicted: 29327.53762883693 expected: 15910
predicted: 4560.074841463938 expected: 1829
predicted: 1648.6661611876916 expected: 0
predicted: 6262.493934175 expected: 21578
predicted: 78624.31147836149 expected: 243307
predicted: -2559.456773346523 expected: 1178
predicted: -656.6795374528156 expected: 3563
predicted: -1528.2043065770995 expected: 13220
predicted: 257.37756491434993 expected: 12070
predicted: 622.9935090815998 expected: 459
predicted: 876.7020938912756 expected: 14853
predicted: -2110.5460991256405 expected: 762
predicted: -1643.5265198557172 expected: 2382
predicted: -2489.7684888655785 expected: 611
predicted: 1141.3632268870715 expected: 11096
predicted: 7765.291310454719 expected: 16006
predicted: 2514.908080076799 expected: 1357
predicted: -1846.3629413975868 expected: 3546
predicted: 4132.094826866407 expected: 1800
predicted: -919.7356286700233 expected: 5575
predicted: -1837.9870277061127 expected: 133
predicted: 2250.0160471654963 expected: 3921
predicted: 14516.883998781443 expected: 18441
predicted: 1441.3541799800005 expected: 12945
predicted: 4568.685624866746 expected: 31003
predicted: -61.62088910100283 expected: 4947
predicted: 6282.023907628842 expected: 34034
predicted: -2399.820025501307 expected: 1013
predicted: -174.514535344264 expected: 503
predicted: 5133.450346505735 expected: 50581
predicted: 66885.68351974338 expected: 118784
predicted: -2067.387900907779 expected: 234
predicted: -936.2311375940335 expected: 5182
predicted: 5230.92056570109 expected: 9710
predicted: 30594.857618767768 expected: 44765
predicted: 21410.303864359856 expected: 28951
predicted: -2445.952371052699 expected: 138
predicted: -2353.197321289219 expected: 1220
predicted: 20228.913482399657 expected: 82357
predicted: -1597.0085708529223 expected: 187
predicted: -2391.6533852256835 expected: 1075
predicted: 1206.9020674668718 expected: 12520
predicted: 290.18229861190775 expected: 2613
predicted: -1455.7866985888686 expected: 179
predicted: 21594.69578497857 expected: 15235
predicted: -1462.5737459384836 expected: 1162
predicted: -825.5952979148715 expected: 2456
predicted: -425.3712662321632 expected: 7081
predicted: 15193.276535050943 expected: 7330
predicted: 33259.46231494099 expected: 55982
predicted: 105.01697881508153 expected: 8592
predicted: 7643.734503204003 expected: 9499
predicted: -150.80750717053888 expected: 1179
predicted: 18530.652365688235 expected: 12610
predicted: 5132.86494974792 expected: 21612
predicted: 5241.983853415586 expected: 34059
predicted: 57.35051455383655 expected: 13280
predicted: 31985.574505191296 expected: 14149
predicted: -2531.4847624378745 expected: 433
predicted: 44073.19942062721 expected: 172597
predicted: -2295.2665055363905 expected: 2925
predicted: 100683.9421665445 expected: 270831
predicted: 10037.092412106693 expected: 12207
predicted: -1606.9555756810587 expected: 4080
predicted: -1652.0507972599007 expected: 4721
predicted: -791.7052101879963 expected: 4546
predicted: -1660.0062680977862 expected: 3154
predicted: 485.9566311290837 expected: 7944
predicted: 7162.900034455117 expected: 20721
predicted: 38553.542213752866 expected: 29446
predicted: 3131.7015383350663 expected: 2948
predicted: 897.9908646486583 expected: 5293
predicted: -943.5322438779403 expected: 725
predicted: 4357.0222734268755 expected: 4389
predicted: -1017.9620643451344 expected: 682
predicted: -832.8972337083542 expected: 7407
predicted: 2538.480846200604 expected: 5168
predicted: 1564.6040162750287 expected: 5346
predicted: 59156.372068639845 expected: 105649
predicted: 18236.131909746677 expected: 25825
predicted: 8926.071934496053 expected: 61211
predicted: 3190.1411989619955 expected: 8528
predicted: 5680.328945667483 expected: 14416
predicted: 6010.031035745516 expected: 5882
predicted: -1395.5050526980776 expected: 809
predicted: 404.7491841710289 expected: 1103
predicted: 27190.32279684767 expected: 64074
predicted: 38216.52811526507 expected: 62168
predicted: 1233.285686039133 expected: 10005
predicted: -1353.955155046424 expected: 1262
predicted: 55958.427791599184 expected: 99320
predicted: 33115.79315242544 expected: 89200
predicted: 1884.3447628594004 expected: 5296
predicted: 21406.303258176893 expected: 10836
predicted: -2065.88814759464 expected: 267
predicted: -1148.1855876443442 expected: 7281
predicted: -1917.9835091847926 expected: 804
predicted: 48712.42369579151 expected: 4639
predicted: 5088.1515395767055 expected: 24412
predicted: -2157.33873429941 expected: 234
predicted: -2058.425168442074 expected: 160
predicted: -523.1634536443162 expected: 7481
predicted: 396.801415922062 expected: 1665
predicted: -2702.9275645720772 expected: 2
predicted: 30667.243942394853 expected: 40981
predicted: 23030.757930867374 expected: 147250
predicted: 32089.86329310015 expected: 48689
predicted: 71101.70054140687 expected: 262753
predicted: -1586.7899608893786 expected: 3378
predicted: -1706.9202486723661 expected: 4742
predicted: 58195.070011377335 expected: 95363
predicted: 3757.0846867526416 expected: 14193
predicted: -2536.311560158385 expected: 550
predicted: 51764.09746828675 expected: 84096
predicted: -2631.688097184291 expected: 86
predicted: 29847.24102028832 expected: 43308
predicted: 18976.55120914057 expected: 34441
predicted: 2128.6599812321365 expected: 8909
predicted: -982.2318281256012 expected: 4314
predicted: 1389.7316660501529 expected: 6688
predicted: -470.1970157002215 expected: 6315
predicted: -2151.8871973669156 expected: 678
predicted: -2710.401445850497 expected: 15
predicted: -2483.234086432494 expected: 474
predicted: 1740.4362275805324 expected: 12500
predicted: 9339.347825349309 expected: 5966
predicted: -1397.7935511164833 expected: 731
predicted: -1248.2505127929617 expected: 3948
predicted: 9877.606635004282 expected: 23638
predicted: -2084.5345748488326 expected: 2412
predicted: 101409.48907025158 expected: 56291
predicted: 47408.60149247944 expected: 16034
predicted: -772.2667197902338 expected: 1646
predicted: 3107.041403658688 expected: 1655
predicted: 304.8172768079676 expected: 2323
predicted: 166832.55855359137 expected: 161462
predicted: -231.08057084208122 expected: 9193
predicted: 2697.0925572128035 expected: 10504
predicted: 4785.86450397782 expected: 26719
predicted: -2028.2907445705496 expected: 831
predicted: 18070.71158413589 expected: 65162
predicted: 139.62216304702451 expected: 946
predicted: 2677.9145328218583 expected: 2931
predicted: 6271.664992045611 expected: 11839
predicted: -2726.007602007827 expected: 17
predicted: 3534.6592780756764 expected: 17508
predicted: -991.657900940103 expected: 3498
predicted: 4338.408078544773 expected: 7792
predicted: 72649.74932406843 expected: 177700
predicted: -2678.83197041275 expected: 30
predicted: -2042.1447395009454 expected: 198
predicted: 1079.7546026776545 expected: 14261
predicted: 51815.76406472549 expected: 231117
predicted: 40949.3365107812 expected: 38633
predicted: -270.0570927867084 expected: 6305
predicted: 2688.4037999098655 expected: 3354
predicted: -1613.2901848077308 expected: 2461
predicted: -2302.6126423401292 expected: 881
predicted: 77404.47166854143 expected: 111118
predicted: 21333.037180393934 expected: 9536
predicted: 155866.93871857226 expected: 102160
predicted: 49932.47965210676 expected: 46902
predicted: 15159.752972055227 expected: 25114
predicted: 1013.1784011225682 expected: 14397
predicted: 40903.1494175978 expected: 1218
predicted: 2749.2251010304317 expected: 9839
predicted: -418.5939359947224 expected: 2843
predicted: 15.952772658667527 expected: 3143
predicted: 3873.0408823499456 expected: 13227
predicted: 2168.561050849734 expected: 29282
predicted: -1625.2661700583994 expected: 1363
predicted: 898.6938147635083 expected: 9504
predicted: -800.3926639758865 expected: 1890
predicted: -2414.5459534972906 expected: 497
predicted: 929.3161087670014 expected: 7756
predicted: 104699.12496577948 expected: 62112
predicted: -708.4786184209515 expected: 546
predicted: -2674.4666170191485 expected: 436
predicted: 9973.012560369447 expected: 18807
predicted: 1030.2371470485814 expected: 12749
predicted: 1188.347004767391 expected: 7310
predicted: 2061.617595295422 expected: 2407
predicted: -1096.3274929949548 expected: 2504
predicted: 1149.625853270758 expected: 5190
predicted: 23973.277995310724 expected: 36803
predicted: 9089.223669918254 expected: 46803
predicted: 76040.3370089829 expected: 121553
predicted: 33968.06257501617 expected: 30209
predicted: -2338.5268519334495 expected: 768
predicted: 1819.1303790251259 expected: 4948
predicted: -1545.958418530412 expected: 4635
predicted: 20636.749686457217 expected: 27221
predicted: -935.291421745962 expected: 2325
predicted: 49719.57914638519 expected: 139957
predicted: -1790.5663352820557 expected: 4116
predicted: -1661.7382840921637 expected: 3484
predicted: -2156.9844152091537 expected: 2157
predicted: 7330.563827964477 expected: 29669
predicted: -2475.533630538499 expected: 728
predicted: 101016.3906443268 expected: 32001
predicted: 542309.0385227799 expected: 1017919
predicted: -2667.5290729322005 expected: 51
predicted: -2517.0275955444667 expected: 921
predicted: -2435.1090218771715 expected: 93
predicted: 164.62518143164925 expected: 3053
predicted: 7518.497043463867 expected: 19555
predicted: -831.9981638294994 expected: 8713
predicted: -2484.595193145098 expected: 78
predicted: -2634.3408688078634 expected: 771
predicted: -1212.7932444745675 expected: 5310
predicted: -1452.4859614851885 expected: 4173
predicted: -1881.536280438304 expected: 1281
predicted: -1719.1801632007118 expected: 637
predicted: 75101.28287255019 expected: 110060
predicted: -2390.4036697989795 expected: 1930