From ac42ca9fd014f28b302d9bb5d2af72bc80bc9648 Mon Sep 17 00:00:00 2001 From: piotr6789 Date: Tue, 18 May 2021 18:11:26 +0200 Subject: [PATCH] add script to linear regression --- dev-0/out.tsv | 1000 ++++++++++++++++++++++++++++++++++++++++++ linear-regression.py | 58 +++ test-A/out.tsv | 1000 ++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 2058 insertions(+) create mode 100644 dev-0/out.tsv create mode 100644 linear-regression.py create mode 100644 test-A/out.tsv diff --git a/dev-0/out.tsv b/dev-0/out.tsv new file mode 100644 index 0000000..a129a04 --- /dev/null +++ b/dev-0/out.tsv @@ -0,0 +1,1000 @@ +70931.05873893574 +13451.648888674565 +46783.49724240601 +15194.861505265348 +25126.512787183747 +71569.48077582195 +42462.35877151135 +10783.453862964176 +-4631.9637786773965 +15244.30853491649 +25128.100675611757 +75207.05098236352 +8016.599657084793 +2890.748696410097 +33729.70129918773 +23978.712242801674 +58147.52895532735 +85476.75444758125 +34931.525003522635 +8114.599742635153 +3577.7528264736757 +9432.725699993782 +-8611.679312517866 +53359.750463187695 +-2036.087162761949 +63255.837290490046 +72623.3269874379 +12918.381487860344 +12415.324716592208 +35458.520852150396 +68792.54397340678 +57449.36069869157 +9923.908856223337 +46884.542112393305 +37349.00600718241 +54485.45758689009 +31875.9016985232 +24037.862347950228 +41080.40511692688 +64954.25705565512 +67939.1875931248 +28970.76057335548 +37509.94975749776 +62449.38972277846 +12607.451400630176 +110585.1374011999 +82897.54061994702 +12411.734904331155 +36738.16472428944 +47332.65493738651 +68213.24832845852 +-3965.7795842904598 +86251.5060735261 +38134.04067609273 +13556.711765815504 +-2019.6680043237284 +-501.35225799307227 +25987.087577222846 +64864.624897434376 +20759.068289602175 +57947.18957783189 +-5227.128118989058 +3919.55530949682 +66603.74768493045 +75817.07380239666 +28406.645227167755 +-4002.195587530732 +78836.03511956055 +32761.981237421744 +4971.561402422376 +22916.831189996563 +31416.5752422316 +18868.949290734716 +20058.909415329807 +150412.4010094069 +41772.32695159502 +57823.96636366099 +41323.371312068775 +61681.79330752976 +16274.122400053777 +44977.29483289644 +21577.319247750565 +43200.460817689076 +17168.88805082068 +19143.636553814635 +21217.768149849027 +51625.052263644524 +38362.172799048014 +39435.06949115731 +23941.973575733602 +38356.38997985516 +30851.719626784325 +52896.86370663997 +42145.69159554597 +4943.278133271262 +5127.186678696424 +59982.34543450549 +56050.32690224331 +35747.03893890791 +31172.877713142894 +8346.798420666717 +7611.2535399813205 +11691.404759289697 +21117.80840501096 +8027.261673998088 +25882.179061793722 +25893.782112326473 +40581.97519920394 +58385.51537759043 +19677.509056497365 +69685.98696522322 +-11056.868454614654 +50147.94171705097 +54704.02643014677 +9250.527380824089 +39480.697850310244 +13188.555219632573 +32473.396524748765 +52541.45593977254 +27235.976651910692 +23069.435775551945 +29985.6973320134 +-20205.891832343303 +29048.722196660005 +61067.556538291276 +69435.98892915156 +-15432.28851227928 +41836.668232170865 +22111.450798102655 +43842.192931290716 +13164.386847798713 +-3053.026986447163 +41118.19183462113 +35089.718772629276 +-23070.194834151305 +58149.279317807406 +90603.34662831668 +51745.4686085172 +30059.50533335004 +57750.71496705338 +16669.55073651392 +47787.485587450676 +65118.50730286073 +18083.723973580636 +61926.140732826665 +47274.237532146275 +82239.72534740623 +16451.268913540058 +13301.40425549075 +53594.70145042986 +29830.316563743167 +18328.2620471213 +42615.408683488145 +-32320.04303385783 +68096.42949902825 +-8455.651303696446 +68804.27639002912 +19262.168960153125 +53914.552325197496 +56509.12175215781 +36189.86054489482 +61168.90488707088 +8715.849443756044 +-1356.5934445634484 +5971.765750572085 +-6587.741982977837 +39424.29969494231 +37123.25753940269 +25459.59127256926 +74245.27119430527 +55730.701050252654 +66291.16105471551 +19997.219991517253 +21391.06497664377 +68302.74267335609 +35470.01984904241 +69663.72920654714 +86452.34744949825 +74501.28605982848 +67939.1875931248 +50409.17618532013 +31885.776658402756 +18247.321767088026 +-10147.335425549187 +22296.637949964963 +8654.557571977377 +74856.2055129772 +36052.843137203716 +11305.157316183671 +25361.791339260526 +-8159.009478007443 +39216.8170002047 +40747.00727632549 +57188.50897208229 +4185.632256606594 +51653.872586214915 +38734.09751619771 +54408.38690410182 +21698.82412795443 +36468.63613478094 +90816.99039206002 +86453.28764128406 +-3324.04747068882 +-13359.623344398104 +20446.48378581088 +20880.23897334002 +31758.377725253813 +60765.47055252083 +62809.38073777221 +33241.37660925649 +26615.656926054507 +9680.281739399768 +83200.29039703403 +41044.757836803794 +32776.340486467816 +70190.04728657473 +47624.48360835388 +56560.26593709085 +108495.96825844608 +50526.70015858952 +-9284.166245704517 +32029.33041563537 +25929.687165646814 +-6391.34620644059 +35310.450986491516 +25882.75454291422 +1767.1836987677962 +39235.0992459869 +36751.19218517281 +50933.384325653315 +6866.4948720205575 +42059.84625740908 +24351.212875925936 +44869.07033838611 +1487.2558088256046 +5570.621845250018 +65451.77273102477 +48095.9450310329 +15336.050468135625 +56431.51919395756 +36520.057182053104 +23955.43834787421 +22185.399124313146 +45256.070422783494 +34704.52926214971 +15343.230092658661 +13540.617495411076 +41437.60121865105 +29471.88546700403 +12754.116148939356 +50231.28973691631 +24381.615949359722 +46994.22288396023 +67633.51414795779 +14516.781819269061 +78217.54508162756 +31740.749129263684 +74863.46210407559 +32050.166438926943 +21997.71974830795 +62695.081131332554 +8823.179461360909 +19358.929353477433 +15660.023505040444 +66729.38081235532 +26846.220223995857 +-206.80734580662102 +86452.9350693645 +4246.924128385261 +21982.924551460892 +-8866.29836989101 +23367.8184815282 +18775.502921612002 +17146.22752278298 +63032.54174127802 +16346.833604826592 +19593.586564772762 +135772.1727764774 +19401.07076664921 +25063.10106116999 +109090.4519288158 +57366.749336008914 +14255.0608137846 +15877.632188655436 +67938.83502120432 +28218.527417507954 +71192.88512964733 +9903.978467468172 +31976.436924482696 +51554.53787968308 +27346.578988279216 +66335.98751642555 +36626.48858738039 +1543.8727431930602 +26399.783058723435 +37566.10489241313 +40874.7252052594 +28902.829230952077 +27057.994275606237 +49559.59431239311 +23071.313212999143 +12175.903480583802 +5461.916859285906 +36444.37497673556 +15625.020013685338 +33629.78120216634 +8493.690788237378 +48032.408493868075 +36186.873815435916 +11055.559472355992 +6594.924928177148 +-17057.873239905573 +25130.10259944573 +-16952.487957854755 +61835.120607648045 +81571.24322630279 +5472.110814950429 +26141.07638438046 +44727.98399133328 +24660.177368736826 +42754.21430066042 +46883.45698724408 +23991.294271185994 +18043.728460962884 +52676.317078049295 +71165.72185259778 +19304.426370979287 +42173.38922596071 +56882.29419388529 +29881.58396520838 +29303.2635776205 +58597.62141157966 +5731.0081375371665 +33296.06433763262 +-2820.046415762976 +40467.14656129014 +40410.33897867892 +28314.2990500452 +47764.082957403734 +57776.128838428296 +118628.29853650555 +79400.60770097747 +42995.86639060173 +61700.77709792368 +13655.703195788898 +59275.62685341388 +15693.106677110307 +6183.539802183397 +49988.13263622299 +37667.53459527809 +53894.091763773 +15111.771958381869 +44942.60856054351 +31267.703272605315 +48735.55369117111 +61357.11982399691 +8481.376978338696 +7318.45105554536 +51403.480218729936 +21433.322661965154 +85582.90509525221 +38487.18807702139 +684.8878112100065 +46370.018283696845 +50555.786594457924 +70990.8685139427 +161071.58188618254 +61835.23813162185 +51711.60653273761 +10402.66584891174 +30136.700827289373 +30391.617242941633 +-20061.873745537363 +64433.48642538022 +74042.90200668108 +40732.45737903565 +23515.644656376913 +43682.80762263853 +69984.10887622926 +35935.128515690565 +-11957.844041465782 +36578.28174382262 +34471.30407032557 +47072.147792170756 +-1245.7686043642461 +27709.621047065593 +19709.973644348793 +-10389.460283011198 +25993.09889166057 +2479.8992359647527 +46058.249137059785 +66455.46344307065 +45913.002329883166 +24311.02459882293 +8618.585034273565 +60847.84641383216 +22058.154124315828 +65108.97232273128 +37519.275144126266 +32557.962291454896 +49099.93337607756 +35468.622434875 +79464.98844385706 +56899.947509618476 +49369.66450300906 +25976.057915535755 +1379.4161471920088 +19839.403948095627 +71632.65056333784 +73750.45663345885 +42591.34666325059 +9125.409828445874 +19714.890998546965 +213396.98842549976 +89504.96856210288 +108912.93950962741 +101372.8706304403 +12767.896636400372 +42331.3176044533 +44822.137715653516 +42300.02202974446 +60798.218455743976 +61466.67312184442 +70990.39841804933 +54220.6564131733 +45215.19204794243 +48166.92121444736 +-20286.204222456552 +52054.5118110897 +39776.361970721744 +38268.478580553085 +68698.10324682109 +52875.365544823 +27386.90746760927 +6365.439228917472 +67938.83502120432 +19935.46453777887 +40638.458502617665 +27202.19130782131 +61056.73094545398 +30986.986773892306 +52448.54274434131 +23683.45754963439 +61834.768035728484 +55731.17114614602 +103314.91330246534 +40847.33615348954 +87708.545177727 +60928.292021624744 +60069.57308909297 +58191.33655669913 +26588.742374650203 +8651.543240836821 +18210.738073851913 +23804.956168042496 +44852.49530993495 +10333.57198349107 +59262.377561788075 +47993.15475203004 +31104.03015381284 +70808.45326358732 +14552.760428151116 +24935.38313223701 +24331.284162609838 +10757.099799803458 +37861.018627447076 +14455.008787130006 +74244.80109841283 +41020.119656421244 +38231.49573381897 +27947.088145645335 +18473.006463297643 +72771.49512840156 +64020.99369210098 +22548.7404809054 +47705.179158344865 +27144.931098471396 +20494.86504226271 +16289.147555338219 +54492.061730292626 +-21579.069370340556 +42254.55936503876 +23069.957540307194 +21886.363970640115 +18929.144365948625 +24603.77460487839 +49120.00024496019 +44131.35312508512 +30845.625127410516 +25832.810372355394 +41663.34968643077 +45367.72040874697 +70990.8685139427 +23829.37579175271 +19276.4712104816 +35787.15102297068 +58416.97640251089 +39594.85079031717 +71006.19175536186 +4423.694534285925 +58255.73434373457 +26734.697963887826 +33584.64905030653 +25348.671442702413 +57296.37170911115 +55975.71426408738 +61103.857752819546 +9944.076047072187 +81075.324320063 +32175.19497553818 +-25164.472312305123 +96264.16760549136 +66827.76043179352 +19910.185946876183 +177197.75997322705 +45365.583761662245 +17665.958815481514 +44521.83406870719 +33766.16023071017 +-20690.922455587424 +22794.17303135153 +48125.56462725811 +94999.90301495697 +16334.838790711947 +25423.414465496317 +85050.26070137229 +-8824.015486537479 +84952.57474392 +65158.65935106203 +63282.70099767856 +53911.73517013807 +27766.15244636219 +85924.66480951943 +13621.402801612392 +71980.68887986895 +12677.811851440929 +63428.75244867895 +5425.230670598336 +61328.836554844864 +40663.44522440061 +68205.88295152504 +62239.67824974749 +27645.03866083175 +2475.3418695237488 +13798.939336877316 +8023.78554340452 +44323.48349707201 +19389.933064237237 +60538.8386240229 +64303.718429667875 +50002.49201825727 +52813.76789796073 +14214.922982699238 +27955.69354397431 +17513.003457766026 +4810.88526692614 +14916.405296235345 +-10673.56070651766 +3961.3537468528375 +49978.11565633863 +123547.8263105303 +76357.23042486329 +3591.453099985607 +38339.72022833023 +38694.987483493984 +-22247.046529815532 +51293.135869983584 +17559.872458271682 +-1824.569483404979 +5830.392401254736 +67234.75853739306 +35419.551331149414 +84911.92847090121 +61332.058666050434 +76047.616482649 +51162.72260569502 +45826.316708941944 +82239.72534740623 +29759.50262549892 +59159.67762162071 +-3081.819899627939 +51651.37468753196 +-17737.88839368988 +55693.80260912236 +66263.40808794834 +15047.141476265155 +9179.157116460614 +33722.81742023956 +58102.34669507481 +17787.34786266461 +993.8860208205879 +25180.625034439377 +67786.70344246086 +15360.60367284622 +44177.90091494005 +57840.43504134752 +62622.28806415107 +115267.86096795648 +47302.63352343254 +4431.4496399294585 +25983.799412901513 +63786.176645288244 +40634.28697558679 +58210.18635670934 +14915.428019585088 +32717.995151968673 +14691.879476366565 +-40670.45715931803 +25038.93268933706 +53165.95498489123 +43755.12247747276 +16957.716123534366 +1345.8824595082551 +53208.78815133311 +41281.84554489143 +39421.21264595911 +27057.41879448574 +22467.379693583585 +51530.30367075745 +40671.293418888 +181240.50768711325 +16769.42139405012 +-16676.582822005264 +52637.48193805665 +37189.5460282471 +14939.83509394154 +37429.98196162749 +44820.017861418426 +13120.468556207605 +64132.32160505466 +-799.42709766794 +120058.6422577668 +82793.41558172647 +2651.5354564888403 +25711.210099338554 +791.411447968334 +29048.722196660005 +1019.7618716340512 +61782.137885245495 +25798.166813859716 +38259.85025022458 +-2475.6010757647455 +20810.0492537003 +23243.114883735776 +33467.12507703714 +21236.607832910493 +45903.70285112504 +30999.697119504213 +53373.1778625017 +51954.39813310094 +53652.720629492775 +22425.096810230985 +25631.22749309428 +41799.47261721734 +57044.63093565218 +23609.661219713278 +50896.32666279934 +81538.90083727706 +80513.52746687923 +37919.25229334179 +48444.25102222897 +2712.1840532859787 +41771.954423900694 +25370.166132051498 +33413.01282978151 +37186.39937560726 +17106.08969169669 +14668.539772493765 +11528.02642159164 +80076.96526148636 +45768.88389519043 +31652.60614931211 +8075.77793642506 +79728.51854499243 +24986.800044137053 +32368.81259799376 +29230.743021092378 +73150.23046312574 +30415.09158429876 +42307.89506579004 +-30880.889317176305 +37580.464141459204 +17600.35395660717 +104763.27045259438 +68776.06487012468 +46999.90382210165 +60429.03416113183 +29535.29719301779 +34159.57027387619 +-5500.770861313678 +12230.232896640897 +12576.61304830201 +8870.112084093504 +50168.03373940848 +44218.61422714684 +4429.404200782068 +-13846.145862377249 +85815.18620325811 +534.0365617880598 +62834.10372668877 +-239.85563830193132 +31949.188384416513 +86173.47015527543 +38788.66208071448 +22443.720965779386 +46484.52792582475 +53283.86379103735 +86452.9350693645 +33127.83385240007 +-14345.414246405475 +16106.07666069828 +-24425.985433250666 +22248.670957577415 +48308.103915520944 +9232.87795956526 +33074.14918085653 +-8109.572168163955 +54539.56983414572 +116571.6542023262 +44529.21675471496 +54555.664104550146 +-305.1628327574581 +39094.49202603381 +52677.96241367515 +1521.3485589465126 +621.1070156069472 +52669.084471927024 +15880.378638935275 +23437.834350944497 +1140.202907270752 +26902.446063689888 +73152.44132433739 +93697.6859820215 +15797.793837740086 +5213.976950099692 +74244.91862238571 +1733.6819726815447 +27816.674881355837 +20148.68553581368 +5246.362347169779 +26965.924605179578 +23115.906598831527 +84048.54614371434 +57846.335356087424 +536.1039376435801 +45013.458018844016 +48163.834165464155 +40105.27516272478 +51584.41591801308 +17206.94391344115 +52776.71023510676 +-23486.753961093724 +42797.366462888196 +69025.92660361435 +5794.532895611599 +61834.768035728484 +39618.5095181223 +-9566.541268203408 +-36083.73889940791 +28099.230931747705 +13996.354139441624 +14210.835390658118 +23844.51851800736 +97793.38376650307 +25959.950036853552 +42779.380859414116 +28514.52949936781 +32033.749268135987 +-25738.74363966752 +38608.247696876526 +-20014.57152915187 +34998.526541798376 +32218.189822579734 +34729.435263547115 +50874.62233901862 +9944.306946798228 +-19817.22354206443 +18264.65967286378 +38529.955406371504 +17845.086214780807 +23287.352171112783 +35714.60526841041 +-49407.559660569765 +55271.66722103674 +47044.16347825434 +4791.173821867444 +64702.62858884223 +55046.72339007538 +26204.488110394217 +16013.755119441077 +55166.23358662706 +8778.617894788273 +-5950.870916120708 +36007.454887585714 +154892.36365087703 +-11373.572871473618 +19872.552802902646 +72761.31128040049 +55730.701050252654 +17415.318801034242 +-7874.002906180918 +7694.8723514014855 +56483.36513246689 +16718.440070522018 +23941.973575733602 +4583.016944911331 +28430.648810862564 +33758.980606187135 +53685.50152159482 +67124.6623974489 +-3126.632668124512 +56882.29419388529 +67955.62098152563 +8036.863693315536 +36067.011738006026 +27596.546323862858 +15147.744496085681 +8698.475863568485 +72428.60752022918 +52677.96241367515 +35201.902212783694 +28995.50442630984 +6200.5285494932905 +34666.21418577712 +24025.454217290506 +61782.137885245495 +42989.26224719919 +-4701.464357726276 +52676.317078049295 +83124.81506029982 +21267.52968893759 +45228.82188271638 +46907.691196169704 +66173.06034744531 +5304.639887807891 +41413.94249084685 +55016.26987062488 +17413.84884300735 +-5412.805930589326 +43500.614335021935 +20587.890598181635 +36712.01845381595 +59848.14658827707 +36908.63799795788 +6059.456538639963 +35421.32952419389 +32085.336513234302 +60368.26039375272 +21528.08238433581 +22052.5214243941 +28570.568690472282 +31865.026134685613 +28350.182500447147 +50675.062484187074 +58580.21425525751 +55052.623704816215 +12358.198138196021 +45828.63695965335 +22249.26937943045 +-1475.72554572206 +20429.719149798155 +14537.04138305597 +-6756.981043779291 +41135.16690096073 +23300.241462131962 +-10506.984256280586 +21388.63236027304 +21642.016545343213 +28343.578357044607 +15974.767515829764 +64031.49551406689 +46021.036176150665 +35591.85607464146 +33897.467971905135 +8749.892775468528 +86453.40516525786 +42810.44640215114 +115513.51412308123 +57587.438033500686 +68614.08328285813 +31655.610666978173 +25130.678080566227 +56231.26260152552 +18047.175954756327 +39117.57527271751 +74172.23637568206 +44288.2452636864 +46186.96273017861 +89508.3763284767 +11620.096092017367 +3761.4788008276373 +24976.415440228768 +3064.504771169275 +26916.236093411222 +35935.128515690565 +-42579.366950527765 +35972.315086589195 +-8891.171899253502 +54871.68800553307 +74042.90200668108 +47236.02890705131 +25862.537198891863 +70990.8685139427 +943.7110851984471 +26062.99297908414 +36448.990398154594 +-11010.038355920464 +15132.71639223583 +42334.20392239466 +82109.86309406161 +55237.53404923715 +104544.85969070904 +84007.82230568957 +55103.530972686596 +21019.318977629766 +-10926.55771436356 +26733.67665730603 +16418.31943226885 +25818.767335779965 +29941.405878960155 +81716.92173360474 +70990.8685139427 +4378.187685359269 +28638.993068445474 +65146.605466704816 +71780.59025900997 +86251.5060735261 +33249.131714900956 +15520.04437330272 +16058.56788793765 +54482.7622515345 +39618.329837948084 +28933.91545501072 +51794.97610935476 +16363.570641888306 +36321.23412318155 +59640.46505730692 +73883.38954001386 +56317.24856527988 +50975.560621682554 +-3761.1851572031155 +-13320.193930838257 +27433.649442098103 +78517.17999391258 +37634.576388714835 +65576.4598874962 +59340.99815378059 +-9286.422111061402 +9869.70052838698 +80402.20212721918 +28037.939059969038 +35347.508649344556 +9369.858089427464 +-2084.930799077265 +30318.212007693946 +57738.16859506164 +62735.40961066261 +22275.184493766166 +20044.189023427665 +19639.051046200097 +7377.711096455343 +56741.01529314648 +38124.651357247494 +75044.39780335873 +62288.39696426969 +22694.70095313061 +22709.0317835249 +65492.502042854205 +67908.31468627695 +6369.2274054521695 +50026.726227182895 +68047.07165446132 +44061.71677670814 +38349.01970708836 +45454.69076158106 +34400.71271978784 +2131.4926095390692 +67939.1875931248 +24421.944428689778 +8833.425895405933 +43204.38190898299 +71804.0548021812 +68792.64649744425 +4947.6285319607705 +9005.06211593002 +15558.018475410528 +61194.8500012774 +69028.80578021333 +62634.364740675315 +37630.092099547386 +32432.41412113048 +9051.89971629437 +41557.01180208288 +43144.42056653835 +-23563.75879121106 +17636.370369054377 +65238.41521264613 +67708.71081686858 +39644.47874840535 +106806.02093640808 \ No newline at end of file diff --git a/linear-regression.py b/linear-regression.py new file mode 100644 index 0000000..5795c66 --- /dev/null +++ b/linear-regression.py @@ -0,0 +1,58 @@ +import pandas as pd +from pathlib import Path +from sklearn.linear_model import LinearRegression + +def get_names(): + DATA_DIR = Path('./') + with open(DATA_DIR / 'names') as f_names: + return f_names.read().rstrip('\n').split('\t') + +def get_data(names): + df = pd.read_csv("train/train.tsv", header=None, sep="\t", error_bad_lines=False, names=names) + dev_data = pd.read_csv("dev-0/in.tsv", header=None, sep="\t", error_bad_lines=False, names=['mileage', 'year', 'brand', 'engineType','engineCapacity']) + test_data = pd.read_csv("test-A/in.tsv", header=None, sep="\t", error_bad_lines=False, names=['mileage', 'year','brand', 'engineType', 'engineCapacity']) + return df, dev_data, test_data + +def get_train_data(df): + df = df.drop(['brand'], axis=1) + + train = pd.get_dummies(df, columns=['engineType']) + + train = train.loc[(train['price'] > 1000)] + return train.loc[(train['mileage'] > 100)] + +def get_x(train): + return train.loc[:, train.columns != 'price'] + +def get_y(train): + return train['price'] + +def get_linear_regression(x,y): + return LinearRegression().fit(x, y) + +def process_data(df): + data = df.drop(['brand'], axis=1) + return pd.get_dummies(data, columns=['engineType']) + +def get_prediction(clf, data, type): + prediction = clf.predict(data) + if type == 'dev': + prediction.tofile("./dev-0/out.tsv", sep='\n') + elif type == 'test': + prediction.tofile("./test-A/out.tsv", sep='\n') + +def main(): + #prepare + df, dev_data, test_data = get_data(get_names()) + train = get_train_data(df) + x = get_x(train) + y = get_y(train) + #linear regression + clf = get_linear_regression(x, y) + #predictions + dev = process_data(dev_data) + test = process_data(test_data) + get_prediction(clf, dev, 'dev') + get_prediction(clf, test, 'test') + +main() \ No newline at end of file diff --git a/test-A/out.tsv b/test-A/out.tsv new file mode 100644 index 0000000..41b6d9d --- /dev/null +++ b/test-A/out.tsv @@ -0,0 +1,1000 @@ +24680.075621912256 +22018.822674076073 +13077.125745736994 +-4833.008963748813 +-3190.044394138269 +20061.562603614293 +36572.70940445829 +19804.259431251325 +108098.45839788485 +45590.69328128267 +-22856.300928306766 +41820.09505153261 +-4291.3747648485005 +30374.119829987176 +-18208.94460076373 +-2539.5882828989998 +42408.437172499485 +60077.75168418698 +33999.57276901044 +18180.077216261066 +55902.34940952249 +17959.211024031974 +-105.62817595805973 +43025.12985994574 +7965.227598313242 +23699.10272969026 +36640.27235530596 +32417.76315458864 +67032.11759957578 +26399.284544178285 +38471.92283400893 +22296.637949964963 +23525.989929912612 +9398.804513593204 +65733.84050017409 +14846.780136421323 +50610.83800490014 +43541.9723231541 +64291.529730346054 +34172.26891665254 +9898.3212793516 +46350.524849274196 +35521.84020522516 +63435.097330051474 +61609.62971421797 +32530.0916277878 +34408.127392257564 +10189.78404089529 +27906.049575856887 +41021.80822107382 +38394.22882552352 +79215.50744307786 +14832.882686827332 +42717.20491123479 +-421.4614286981523 +29730.20730847027 +60773.060257906094 +32190.85113651119 +66350.41446155123 +86452.34744949825 +22540.985375261866 +72374.49527297355 +57954.559850598685 +25144.652496735565 +55572.460538088344 +62801.295520538464 +-1076.6144396960735 +352.15390721987933 +41055.94938339852 +70991.33860983606 +45906.4587401608 +85476.75444758125 +27021.255608538166 +71762.64119770192 +43866.04230733961 +19456.569157081656 +22577.571465630084 +17567.52448516339 +76689.73342912737 +30387.850619531237 +16783.6267099455 +42315.855372190475 +59943.60986915417 +41595.45367125049 +38382.16856189538 +69394.29744433705 +77105.7170749493 +16518.46982535068 +31310.011353990994 +43101.140921531245 +14584.018549438566 +53629.831567442045 +68743.86906776857 +45148.546220544726 +20476.07629140932 +68453.75582152419 +20798.406664317474 +9356.687080452219 +59104.95879590511 +38429.99566153344 +67938.83502120432 +53401.00293142907 +9034.378031851724 +26536.80046641454 +31070.288470041007 +62838.26417502202 +50097.19954269193 +5792.161839452572 +42109.402018826455 +18657.426441048272 +25882.75454291422 +1139.3526145853102 +54961.66208636761 +18049.599489295855 +8000.179653250612 +72423.79269006848 +2514.518048797734 +67938.95254517812 +-6920.358019302599 +42780.8873596061 +23054.999559929594 +14653.98987520393 +33663.19562184811 +462.421289389953 +14305.583248779178 +17059.157068965025 +28200.60290112719 +4340.598725605756 +56348.22737358138 +42156.719474435784 +22735.637048608623 +15560.064583465457 +34226.38116390724 +9412.918907446787 +102258.92532421928 +69208.52761922777 +28192.9055289682 +44119.454163447954 +49576.824060800485 +30986.12769690249 +32954.261854610406 +29988.33850169275 +42280.25679450575 +-18577.035309855826 +33000.61899622157 +23197.009922432713 +110110.72519250773 +41468.05473810155 +33265.03533706162 +11489.492179485038 +54392.10714293644 +67003.45654762443 +67110.82020582817 +28618.764134668745 +-4043.165726473555 +106327.6983652031 +42676.82815847732 +29242.162354085594 +39171.687519973144 +23936.660259175114 +21814.398965246975 +17235.468226900324 +52534.988159853965 +-6441.959044745192 +56967.43544171285 +41791.42949298676 +27138.483836232685 +60303.75374440383 +41981.87827452645 +58645.15379292425 +56130.793212658726 +1874.7652277741581 +25513.128038704395 +52122.3629482789 +54130.190331726335 +15874.042376393452 +34094.65187474247 +55781.982059995644 +74758.395671973 +57556.22361814417 +42425.301108658314 +48428.94623108022 +25113.623496164568 +86597.06198627222 +49778.21350850351 +65076.93949757982 +34461.42911044601 +36989.69982098322 +85154.41268871259 +22793.982383107767 +28082.13216312509 +11935.034867851064 +5896.699859100394 +18610.05196814798 +16768.845244022086 +11583.357424949296 +52476.11536719836 +42730.364924612455 +12106.671088376082 +39580.742743195035 +88535.86272999085 +26171.914736707695 +20713.577156516723 +53824.16620177403 +70234.70639641676 +62619.62065875158 +20973.724404856563 +11189.665072944015 +35149.06187804416 +18913.829234139062 +26234.750981600955 +-12857.670739368536 +24119.319462754764 +39406.07765786722 +30848.175876591355 +3181.4971380615607 +53283.47895816062 +26501.774883996695 +36029.56924227625 +15936.88649328053 +25939.881121310405 +15079.873678936623 +64362.0441143075 +6793.873507335782 +-4999.836615908891 +6809.739767788909 +-9847.826084111817 +52660.13321712427 +15843.779505186714 +46780.29226302169 +-26353.68646116648 +4492.991215675138 +49971.20074612368 +57940.00995330885 +40517.59591901116 +8351.54053298477 +43475.83724355791 +24614.752071069553 +56090.079900451936 +50227.85565316025 +-19405.87485939823 +441.7575318189338 +57263.52229878865 +-6994.426150040701 +21440.117453611456 +28432.474001478404 +47334.953922804445 +108792.74502691627 +42489.01418703981 +37794.358047305606 +19553.056660628878 +38773.96545336023 +64650.62882698048 +52486.9730836004 +55037.82026125491 +66225.85890514776 +19537.406941662543 +36313.92086770572 +70991.33860983606 +82826.11299331952 +27010.14679483883 +77719.36095893942 +63586.38589073066 +3692.128837648779 +52185.595888410695 +30243.493709813803 +26538.270424441434 +40672.197630347684 +13496.314370943233 +61472.22179499548 +26627.651380738243 +9804.596689604223 +37206.32479644101 +64773.30105417501 +2479.8992359647527 +8103.6763726994395 +14271.6574880369 +21698.248646833934 +73890.30033204425 +44999.45856548846 +41370.59968037531 +15672.816182065755 +51147.46887974255 +43672.86095144879 +32170.897533582523 +36324.823935443535 +53746.94073555805 +70991.33860983606 +4660.016995772719 +40786.56962629128 +34769.18826175667 +38020.106515085325 +34097.156287359074 +23311.010898916982 +44275.82989284489 +14231.4020859804 +45377.32441054005 +43782.103708635084 +26345.670811467804 +41448.37065543607 +78955.83777604997 +33660.38598313928 +101094.52184378915 +65859.19690509327 +85657.7185835354 +55314.92019142024 +38607.726381431334 +6072.468710794114 +73965.57123226952 +29131.82216913812 +35112.46070280578 +-1620.290016964078 +53199.29802433122 +48521.77758379467 +13406.614418860525 +60118.85319816787 +23435.394766158424 +-8897.811816459522 +36868.14067732077 +42495.31697807368 +67077.17911950964 +38255.49904301856 +84184.92517225817 +19152.640760115348 +18131.216736312024 +81007.69247809984 +31549.683841876686 +22763.1440307796 +47393.88135965075 +14301.417955396697 +-31245.45605109725 +6217.392485652119 +50144.79652815405 +63386.59513617307 +53750.56052009668 +34231.91987552121 +26966.847615707666 +-3393.361328165047 +64971.60455447808 +58584.39463351015 +54280.455220110714 +42815.08654848393 +37402.5306217242 +111269.29517367482 +70990.28089407645 +12278.307308901101 +13774.663689951412 +23133.71749027632 +81055.17216330115 +38452.56926418841 +56818.7476348225 +53295.30342105683 +70947.20142427552 +7126.745919477195 +39591.26097805612 +25339.371963944286 +43119.07495636586 +13138.015750058927 +35070.213954134844 +46051.489695601165 +56930.34183457028 +11717.412979880348 +14765.804181976244 +26817.7211085679 +-4130.236180292442 +36875.32030184381 +60062.62109667808 +35692.90094462875 +31962.97215234209 +51665.962861665525 +51984.495941673405 +116973.74009263795 +26204.87294327095 +23038.328227185644 +24893.956379749812 +41179.92855453305 +51907.10979949031 +55730.81857422553 +2429.3768009701744 +16294.82969474513 +74042.90200668108 +21534.36753195338 +40904.09359956067 +37693.67450594809 +24107.00565285608 +24746.739622352645 +28015.53627097886 +9427.094354018569 +2930.5016946187243 +4225.385254815221 +3830.365001442842 +30238.321178398095 +45191.52180307638 +19731.37010182906 +30886.976818764582 +40475.439269345254 +35718.89537294395 +53323.63617669139 +54694.360771190375 +32261.622473137453 +70002.47454350628 +-4066.5732523547485 +43470.60629361868 +46397.45747200679 +21473.970137080178 +-1474.6928989533335 +29497.915250968188 +7898.273841271177 +19996.14931319747 +40455.42558035627 +48908.61307288706 +50718.02046178095 +57538.38555653393 +62106.68981672544 +54319.710164044984 +45879.85347507708 +3758.7256447710097 +63673.38952907268 +72812.37946834415 +23679.78947965242 +50594.04139527306 +29259.920767149888 +61834.768035728484 +9590.213300419971 +51578.04267433658 +29822.45246985648 +34689.29743246175 +57218.38701041229 +86016.57565096114 +39189.34083570633 +33061.016391094774 +15325.00062689744 +55730.701050252654 +-1642.7393072163686 +10383.564487546682 +31116.645611652173 +30687.825153191574 +82723.36299721804 +56244.72737366613 +26067.866939558648 +86251.03597763274 +65396.41316044796 +23918.75215918664 +-4448.305520422757 +20807.045124443248 +53552.5333035551 +19012.71037514787 +29270.690203934908 +43017.570714383386 +38980.367216782644 +-21722.371925648302 +23233.430572100915 +-26504.168640998192 +26498.57364891097 +14736.909104188904 +60770.338409894146 +-5222.570752548054 +24857.996990053914 +90972.7762549622 +24825.969975490123 +21367.82539967727 +4629.949567643926 +23454.343907522038 +16652.47290190123 +33385.50584761053 +6257.720964981243 +37030.43176093977 +49104.474042279646 +-14190.114056788385 +-29447.489925610833 +42470.44301119167 +11680.812482675537 +69393.94760767836 +34477.21712747682 +54169.55849705823 +252.65341034624726 +47923.044159539044 +37877.63701524772 +16709.599480297416 +47307.19573870953 +3434.0654382873327 +68571.27979479358 +113381.27003430761 +74175.5814021714 +10112.029075863771 +85332.01037091762 +36980.22881727293 +49459.935053224675 +43966.511696206406 +40659.93682250753 +-14333.623190606944 +28192.53817809373 +25452.411648046225 +20178.192099978216 +53015.05224833265 +33695.56888017338 +29706.35793242231 +60344.60166594852 +70876.56165880337 +46632.505418544635 +29934.801735557616 +68477.37042412255 +9756.191622992046 +53293.738750915974 +7361.793866015971 +18137.836220836267 +52290.135238748975 +35754.19281640742 +-47064.756451673806 +47798.81524399761 +63973.16942550521 +-8081.1179091483355 +76179.56553521194 +53741.64654312283 +41097.41440489236 +119434.29659786448 +26140.885736136697 +85476.75444758125 +19005.966698426753 +49929.780813485384 +62485.71971538849 +37839.17081580218 +38156.51110109128 +24354.36740929354 +95406.31378803402 +-8824.590967658907 +8581.846367205493 +-9599.75067668967 +-356.5790757499635 +34477.908213727176 +18026.021914063953 +45003.682359110564 +-26324.318066866137 +47102.60131162219 +32366.220440293662 +26437.41620269697 +12778.856721428223 +85941.11816577706 +72935.68705570791 +54768.23507694993 +51349.367971474305 +40694.153001697734 +24213.83006157074 +70991.33860983606 +49649.920098450035 +6216.4980087457225 +31955.983176061884 +30818.18593910057 +106672.45472514164 +53444.2500833245 +38755.70387415122 +58346.30928749498 +37584.05395372119 +86396.01127795782 +32991.37199584395 +68866.21152394172 +47377.47922294494 +39117.57527271751 +60474.32084980793 +24197.090437815525 +-16245.747681073844 +28425.78943705093 +-13978.781855345704 +13773.530246593058 +82341.58957470581 +65231.56758334953 +63165.177024409175 +14441.839760564268 +47382.051995748654 +67096.75578487385 +75743.84493492357 +49047.998442046344 +8984.025646208785 +43456.81673807092 +83213.01131163538 +24607.416895519942 +84461.11637592688 +54378.82786155678 +-1032.5622076746076 +77394.87726874277 +10221.893874447793 +7594.721958319657 +46408.39740340412 +37942.335540025495 +-5589.961169366725 +94472.92257269379 +25597.184161381796 +29142.3967938805 +83063.39965649787 +-5879.5550498766825 +113622.59478556644 +6608.062030856498 +73210.97647453193 +48489.03961480409 +156428.32501493022 +-10187.370543035679 +62.99371342547238 +21306.419520949014 +31199.091883554123 +45409.32463005092 +29303.2635776205 +12514.373924542218 +2609.9127240134403 +3245.4404704524204 +38137.63048835471 +12412.310385451652 +30066.30012499634 +31782.227101302706 +54938.49889556412 +6551.134548216127 +55133.793843894266 +49308.71932291705 +49692.93239607476 +82219.95226237178 +-394.1359220556915 +52110.49806949124 +9511.844197695144 +13130.343516086228 +-6762.696214946918 +20664.767096336 +54580.26851596404 +27746.659011940472 +24336.877936080098 +85471.96246448625 +12230.163311754353 +40073.263201610185 +17468.855567168444 +-20558.463752151467 +34854.3295095833 +68652.90551245864 +35103.91429412551 +-6136.889326424338 +59075.49668779131 +30583.713473683223 +54531.81472850125 +49545.852172030136 +51681.33936936129 +30701.90203339327 +49939.876010936685 +33064.03072223533 +80665.04812938068 +28819.33901353646 +55721.413710240275 +38422.16650023218 +32043.948106786236 +101733.43125287723 +24372.020725026727 +26418.382016239688 +23518.265892415307 +-11681.972787048668 +101975.601806649 +7217.848035724834 +59521.34671938885 +59669.68402588274 +46527.692255776376 +95786.0295906011 +-11512.228098440915 +74042.6669587344 +76801.38120373338 +10159.095329549164 +76215.1787194116 +2719.1124758850783 +51526.229412498884 +13133.799697395414 +-54126.03034139052 +4726.930144697428 +16933.644808714278 +38520.65592761338 +130386.06488126703 +37987.148308523 +-1128.7251225477085 +57563.56558205746 +-9239.9991323594 +-6363.191672407091 +37548.196542858146 +37643.87586747296 +70002.23949556053 +66634.01461942401 +50238.11544591654 +30418.497411369346 +31904.88525994774 +18556.13036913704 +72656.35417005047 +19120.476340554655 +-7499.208293271251 +39735.24117909279 +3723.6629433389753 +74336.86295829993 +35488.69135041814 +6027.813776700757 +14674.546857498586 +23408.353158860467 +7271.709081056528 +24667.186330892146 +33129.07033085078 +-11466.35048107151 +3989.164409328252 +11940.671457075514 +4824.4175234511495 +70931.05873893574 +46820.04526123032 +6657.2255075210705 +74043.25457860064 +6016.30014697928 +-30042.392297217622 +41665.65392711386 +58759.20326654706 +70930.673906059 +62657.25322231464 +47205.9229878122 +6657.498762730509 +31308.35074772034 +23191.532521624118 +80995.76059016027 +31714.598966982216 +25951.78745178785 +50580.81240584515 +67939.1875931248 +4682.4012086289 +12741.223577454686 +26111.517341835424 +74836.00493610837 +81761.9613385424 +15929.926195692271 +86250.4483577665 +1352.1676071248949 +65626.00083853956 +82415.98224978521 +60525.53736523166 +2806.0492987502366 +31812.489972509444 +88578.44433507882 +27350.1688005412 +63502.11329986807 +63759.082038372755 +7993.332023954019 +34846.9592368165 +50761.748105128296 +35034.03983153682 +35141.857271298766 +36328.02891482785 +58098.1136078313 +30284.868968253955 +70990.8685139427 +36257.2469160473 +29427.967175412923 +17959.020375788212 +8900.374955300242 +51058.71058919281 +15306.49142559059 +28869.72801504098 +34343.905137176625 +656.6990793580189 +33674.777799057774 +11055.559472355992 +68374.18437559158 +58598.44407939259 +53149.13304424379 +26622.93045395147 +76839.49966313317 +11294.387879399583 +50547.34455525316 +64247.38127379492 +68591.55799841136 +-35227.56810449902 +38074.2957289163 +86453.28764128406 +1734.292307681404 +45819.888564823195 +53773.643766780384 +111650.458581849 +38637.212346703745 +5425.753673338331 +3401.4920646017417 +61834.768035728484 +22810.65213463269 +14974.179069569334 +77810.47608168703 +28607.994697884656 +21306.49920993764 +838.728903577663 +58763.25324731413 +52380.55701171886 +110620.57408379391 +44993.773936178535 +16087.936282238923 +33913.3613921823 +40988.89026599284 +47109.205455023795 +58486.009535096586 +-8680.749018913135 +19721.192156193778 +40840.68187354691 +48416.84348603897 +23215.290862549096 +25477.017331137322 +9218.034264521673 +97509.69082241878 +18523.172162573785 +58001.30182508752 +-1689.096448827535 +69839.00317841955 +24259.149776773527 +29330.702765930444 +52706.118884569965 +5193.910706184804 +42223.74749450106 +-10952.33629640378 +41233.006791563705 +65804.43185071088 +25231.147469433956 +99796.56437715609 +33168.66540448461 +40298.959950800985 +27720.824601857923 +6058.836204390973 +74244.80109841283 +23819.8250611173 +34057.44027873874 +44550.63083759323 +4595.567619637586 +4874.296992939897 +55187.906091148965 +5389.716582301073 +19344.681773035787 +104583.21955246199 +38893.4758941466 +35585.25193123892 +8872.48314025253 +11940.671457075514 +34434.58242498897 +-24356.0965735605 +42634.63139555324 +62903.26537068188 +13234.90123176016 +61835.00308367517 +39236.80129298754 +44668.503034817055 +10985.543602939695 +13602.804553933442 +21149.114629026502 +23085.262431137264 +58521.02567625232 +27943.49833338335 +2037.051882953383 +22209.057852117345 +32282.585865586065 +24032.71822422743 +27497.636649232358 +42404.8473602375 +19483.24221602641 +45483.55391192157 +36564.24517145194 +88348.0909810476 +20295.140592126176 +33241.71676793508 +86251.03597763274 +-18413.10171659477 +29629.162438482977 +54424.265208089724 +67955.62098152563 +73281.7069478454 +19402.456909826025 +20705.414571451023 +14452.593187320046 +22172.666045548394 +22036.085254566744 +-10218.399543607607 +21551.09783715848 +34666.02353753336 +59325.43376975786 +30082.588580034673 +59953.69157490507 +32331.868214999326 +22900.736919592135 +56805.63061580062 +4757.667496576905 +7459.824404862709 +30969.243600053713 +16783.780643096194 +-570.1550019066781 +74997.33265671786 +11042.026906353422 +38342.348748209886 +8047.444271208718 +-13965.192272052169 +-9510.560368636623 +24000.827935307287 +-6842.151096440852 +26430.236578173935 +85006.7760784775 +40013.38987874519 +27067.293754364364 +6514.388439615257 +61834.768035728484 +8117.460140625015 +61748.28520177677 +15362.72352708131 +30257.42977994401 +28756.86666751001 +21832.251723384485 +26963.55354902055 +55978.01204740908 +82809.39763999544 +21945.784490053542 +64742.61663499754 +88872.29912137985 +21071.451263399795 +69128.44614168908 +32604.984001489356 +3324.5446568178013 +744.4788252357394 +80809.5349306995 +50033.61339176819 +37865.063079510815 +26312.521956660785 +29958.460463362746 +-16426.82514571771 +12781.361408540979 +12952.997629065067 +26930.595342458226 +8954.677850799635 +-26007.399688975886 +35096.24921434373 +28125.086480363272 +70633.17211760674 +12217.015437122434 +30361.554818164557 +67836.4566405518 +35703.67038141377 +24956.34652468562 +51720.948879707605 +-19410.47255952563 +6941.2528537539765 +13814.59733281564 +59156.66329048015 +31117.2210927736 +9665.340708668344 +38177.95896768477 +-1737.2478276630864 +61835.23813162185 +-17708.90483226627 +34959.859028168954 +41770.34108774364 +-2358.0771024953574 +62676.03809944261 +51631.92402186617 +3836.0746679399163 +42603.54147258494 +28779.4468414383 +4151.501151094213 +28216.179423896596 +61247.73578924872 +71474.89338280447 +-3535.436689423397 +54468.403002487496 +13779.078467375599 +-10560.188418352045 +35767.08210742753 +25840.548626136035 +15336.301670059562 +7089.0230192942545 +55730.701050252654 +34295.194734673016 +15152.257318874821 +62224.98523825593 +103181.034707129 +74221.72999047395 +41879.563627506606 +36274.86362285819 +41759.35627513565 +29169.695779964328 +112383.4318385804 +16972.086615146138 +13188.198773988523 +39336.71959709562 +48905.02326062508 +-30409.898947192356 +40817.02314574178 +35762.41976903193 +-10983.600151245482 +49016.837567398325 +11475.132930438966 +5074.726126645692 +26227.956189954653 +7317.8382965950295 +15467.933690451086 +73573.3937334707 +76800.06521027721 +24081.336418489926 +15627.139867920429 +62728.22998613957 +60808.0934156226 +29452.89577424433 +135083.9244333608 +8226.334531344473 +66275.51528140064 +53511.23886473104 +44560.22606192622 +78919.36187223345 \ No newline at end of file