diff --git a/dev-0/out.tsv b/dev-0/out.tsv index c451e36..c1fed03 100644 --- a/dev-0/out.tsv +++ b/dev-0/out.tsv @@ -1,462 +1,462 @@ -525398.4375 -517908.5 -527081.0625 -522168.1875 -577209.125 -587993.25 -521458.25 -523233.09375 -544626.75 -521813.21875 -542834.125 -519878.59375 -525891.875 -549912.3125 -525313.25 -522171.71875 -520169.6875 -394991.40625 -521632.1875 -567404.75 -522853.28125 -469051.1875 -522594.15625 -479682.6875 -525362.9375 -555790.6875 -484457.09375 -522193.03125 -525008.0 -528476.0625 -520038.34375 -520748.28125 -527031.3125 -547129.3125 -527031.3125 -470364.59375 -532874.25 -576385.625 -518696.53125 -533814.9375 -520119.96875 -477180.125 -466637.375 -522484.125 -531841.25 -576257.8125 -542379.75 -546493.875 -519690.46875 -542301.625 -541471.0 -468412.25 -517837.5 -524298.0625 -530190.625 -520393.3125 -544963.9375 -559056.4375 -555435.6875 -565629.875 -515909.96875 -577493.125 -540171.8125 -502844.8125 -535657.25 -549131.375 -544531.625 -531141.9375 -525217.4375 -554370.75 -515494.65625 -517631.59375 -522523.15625 -472494.4375 -519715.3125 -486160.96875 -527670.3125 -483186.28125 -520592.09375 -477535.09375 -467524.8125 -568270.875 -519328.375 -519683.34375 -468412.25 -522359.875 -567049.75 -525717.9375 -516843.5625 -567404.75 -577696.1875 -530552.6875 -579828.875 -477180.125 -465572.4375 -470897.0625 -464294.53125 -525714.375 -522203.6875 -570138.0625 -479061.5 -521103.25 -522381.15625 -519317.75 -565711.5 -565541.125 -479416.46875 -519385.1875 -519410.03125 -521280.75 -521032.25 -573539.4375 -467549.65625 -525150.0 -519370.96875 -521032.25 -521742.21875 -522239.1875 -518547.4375 -574859.1875 -516311.09375 -476576.65625 -505248.0 -540236.375 -523588.09375 -558389.125 -517943.96875 -550466.0625 -520290.375 -526427.875 -546206.375 -418848.53125 -521767.78125 -522700.65625 -521564.71875 -465551.125 -566339.8125 -467372.15625 -517908.5 -522949.125 -588632.25 -532462.4375 -576953.5625 -582956.1875 -527847.75 -567795.1875 -549401.125 -554473.75 -547310.3125 -483321.1875 -467901.0625 -522072.34375 -487758.375 -521813.21875 -482490.53125 -517908.5 -470062.875 -527457.3125 -519974.4375 -550466.0625 -521639.28125 -552950.875 -521795.46875 -520748.28125 -522193.03125 -515984.53125 -484854.6875 -466104.90625 -527492.8125 -540171.8125 -519317.75 -571071.625 -522171.71875 -525362.9375 -559294.3125 -571501.125 -479121.8125 -516531.1875 -522505.40625 -520567.25 -557693.375 -570244.5 -563145.0625 -517170.125 -514507.8125 -468767.21875 -522359.875 -540019.125 -527421.8125 -523233.09375 -492095.4375 -528905.625 -520038.34375 -580148.3125 -520208.71875 -529267.6875 -521103.25 -523793.96875 -526676.375 -530332.625 -520038.34375 -464276.78125 -515991.625 -525362.9375 -469271.28125 -519328.375 -523233.09375 -544076.5 -550231.75 -519232.53125 -525717.9375 -530687.5625 -597201.3125 -567404.75 -527492.8125 -571849.0 -523375.09375 -531610.5 -522597.6875 -521103.25 -522682.90625 -569928.625 -561015.1875 -571962.625 -570219.6875 -521458.25 -578760.375 -517908.5 -520567.25 -515920.625 -518774.625 -516062.625 -519328.375 -543366.5625 -527393.4375 -577649.3125 -521458.25 -469932.25 -519186.40625 -544431.5 -568171.5 -565658.25 -544303.6875 -515423.65625 -571557.9375 -521209.75 -521316.25 -545567.375 -522132.6875 -550856.5 -523446.09375 -519158.0 -515991.625 -535735.3125 -520482.0625 -521309.15625 -522523.15625 -589935.0 -557565.5625 -550466.0625 -541321.875 -566233.3125 -579899.875 -515100.625 -571238.4375 -536367.1875 -565008.625 -539926.875 -497520.1875 -516587.96875 -515778.625 -472458.9375 -496810.21875 -513528.09375 -524106.34375 -550519.3125 -553309.375 -551885.9375 -521813.21875 -487687.375 -471074.5625 -478301.84375 -564919.9375 -524287.375 -579473.875 -517908.5 -545720.0625 -564675.0 -527137.8125 -518192.46875 -490385.1875 -524564.25 -521458.25 -472657.75 -470222.59375 -514433.28125 -520159.03125 -522700.65625 -521745.75 -544786.4375 -473381.875 -533609.0 -481191.34375 -536104.5 -517908.5 -546667.8125 -571284.625 -564564.9375 -575430.75 -569552.3125 -521376.59375 -564859.5625 -559375.9375 -606097.0 -574859.1875 -517908.5 -523410.59375 -529384.8125 -540608.375 -528557.75 -469338.71875 -484386.09375 -576989.0625 -567049.75 -569534.5625 -517209.1875 -396297.6875 -519811.15625 -470542.09375 -465501.4375 -521103.25 -515256.8125 -524043.1875 -526995.8125 -580858.25 -512429.125 -525362.9375 -471962.0 -521617.96875 -466758.0625 -529544.5625 -478660.375 -572179.125 -520393.3125 -538574.375 -531788.0 -538574.375 -574837.875 -480026.28125 -521145.84375 -520230.03125 -522345.65625 -567149.125 -610711.6875 -539589.625 -568171.5 -517912.03125 -540693.625 -516822.25 -547981.25 -526924.875 -580858.25 -595447.75 -469832.125 -525398.4375 -572729.375 -523907.5625 -519702.5625 -574837.875 -521454.6875 -522523.15625 -516151.34375 -519505.875 -544638.125 -576882.5625 -519062.15625 -543011.5625 -469832.125 -519796.9375 -549756.125 -568881.4375 -515346.28125 -584294.4375 -521390.78125 -588703.25 -511324.4375 -572338.875 -515118.375 -566539.3125 -515157.4375 -568672.0 -568448.375 -529267.6875 -575711.125 -572019.375 -588703.25 -552950.875 -575757.3125 -467382.8125 -524695.625 -523368.0 -565020.0 -491734.09375 -482895.21875 -476008.6875 -411206.65625 -561040.75 -574149.25 -519665.625 -548691.1875 -536700.875 -539997.875 -577035.1875 -544442.125 -534610.0625 -580723.375 -531497.625 -523481.59375 -577028.125 -579307.0625 -511264.09375 -519317.75 -536277.6875 -527723.5625 -520790.875 -569925.0625 -522370.53125 -522370.53125 -521241.6875 -522313.71875 -534446.75 -534290.5625 -546490.3125 -555968.1875 -550395.0625 -532448.25 -487651.875 -584656.5 -586318.5 -521820.3125 -572651.25 -587471.4375 -576889.6875 -545176.9375 -548588.25 -552890.5625 -637050.8125 -527578.0 -517241.125 -520744.75 -517195.0 -578050.4375 -517195.0 -521255.90625 -575622.375 -530254.5 -580496.1875 -530254.5 -572101.0625 -523644.875 -437410.1875 -529942.125 +361492.0 +355634.5625 +362807.84375 +358965.8125 +349667.53125 +358101.125 +358410.59375 +359798.625 +343540.84375 +358688.21875 +342138.9375 +357175.28125 +361877.875 +347674.34375 +361425.375 +358968.59375 +357402.90625 +343113.9375 +358546.625 +342000.125 +359501.59375 +346600.9375 +359298.9375 +354915.15625 +361464.25 +352271.4375 +358648.90625 +358985.25 +361186.625 +363898.8125 +357300.1875 +357855.40625 +362768.96875 +345497.9375 +362768.96875 +347628.09375 +367338.3125 +349023.5 +356250.84375 +368073.96875 +357364.03125 +352958.0625 +344713.25 +359212.875 +366530.5 +348923.5625 +341783.59375 +345001.03125 +357028.15625 +341722.53125 +341072.9375 +346101.25 +355579.0625 +360631.4375 +365239.65625 +357577.78125 +343804.5625 +354825.40625 +351993.84375 +340612.125 +354071.65625 +349889.625 +340056.90625 +373028.75 +369514.71875 +347063.625 +376454.8125 +365983.625 +361350.40625 +351161.03125 +353746.875 +355418.03125 +359243.40625 +349293.6875 +357047.5625 +359981.40625 +363268.65625 +357655.09375 +357733.25 +353235.65625 +345407.25 +342677.5 +356745.0 +357022.59375 +346101.25 +359115.71875 +341722.53125 +361741.84375 +354801.75 +342000.125 +369402.34375 +365522.78125 +351716.25 +352958.0625 +343880.4375 +348044.46875 +342881.0625 +361739.0625 +358993.5625 +344137.6875 +354429.34375 +358133.0 +359132.375 +356736.65625 +340675.96875 +340542.71875 +354706.96875 +356789.40625 +356808.84375 +358271.8125 +358077.46875 +366151.59375 +345426.6875 +361297.6875 +356778.3125 +358077.46875 +358632.6875 +359021.34375 +356134.25 +347829.8125 +354385.34375 +352486.125 +374908.125 +373095.8125 +360076.21875 +354303.5 +355662.34375 +348107.40625 +357497.28125 +362297.03125 +344776.15625 +342232.75 +364804.09375 +359382.21875 +358493.875 +343863.78125 +341167.3125 +345287.875 +355634.5625 +359576.53125 +358600.8125 +367016.3125 +349467.65625 +354161.9375 +363407.46875 +342305.5 +347274.59375 +351241.53125 +345639.5 +357760.59375 +345701.5 +358890.84375 +361230.625 +358688.21875 +357111.0 +355634.5625 +347392.125 +363102.09375 +357250.21875 +348107.40625 +358552.1875 +350050.625 +358674.34375 +357855.40625 +358985.25 +354129.96875 +358959.84375 +344296.84375 +363129.84375 +340056.90625 +356736.65625 +344867.78125 +358968.59375 +361464.25 +355011.40625 +345203.6875 +354476.53125 +354557.46875 +359229.53125 +357713.8125 +353759.40625 +344220.96875 +338668.90625 +355057.15625 +352975.125 +346378.875 +359115.71875 +339937.53125 +363074.34375 +359798.625 +341599.25 +364234.71875 +357300.1875 +351966.09375 +357433.4375 +364517.875 +358133.0 +360237.21875 +362491.375 +365350.6875 +357300.1875 +342867.1875 +354135.53125 +361464.25 +346773.0625 +356745.0 +359798.625 +343110.5625 +347924.1875 +356670.03125 +361741.84375 +365628.28125 +365302.15625 +342000.125 +363129.84375 +345475.71875 +359909.65625 +366350.0625 +359301.71875 +358133.0 +359368.34375 +343973.90625 +337003.28125 +345564.5625 +344201.53125 +358410.59375 +350880.65625 +355634.5625 +357713.8125 +354080.0 +356311.9375 +354191.03125 +356745.0 +342555.34375 +363052.125 +350011.75 +358410.59375 +362596.15625 +356633.9375 +343388.15625 +342599.75 +340634.34375 +343288.21875 +353691.34375 +345248.09375 +358216.28125 +358299.5625 +344276.46875 +358938.0625 +348412.78125 +359965.1875 +356611.75 +354135.53125 +369575.8125 +357647.1875 +358294.0 +359243.40625 +359619.59375 +353659.46875 +348107.40625 +340956.34375 +341084.03125 +351771.75 +353438.71875 +344998.25 +370069.9375 +340126.3125 +339865.375 +368864.71875 +354601.875 +353968.96875 +349265.9375 +368309.5 +352208.9375 +360481.53125 +348149.03125 +350331.0 +349217.8125 +358688.21875 +361175.09375 +348183.28125 +353835.28125 +340056.90625 +360623.09375 +351438.65625 +355634.5625 +344395.84375 +339865.375 +362852.25 +355856.65625 +363284.90625 +360839.625 +358410.59375 +349421.40625 +347517.03125 +352916.84375 +357394.5625 +359382.21875 +358635.46875 +343665.75 +349987.71875 +367912.96875 +356094.96875 +369864.5 +355634.5625 +345137.0625 +345034.34375 +339779.3125 +348276.75 +343679.625 +358346.75 +340009.71875 +355075.25 +372258.875 +347829.8125 +355634.5625 +359937.40625 +364609.46875 +340398.375 +363962.65625 +346825.8125 +358593.40625 +349495.40625 +341722.53125 +343665.75 +355087.6875 +344135.5 +357122.53125 +347766.875 +343824.90625 +358133.0 +353560.875 +366583.53125 +362741.21875 +352521.28125 +380524.03125 +361464.25 +348877.28125 +358535.53125 +344807.625 +364734.40625 +354115.65625 +345733.90625 +357577.78125 +338807.6875 +366488.84375 +338807.6875 +347813.15625 +332160.75 +358166.3125 +357450.09375 +359104.625 +341800.25 +375867.71875 +339601.65625 +342599.75 +355637.34375 +340465.0 +354785.09375 +346164.1875 +362685.6875 +352521.28125 +363930.78125 +347211.6875 +361492.0 +346164.1875 +360326.0625 +386212.125 +347813.15625 +358407.84375 +359243.40625 +354260.4375 +356883.78125 +376538.09375 +349412.125 +356536.78125 +342277.75 +347211.6875 +357111.40625 +347552.1875 +343154.96875 +359782.28125 +355208.5 +358357.875 +358656.3125 +356637.03125 +345858.8125 +353452.625 +360677.28125 +353483.15625 +342991.1875 +342816.28125 +364517.875 +348496.0625 +345608.96875 +358656.3125 +350050.625 +348532.125 +345296.21875 +360942.34375 +359904.09375 +359489.125 +364339.78125 +357427.46875 +352041.96875 +355794.84375 +356377.1875 +347274.59375 +357008.71875 +346719.375 +370330.875 +339920.875 +349531.5 +343396.46875 +368695.8125 +352415.8125 +372413.21875 +359992.9375 +349525.96875 +351308.15625 +356589.84375 +356736.65625 +337011.59375 +363310.3125 +357888.71875 +343971.125 +359124.03125 +359124.03125 +358241.28125 +359079.625 +368568.09375 +368445.96875 +344998.25 +352410.25 +348051.875 +367005.1875 +361147.34375 +355491.65625 +376145.3125 +358693.75 +346103.09375 +357693.03125 +349417.6875 +343971.125 +346638.875 +350003.4375 +396465.84375 +363196.46875 +355112.6875 +357852.625 +355076.59375 +350325.4375 +355076.59375 +358252.375 +348426.65625 +365289.59375 +352238.125 +365289.59375 +345672.8125 +360120.625 +356748.59375 +365045.3125 diff --git a/model.pkl b/model.pkl index c5e106d..bbcc4ee 100644 Binary files a/model.pkl and b/model.pkl differ diff --git a/predict.py b/predict.py index 988fa7e..90ddf01 100644 --- a/predict.py +++ b/predict.py @@ -17,7 +17,25 @@ def read_data_file(filepath): def dataframe_to_arrays(dataframe): dataframe1 = dataframe.copy(deep=True) - dataframe1["type"] = dataframe1["type"].astype('category').cat.codes + #dataframe1["type"] = dataframe1["type"].astype('category').cat.codes + + + dataframe1 = pd.get_dummies(dataframe1, columns=['type']) + if 'type_apartamentowiec' not in dataframe1: + dataframe1['type_apartamentowiec'] = 0 + if 'type_blok' not in dataframe1: + dataframe1['type_blok'] = 0 + if 'type_dom wolnostojÄ…cy' not in dataframe1: + dataframe1['type_dom wolnostojÄ…cy'] = 0 + if 'type_loft' not in dataframe1: + dataframe1['type_loft'] = 0 + if 'type_kamienica' not in dataframe1: + dataframe1['type_kamienica'] = 0 + if 'type_plomba' not in dataframe1: + dataframe1['type_plomba'] = 0 + if 'type_szeregowiec' not in dataframe1: + dataframe1['type_szeregowiec'] = 0 + return dataframe1 #PREDICT_FILE_PATH = 'dev-0/in.tsv' @@ -31,7 +49,7 @@ def main(): for index, row in data.iterrows(): #print(row[0], row[1]) - x = torch.tensor([float(row[0]), float(row[1]), 1]) + x = torch.tensor([float(row[0]), float(row[1]), 1, float(row[3]), float(row[4]),float(row[5]),float(row[6]),float(row[7]),float(row[8])]) y = x @ w print(y.item()) diff --git a/test-A/out.tsv b/test-A/out.tsv index 837d29a..c682f4e 100644 --- a/test-A/out.tsv +++ b/test-A/out.tsv @@ -1,418 +1,418 @@ -526424.3125 -527137.8125 -522576.40625 -545414.75 -520166.125 -537396.625 -569712.0625 -508069.3125 -432451.1875 -521763.5 -526069.375 -526427.875 -521600.21875 -517908.5 -521458.25 -521813.21875 -536580.1875 -498484.96875 -515068.6875 -476548.25 -530687.5625 -515423.65625 -546916.3125 -518263.46875 -584798.5 -521745.75 -527013.5625 -424897.3125 -538861.9375 -521742.21875 -490420.6875 -477641.59375 -501069.9375 -541552.625 -544786.4375 -530190.625 -473026.90625 -524298.0625 -519683.34375 -554292.6875 -527031.3125 -573400.25 -566872.25 -525717.9375 -517553.5 -522359.875 -526108.375 -517102.6875 -515317.15625 -586928.375 -525373.625 -539390.8125 -542976.0625 -526356.875 -521458.25 -478003.65625 -550966.5625 -541925.375 -546398.0625 -519186.40625 -585401.9375 -473381.875 -521813.21875 -484386.09375 -518075.3125 -548336.1875 -558311.0 -572864.25 -471962.0 -518334.46875 -466992.34375 -575924.125 -477109.125 -475462.03125 -520641.78125 -526605.375 -519399.375 -470542.09375 -521745.75 -523943.0625 -538518.3125 -534546.1875 -552727.25 -526960.375 -515778.625 -523705.21875 -519356.78125 -526250.375 -521671.21875 -517908.5 -524010.5 -467336.65625 -526214.875 -471962.0 -570599.5 -503909.71875 -541159.3125 -477180.125 -567440.25 -566588.3125 -523233.09375 -522168.1875 -522878.125 -525362.9375 -519434.875 -520783.78125 -526782.875 -585820.8125 -585632.6875 -569179.625 -493970.4375 -523960.8125 -515121.9375 -543366.5625 -586395.875 -515104.1875 -569211.5625 -523339.59375 -495645.1875 -568434.1875 -496071.15625 -519839.5625 -520680.84375 -521997.78125 -554136.5 -465501.4375 -543224.5625 -522193.03125 -525313.25 -525717.9375 -475937.6875 -573978.875 -517908.5 -518263.46875 -526889.375 -441995.71875 -520748.28125 -522168.1875 -572374.375 -561470.25 -573080.75 -516531.1875 -527066.8125 -527279.8125 -535302.25 -569534.5625 -520180.3125 -493970.4375 -526782.875 -522271.125 -515359.75 -519683.34375 -516864.84375 -528202.75 -567049.75 -521103.25 -504261.15625 -499912.71875 -522004.90625 -540520.375 -528202.75 -568114.6875 -521458.25 -549312.375 -528316.375 -536277.6875 -525494.3125 -524298.0625 -523233.09375 -525714.375 -564103.5 -529729.125 -522335.03125 -518263.46875 -567138.5 -520059.625 -570599.5 -545567.375 -553305.875 -542766.625 -517908.5 -477996.5625 -530687.5625 -523304.09375 -518100.15625 -518689.4375 -554558.9375 -529367.8125 -523233.09375 -527989.75 -499904.875 -572349.5625 -570954.5 -495745.3125 -515750.25 -574894.6875 -519683.34375 -472671.9375 -520073.84375 -522878.125 -596938.625 -574859.1875 -518930.8125 -521209.75 -580538.8125 -523577.4375 -513528.09375 -469771.78125 -518845.625 -551689.375 -521788.375 -546561.3125 -568789.125 -478848.5 -518618.4375 -488645.8125 -481191.34375 -513528.09375 -515991.625 -555535.8125 -521813.21875 -472377.3125 -469832.125 -515121.9375 -547981.25 -518653.9375 -524408.0625 -495390.3125 -520038.34375 -520038.34375 -521813.21875 -529420.3125 -517731.0 -519683.34375 -430818.3125 -548637.9375 -482721.28125 -531597.75 -549046.1875 -522913.625 -575569.125 -577699.0 -521813.21875 -520418.15625 -576634.0625 -550572.5625 -540171.8125 -517908.5 -519740.15625 -533988.875 -545490.0625 -515423.65625 -547310.3125 -519044.40625 -481191.34375 -557636.5625 -551673.0 -531354.9375 -548637.9375 -562825.5625 -518732.03125 -518976.96875 -531940.625 -526214.875 -475618.21875 -519985.09375 -521032.25 -528202.75 -556145.625 -528557.75 -528202.75 -519974.4375 -535657.25 -432415.6875 -484208.625 -525008.0 -517127.53125 -523836.5625 -576634.0625 -546206.375 -571664.4375 -555790.6875 -527847.75 -522228.53125 -513528.09375 -570599.5 -570599.5 -576953.5625 -570954.5 -577699.0 -517567.71875 -516069.71875 -523584.53125 -530247.4375 -538603.5 -546348.375 -581958.6875 -567404.75 -521458.25 -568292.1875 -526924.875 -516985.5625 -543331.0625 -519385.1875 -519079.90625 -546561.3125 -586218.375 -516453.09375 -549720.625 -521813.21875 -569307.375 -573084.3125 -576989.0625 -567568.0 -570528.5 -523708.78125 -585863.4375 -534734.3125 -546873.6875 -521458.25 -564838.25 -545578.0625 -571309.4375 -572019.375 -568544.1875 -516879.0625 -547981.25 -577699.0 -526179.375 -586076.4375 -552418.4375 -517553.5 -460844.90625 -578029.125 -580006.375 -541591.6875 -519399.375 -522913.625 -552773.375 -564838.25 -525749.875 -470503.03125 -524901.5 -572608.6875 -540520.375 -532391.4375 -521032.25 -579307.0625 -573222.75 -516812.34375 -519328.375 -526356.875 -417851.0625 -532817.4375 -511518.9375 -521309.15625 -491286.8125 -518618.4375 -520038.34375 -508169.4375 -521057.125 -566460.5 -522803.59375 -525022.1875 -552950.875 -521632.1875 -528699.75 -497165.1875 -570954.5 -572835.875 -521458.25 -604872.3125 -566552.8125 -464188.03125 -569886.0 -557210.5625 -522168.1875 -568672.0 -547644.0 -568182.125 -544613.25 -517411.53125 -498833.59375 -574408.375 -546557.8125 -486292.3125 -521546.96875 -519654.96875 -454064.875 -454064.875 -466276.0 -529139.875 -446042.4375 -571621.8125 -523889.8125 -520893.8125 -521813.21875 -466935.53125 -521277.1875 -550466.0625 -521976.5 -531479.1875 -523389.3125 -523389.3125 -433469.9375 -518795.9375 -560057.5 -505436.125 -528692.625 -525096.75 -522012.0 -564575.5625 -517191.4375 -516832.90625 -521834.5 -531649.5625 -579697.5 -527791.0 +362294.28125 +362852.25 +359285.0625 +344157.125 +357400.125 +370874.96875 +343804.5625 +354091.40625 +352870.5 +358649.34375 +362016.65625 +362297.03125 +358521.65625 +355634.5625 +358410.59375 +358688.21875 +370236.5 +346596.125 +353413.75 +352463.9375 +365628.28125 +353691.34375 +345331.375 +355912.1875 +355602.6875 +358635.46875 +362755.09375 +346963.09375 +339032.5625 +358632.6875 +363312.65625 +353318.9375 +371640.75 +341136.78125 +343665.75 +365239.65625 +349710.09375 +360631.4375 +357022.59375 +351099.96875 +362768.96875 +346688.84375 +341583.71875 +361741.84375 +355356.96875 +359115.71875 +362047.21875 +355004.40625 +353608.0625 +357268.3125 +361472.5625 +339446.1875 +342249.96875 +362241.53125 +358410.59375 +353602.09375 +348498.8125 +341428.28125 +344926.0625 +356633.9375 +356074.625 +349987.71875 +358688.21875 +358593.40625 +355765.0625 +346441.78125 +354242.4375 +346269.65625 +348877.28125 +355967.6875 +344990.84375 +348662.59375 +352902.53125 +351614.46875 +357772.125 +362435.84375 +356800.5 +347766.875 +358635.46875 +360353.8125 +371752.21875 +368645.84375 +349875.75 +362713.46875 +353968.96875 +360167.84375 +356767.1875 +362158.25 +358577.15625 +355634.5625 +360406.5625 +345260.125 +362130.5 +348877.28125 +344498.5625 +373861.5625 +373817.5625 +352958.0625 +342027.90625 +341361.65625 +359798.625 +358965.8125 +359521.03125 +361464.25 +356828.28125 +357883.15625 +362574.65625 +356402.1875 +356255.0625 +343388.15625 +366088.6875 +360367.71875 +353455.375 +342555.34375 +356851.90625 +353441.5 +343413.125 +359881.90625 +344375.28125 +342805.1875 +344708.40625 +357144.71875 +357802.65625 +358832.5625 +350977.8125 +343824.90625 +342444.3125 +358985.25 +361425.375 +361741.84375 +351986.4375 +347141.34375 +355634.5625 +355912.1875 +362657.9375 +340748.78125 +357855.40625 +358965.8125 +345886.59375 +356713.09375 +346439.0 +354557.46875 +362796.71875 +362963.28125 +369237.125 +343665.75 +357411.21875 +366088.6875 +362574.65625 +359046.3125 +353641.375 +357022.59375 +354818.40625 +363685.0625 +341722.53125 +358133.0 +374136.40625 +370735.75 +358838.125 +373317.875 +363685.0625 +342555.34375 +358410.59375 +347205.1875 +363773.90625 +337011.59375 +361566.9375 +360631.4375 +359798.625 +361739.0625 +339418.4375 +364878.75 +359096.28125 +355912.1875 +341791.9375 +357316.84375 +344498.5625 +344276.46875 +350328.21875 +342086.1875 +355634.5625 +353596.53125 +365628.28125 +359854.15625 +355784.46875 +356245.3125 +351308.15625 +370747.59375 +359798.625 +363518.5 +347706.53125 +345867.15625 +344776.15625 +367476.6875 +353946.75 +347857.5625 +357022.59375 +349432.5 +357327.9375 +359521.03125 +365096.71875 +347829.8125 +356434.0625 +358216.28125 +352271.4375 +360067.90625 +352208.9375 +347164.46875 +356367.4375 +411226.9375 +358668.78125 +345053.78125 +343082.78125 +354262.78125 +356189.78125 +361924.625 +356094.96875 +352208.9375 +354135.53125 +385060.5 +358688.21875 +349202.09375 +347211.6875 +353455.375 +346164.1875 +356217.53125 +360717.5 +367199.09375 +357300.1875 +357300.1875 +358688.21875 +364637.25 +355495.78125 +357022.59375 +351593.5 +346677.75 +357291.4375 +395514.59375 +346997.0 +359548.78125 +348385.0 +350050.625 +358688.21875 +357597.21875 +349217.8125 +348190.6875 +340056.90625 +355634.5625 +357067.0 +368210.0 +377204.34375 +353691.34375 +345639.5 +356522.90625 +356094.96875 +353715.0 +349051.25 +366150.1875 +346677.75 +338419.0625 +356278.625 +356470.15625 +366608.21875 +362130.5 +351736.59375 +357258.5625 +358077.46875 +363685.0625 +352549.0625 +363962.65625 +363685.0625 +357250.21875 +369514.71875 +352842.71875 +358454.59375 +361186.625 +355023.84375 +360270.53125 +349217.8125 +344776.15625 +345331.375 +352271.4375 +363407.46875 +359013.0 +352208.9375 +344498.5625 +344498.5625 +349467.65625 +344776.15625 +350050.625 +355368.0625 +354196.59375 +360073.4375 +365284.0625 +371818.84375 +344887.21875 +353381.875 +342000.125 +358410.59375 +342694.15625 +362685.6875 +354912.8125 +342527.59375 +356789.40625 +356550.65625 +345053.78125 +356713.09375 +354496.40625 +347524.4375 +358688.21875 +343488.09375 +346441.78125 +349495.40625 +342127.84375 +344443.03125 +360170.59375 +356435.5 +368792.96875 +345298.0625 +358410.59375 +339993.0625 +344284.8125 +345053.78125 +345608.96875 +342891.25 +354829.53125 +346164.1875 +350050.625 +362102.71875 +356602.0625 +349634.21875 +355356.96875 +355489.5 +350308.78125 +351855.03125 +341167.3125 +356800.5 +359548.78125 +349911.8125 +339993.0625 +361766.8125 +347736.34375 +361103.34375 +346069.78125 +373317.875 +366960.78125 +358077.46875 +351308.15625 +346550.0625 +360928.78125 +356745.0 +362241.53125 +341452.65625 +367293.90625 +350637.71875 +358294.0 +363990.0 +356189.78125 +357300.1875 +377192.8125 +358096.90625 +341261.71875 +359462.71875 +361197.75 +350050.625 +358546.625 +364073.71875 +368587.09375 +344776.15625 +346247.46875 +358410.59375 +371301.15625 +341333.875 +342797.78125 +343940.59375 +353381.875 +358965.8125 +342991.1875 +345900.46875 +342608.09375 +376518.65625 +355245.9375 +369891.84375 +347477.25 +345051.0 +360084.125 +358480.0 +357000.375 +350187.28125 +350187.28125 +359736.8125 +364417.9375 +343913.4375 +345298.0625 +360312.1875 +357969.21875 +358688.21875 +344946.4375 +358269.03125 +348107.40625 +358815.90625 +366247.34375 +359920.75 +359920.75 +353667.21875 +356328.59375 +355608.25 +375055.28125 +364068.15625 +361256.03125 +358843.65625 +339787.625 +355073.8125 +354793.4375 +358704.875 +366380.59375 +351613.53125 +363363.03125 diff --git a/train.py b/train.py index fc8d14c..98bc1f9 100644 --- a/train.py +++ b/train.py @@ -24,14 +24,18 @@ def read_data_file(filepath): def dataframe_to_arrays(dataframe): dataframe1 = dataframe.copy(deep=True) - dataframe1["type"] = dataframe1["type"].astype('category').cat.codes + #dataframe1["type"] = dataframe1["type"].astype('category').cat.codes + + dataframe1 = pd.get_dummies(dataframe1, columns =['type']) + print(dataframe1.columns) + input_cols = dataframe1.columns.values[1:] + output_cols = dataframe1.columns.values[:1] inputs_array = dataframe1[input_cols].to_numpy() targets_array = dataframe1[output_cols].to_numpy() return inputs_array, targets_array data = read_data_file(TRAIN_FILE_PATH) -input_cols = data.columns.values[1:] -output_cols = data.columns.values[:1] + @@ -40,11 +44,10 @@ inputs_array_training, targets_array_training = dataframe_to_arrays(data) inputs_training = torch.from_numpy(inputs_array_training).type(torch.float32) targets_training = torch.from_numpy(targets_array_training).type(torch.float32) - -weights = torch.tensor([1.0, 1.0,300000.0], requires_grad=True) -learning_rate = torch.tensor(0.00000000001) +weights = torch.tensor([1.0, 300000.0,1.0, 1.0, 1.0, 1.0,1.0,1.0,1.0], requires_grad=True) +learning_rate = torch.tensor(0.0000000000005) print("training started") -for i in range(20000): +for i in range(300): y_predicted = inputs_training @ weights cost = torch.sum((y_predicted - targets_training) ** 2) cost.backward()