From e5754242dbb916e218d019ff0a43dd71f2b126d2 Mon Sep 17 00:00:00 2001 From: Rohit Date: Sat, 23 Nov 2024 00:39:12 -0600 Subject: [PATCH] final --- Data/Data_generator.py | 40 +++ Data/small_test.csv | 51 ++++ Data/test_data.csv | 501 ++++++++++++++++++++++++++++++++ Models/LinearRegressionModel.py | 47 +++ Models/bootstrapping.py | 44 +++ Models/kfold.py | 38 +++ README.md | 164 +++++++++-- Test/test.py | 105 +++++++ requirements.txt | 4 + run_model.py | 81 ++++++ 10 files changed, 1057 insertions(+), 18 deletions(-) create mode 100644 Data/Data_generator.py create mode 100644 Data/small_test.csv create mode 100644 Data/test_data.csv create mode 100644 Models/LinearRegressionModel.py create mode 100644 Models/bootstrapping.py create mode 100644 Models/kfold.py create mode 100644 Test/test.py create mode 100644 requirements.txt create mode 100644 run_model.py diff --git a/Data/Data_generator.py b/Data/Data_generator.py new file mode 100644 index 0000000..98c99fc --- /dev/null +++ b/Data/Data_generator.py @@ -0,0 +1,40 @@ +import numpy as np +import pandas as pd + +class SyntheticDataGenerator: + def __init__(self, rows, cols, noise_level=0.4, random_seed=20): + self.rows = rows + self.cols = cols + self.noise_level = noise_level + self.random_seed = random_seed + + def generate_data(self): + np.random.seed(self.random_seed) + X = np.random.randn(self.rows, self.cols) + coefficients = np.random.randn(self.cols) + coefficients[2:5] = 0 # Set some coefficients to 0 for sparsity + noise = np.random.randn(self.rows) * self.noise_level + y = X @ coefficients + noise + + df = pd.DataFrame(X, columns=[f'feature_{i+1}' for i in range(self.cols)]) + df['target'] = y + + return df.drop(columns='target').to_numpy(), df['target'].to_numpy() + + +class CustomDataGenerator: + def __init__(self, coefficients, num_samples, intercept=0, value_range=(-10, 10), noise_scale=1, random_seed=86413459): + self.coefficients = np.array(coefficients) + self.num_samples = num_samples + self.intercept = intercept + self.value_range = value_range + self.noise_scale = noise_scale + self.random_seed = random_seed + + def generate_linear_data(self): + np.random.seed(self.random_seed) + rng = np.random + X = rng.uniform(low=self.value_range[0], high=self.value_range[1], size=(self.num_samples, len(self.coefficients))) + y = X @ self.coefficients + self.intercept + noise = rng.normal(loc=0.0, scale=self.noise_scale, size=y.shape) + return X, y + noise diff --git a/Data/small_test.csv b/Data/small_test.csv new file mode 100644 index 0000000..12a8455 --- /dev/null +++ b/Data/small_test.csv @@ -0,0 +1,51 @@ +x_0,x_1,x_2,y +-2.421348566501347,6.290215260063935,2.516304163087373,10.240119830146476 +8.13465811997068,-6.975968662410185,-3.2810945459842866,-6.8962940548446845 +-0.4531238994261493,0.05889462611191654,-3.592293253611172,14.10428803155231 +3.979832584128687,-8.129001764124755,9.202914789330517,-43.788867687445624 +-4.354231825431758,2.4724749171156333,8.45972163584499,-12.067617018047834 +8.726620980175113,-9.607722575405269,-5.092837184080405,-8.265643240683891 +-0.29136484802189955,8.224663789274086,-3.8193339707565555,32.98185595386334 +1.4118708853910462,6.003042800612462,3.9968255952773095,0.7267789346532836 +0.21525181834957507,-3.321041549359367,-5.352746248495515,11.93444109619503 +4.80226153299567,9.818246112545182,4.936296097738831,3.5995719453822046 +9.71733974143089,0.1440918710436101,8.74993701189404,-34.917122745540794 +4.098687611436789,-9.75205878861841,7.980744101999381,-43.32805584620358 +-2.398060521804659,2.8278192128541733,-1.626174948927721,16.91539285950553 +5.398272903061114,7.583046908728093,2.758295974535457,4.437457748228852 +3.371527871466675,-5.430064318728407,2.1915998058530857,-16.03565826569788 +2.0863644528269365,0.10824916542728857,8.144465640869694,-25.094326089867696 +2.8255940202840684,-2.286321234798363,4.771241059098381,-18.000440202657604 +-8.150227640024978,-4.259315052105519,1.8923353680502952,-1.3930242667026356 +-6.067265316809651,3.6776254617776942,8.4817269440159,-10.278522746897893 +8.64017362219969,9.717801217085075,4.980672567111553,-0.9266647796977245 +-4.636910653452324,0.9373715699813872,4.978170771263397,-3.8217233698137143 +-7.940395120999431,2.953441321061362,-0.9370552302607145,21.291726783530805 +7.692709298116139,-5.485844206553388,-6.019643260327971,2.1873435652525455 +-6.485086441297707,7.06589989184231,-8.842925435171665,50.35981404591074 +5.036321300769028,2.0420739888497152,-4.368234397412891,15.435100617505809 +-2.203566631709222,-6.141030616852454,-1.822186931753599,-0.5890454529472771 +3.2620868350599768,7.851306022896178,-4.479265977335616,27.896949611024628 +6.402611257683294,-4.018677430646336,0.48600102750762986,-12.289355696825485 +5.378501224056757,4.355667003325474,-7.565417868242747,31.017195148404717 +2.0486633392332614,8.253411759540757,-3.966950647644751,29.555547834722987 +2.626017326894857,3.314924154867276,9.810418858378235,-22.85112181951592 +-0.04750452520510429,5.935777040113393,-0.3470621837504506,16.516617979443822 +-6.775500897482147,-0.8747563332852692,-2.758815934335188,16.55155644731519 +-5.130765599150095,8.959898235120185,1.1701541118251235,22.753375944830324 +9.607901921761815,-9.108821424255002,5.524296399378377,-41.93781490943017 +-2.9201254899877434,5.134928295361929,-9.896226148902585,43.58829658171542 +6.956501039100711,0.8359369151964895,-6.1636372998431295,16.225403196517274 +7.725179239543149,-4.913104095867496,-1.110476120153832,-9.936035489824537 +-6.142683379729563,1.4244393989902058,1.8529074318076262,5.554396424524908 +-2.0474061706133977,-1.2170618863263076,8.899325908803291,-23.596187786238964 +9.359523403637155,3.4124788823300065,-1.4222946765509725,2.4507844709064064 +-8.642800876507275,-9.508822574677566,2.9901775243378577,-16.775543378589024 +-2.470992582133973,5.1672327675732195,-8.753045094764744,40.855147394263106 +-7.756097982925145,5.227601844332813,-3.179199348468109,30.739018818654756 +5.393783291304004,-1.5186710515725927,-7.469139234639499,17.503383657767756 +-7.644671911438172,1.8115363641056241,-6.167155079348694,33.57677356652164 +6.557442460132911,-4.44188855380612,-6.368621306151785,7.435670420087931 +0.21009363927752744,-2.719754693698011,1.0885820356480096,-6.289562485886653 +-8.571672299069252,8.890348599509473,5.468260371802332,15.412904086362603 +7.872454219630789,-3.9905860234116357,0.9068940749874717,-16.017543419998542 diff --git a/Data/test_data.csv b/Data/test_data.csv new file mode 100644 index 0000000..708fc29 --- /dev/null +++ b/Data/test_data.csv @@ -0,0 +1,501 @@ +x_0,x_1,x_2,y +18.235186324814347,-44.617898119777735,-27.96401272273886,-42876.3833798082 +-31.56281893013303,-32.40940989149696,31.209450665577364,-8394.7616693194 +42.334499802705636,-22.342560220289375,31.975456159300208,58560.2747502364 +38.98926931111859,1.2970455229531885,-25.503539893120355,27841.880547467183 +32.42415960974113,-28.623703662490453,24.146705223470967,19667.420597608183 +12.99402045896808,42.740725852516704,-26.809181139358117,38592.88159466427 +29.91251286200829,1.81650368527142,-26.84443751829325,8569.814708596028 +-33.409600675925546,-0.221103150220614,8.272464061531991,-14749.281093663794 +-31.566201257152027,-48.51050832397677,-2.886677110953917,-62568.15151402344 +22.824332818326166,41.86004917735433,12.553400573546403,50765.859902888806 +41.71225725476023,36.46902510937748,-28.185712675001206,60850.67472565205 +36.61274307382429,23.07519363712538,-22.213470970107217,32244.779891926675 +29.704355318346455,36.52217128437365,-20.056210436254275,41205.057381621795 +2.7042084030296953,-42.85131933766031,8.323841015105804,-33229.771135883144 +-26.209360037038245,26.496364610364843,-32.63683638245974,-9646.053580459386 +-18.72577437492331,-48.5525523209933,-46.744807839341064,-96666.98333054289 +-0.3298158204659507,-3.1687465573423834,-37.230967710752225,-21535.57901662919 +-24.243749509047618,-49.68188907066884,-11.893225218418092,-59496.358193395274 +7.587308403696658,-7.270122871704987,33.51023473085695,22486.290330733515 +11.64912514101898,-23.39160879887252,31.10221113180831,14362.854473383451 +-0.05132496969827427,25.88103210038678,6.608908632671884,10895.972602072654 +-6.255963844274093,-10.384555558257658,-47.77647120801212,-47780.50953535017 +-3.0649211832037393,12.355840215810565,44.61134210107419,51682.68477266973 +-6.4673919834513205,-1.4358596920002853,1.9115143979495541,35.515063176938874 +-9.140902000788408,7.879571885124726,-42.964932672427466,-33717.45053625949 +-1.1616168796776072,11.014482830173232,24.387910731965647,10016.687673064704 +-7.016967956575337,-19.71978672776157,-49.41099666825303,-55521.27149061699 +25.64789701459572,-42.24240298014236,-1.0011962341086256,-21873.392639981263 +-19.563890321754375,34.082216217636095,45.04758622500841,72374.8999397559 +-18.112542126561692,39.77682889262575,-16.247094938965777,32874.87425054654 +31.211211051357644,29.884359805911398,15.528517701107901,36599.42049126038 +-27.129654522439463,-36.232553525773156,-7.562886107298872,-27514.175233400794 +-34.84612469806932,37.32729487880516,-32.087324251219854,-677.6750018827706 +-46.97053383876728,5.924967713366547,-7.11937466479805,-44903.298108336116 +35.859742155935415,-33.91686244710056,-13.96463006081926,10122.090552898962 +14.050993683258039,43.10793496117601,-23.81989779095669,42502.88032446835 +18.8098413581847,-35.094734764463745,24.01549734210763,-4874.491590959721 +-20.68187169789404,-25.62548954295927,-27.017856215508296,-17093.47400578116 +-12.934883483243487,-17.144491251885253,11.264167181815099,-1070.038048772826 +4.4715400191636,24.96431048909087,-20.504571457395983,6691.90687603518 +46.055372837503036,4.348275860010576,17.94241484095175,59037.44321038293 +18.82592484926856,-34.7702207250665,-35.49755484486634,-31463.87301785118 +-3.7956177950220105,2.1933533414376316,-22.79552468388115,-4270.066893758166 +-31.987905305594357,0.3921087192230499,15.963834840869506,-10450.877617446451 +-27.12455465777327,-28.158176913626598,45.48990589630153,36765.832882086885 +22.489293416423916,-46.5663151741352,48.161703419163246,25993.825889367003 +-49.150383370811134,-23.503811834870902,41.73241515346026,-15325.37771163932 +-41.9612283610197,35.4715704220328,-35.532260262863666,-24114.12841774393 +-32.07589222708327,28.467347329922433,39.54240566120944,36087.97778749042 +-3.9265673927702527,-46.15163177977797,-18.469473978746198,-44722.38748172719 +-48.47067503075873,-15.082631486889852,15.931001888696827,-48042.69894194744 +-23.47838678066474,15.201883844094466,42.7480196623524,42119.707393923876 +-3.386124141556579,-29.289043933446703,42.271424463977766,33146.72759040128 +44.585661094259855,-36.50943460810146,39.9638533768082,66562.47566249492 +-20.785083316158925,-37.18245567797541,-38.1923309766751,-48016.48395404056 +25.94500770851804,-41.15574855811598,26.315174360633765,-7840.857921022327 +-26.038144601381163,-8.121621007707947,-35.69822942899318,-25630.06398147025 +15.266979712244066,-4.221407314566616,-10.616984866227464,2240.368376775867 +30.46731375182149,-4.098488958621749,19.156833731541166,21481.388593701515 +28.19890770932393,11.488125824156171,46.139089477043235,70084.02685971594 +5.087804742166091,-28.09874727289906,4.187984293368263,-8428.543918659856 +-25.54430191667918,-41.6672982789459,25.636209174345247,-26841.89856117704 +-23.550245149888582,-18.635956295801137,48.834285811683905,58323.64673218499 +-9.944216840481468,-5.868790417331892,42.05987299377911,42282.95732883536 +29.006637828051385,35.94820876566842,-3.164328606719713,41735.726406957656 +-28.749642627197304,-43.43611834990819,-42.01859809238546,-76273.08984540291 +-36.30104469773114,-23.06510758307305,27.737395033579148,-11448.975647009987 +-27.047399120398918,-7.8206418529762844,-4.186346502576066,-7656.390413098045 +-19.03140078606993,-32.29890973267552,-23.196921262345704,-20544.682124248946 +35.23543812200487,49.40722747136872,-12.932575463581596,92515.18110230373 +-3.8249091236435495,-16.50114463373057,-13.456129500000502,-2011.8896500737799 +18.717349447483656,23.53263140408638,-18.296241068972986,10424.544127908433 +-35.497991409443664,20.75260026204575,-6.0609002634105185,-12772.854713621908 +41.62952755756362,-9.066589087605347,-47.22849930131837,-4791.77126733373 +22.61386398251467,48.578189028048556,-3.3638173131734006,71616.48332709246 +45.26493888205666,-33.74102916283397,-28.714031195231204,27415.30479952225 +-15.84879582209241,-9.405396395485976,39.94581883687817,35263.950157926396 +47.25097699578843,1.021222957520307,19.674427735451683,64296.16724584678 +12.761897459185912,36.053275438247,-39.221847172177526,3291.8587801114354 +6.167482880616659,30.832940683332733,27.422711697467207,30178.17014755371 +26.746195284073217,48.12000347782621,-47.16961841373843,28521.7344342815 +-39.390226250573676,-34.667076994667134,8.08818138248113,-42523.27550139174 +-6.916271718708189,-43.58705900880846,-22.08168768932555,-39484.32949040521 +-10.923974565451877,0.5871219220579871,25.573889211000477,10019.894771596097 +-1.0976297186739425,32.572759033601365,4.0468140433345345,20483.057680197628 +-14.281679827083272,30.597748088255518,-31.362145331760992,3854.0057912213715 +38.92890317862305,17.341370749112485,45.33772520242428,90128.2260929934 +-29.015700419486134,-26.72542959288612,-4.344122225995195,-16952.462413952715 +-35.124418801361834,-46.027338517277,-14.80918888582613,-61130.64925698352 +25.107343696913542,38.8985033882593,-26.666903058307277,36363.57203372083 +44.430369125700764,-42.07617547638046,-42.170850562548914,-14227.804732106872 +20.538058768305767,-43.219715454063255,47.064739394907996,29575.29738643636 +-22.57901897229866,-37.12761853574329,26.845446486476032,-13765.519720887922 +-7.754913847290423,40.00753856410707,-0.7541459397506611,36716.958512650934 +-49.201637194836955,-33.66568768017777,-40.06144834160247,-95047.81600881323 +-31.865050645952675,-22.94318304441224,-42.4621566178392,-50253.076075355304 +37.892540112933936,17.329280584290363,-5.60226685765085,34932.859561068086 +39.87133153005883,11.166774633548526,18.172178142468777,41401.191891835326 +21.2645561692944,-6.0536011589091165,-20.683576014832028,3039.4477162720177 +38.67585788837333,-13.091365267425159,-6.32057848005394,32782.8501962884 +-22.372654848297323,5.364459485146245,3.814296512113069,-3826.8722488830053 +-6.826621455995518,-14.672145330452935,4.174307786905929,-818.4989519279803 +-11.794205814015813,27.909898920588326,-34.658778991069816,-4355.020499704525 +22.046178678920135,-29.133198940959925,43.20248002175388,42859.66076685358 +-11.500828743400504,-17.621985132745987,40.09763288814493,34883.73911537942 +-45.262390701332244,47.76349231993772,42.86869840739013,65931.37330836109 +16.462865024789853,6.96008192631461,2.4352848068717514,3333.356406159817 +-41.65835655219615,-40.92178687378713,19.0645119074367,-55486.967800542014 +45.796767739193946,1.024927371492812,-49.89815510474077,-305.2510781211957 +32.88419279559866,33.05270921698617,-16.348810984546336,40889.208182280454 +17.981863138332134,-35.84163508387611,-33.67620219351196,-30863.218882994537 +21.14325374368309,0.9927236715597476,8.892560301559582,6608.329898122377 +2.3705849187926065,44.04676230463569,28.869217964319628,62960.77932290071 +39.91233742848852,-20.838641928319447,47.96106189973346,95282.4007624243 +31.877776072336673,-40.04337803808623,-41.289306090264674,-38014.233876521204 +-30.8478962171437,-16.362535978134773,-28.056226478401324,-21725.92985688612 +-44.815985467989385,-5.498687047731399,-23.74881399920249,-43817.246812748 +-3.733006467537836,28.348747508507934,-17.822732791852992,11939.253677705623 +-45.96970115360111,33.45379732781285,-0.96814933916195,-20113.897615357524 +-25.585114152780076,42.82573140479662,23.51950525268409,46458.070100149744 +-7.829603574760591,-15.28762653468142,-42.8948211228121,-34935.685875171606 +-21.43476958236059,21.582943107374795,-42.43651252810739,-29836.18788855711 +-12.352205052809195,9.157154298809989,23.995652385225075,8765.488809251834 +24.28225106274645,-20.739212283335917,-17.075760492463623,4190.736446658151 +-34.26515997411143,22.928784116861888,-23.453043668883065,-13697.532592418345 +-1.9576658807706093,39.972584042880335,-49.35710375720331,-16034.3565558013 +35.66934606484041,23.98488388029072,14.51523812328146,37155.716684889085 +-9.292275777352577,12.401842818781827,44.859688673249444,52369.5756883317 +-40.47172067984626,-43.222805502203784,-15.950296463407021,-64055.65690834582 +-39.694344346837106,41.7756634185609,28.737821413895315,29440.372700421492 +-34.1581693307456,-12.637308505742595,-8.460870827509236,-16919.444297798924 +45.442290822903566,-17.078024687720884,-1.9791479049918737,51465.70193000804 +2.8962175573250315,28.180327361549363,36.80446475444018,42477.16201672673 +17.077450564075882,-13.667078168107572,-27.095399694947318,-5030.558719323153 +-10.192445486147307,7.583773111975589,26.69221121585733,11788.615148575493 +45.94970137013482,37.340235915040374,28.777584060295013,99250.48179211962 +40.06597574203058,19.605033452412513,44.54902281416743,91872.61845575031 +1.3548470744070062,-40.89243065945433,22.952189351283725,-21483.784655109415 +44.847787461009226,-46.89597288013382,12.209279512954085,7516.195194408797 +-19.523149291162568,-9.581752903889384,41.80988257860895,39034.086999157335 +-16.56104800057816,12.58129670602035,-7.660125125935579,12.057961970288284 +42.68321294051507,-13.13238403487318,-40.06204248115112,16434.93527185065 +-8.10012719380846,-9.488093764888728,38.537882201828054,32826.425187586115 +-16.858564624225547,-20.59955561211566,-9.296851904480508,-4680.0464754342875 +19.100973835998502,-7.768675098659039,2.2053088762669426,4528.511017227773 +21.02176112624442,-47.32019632181558,-36.6840766478441,-60799.13454239739 +22.51154761353057,40.71754697152594,36.7027161533514,74541.84380699962 +20.72027496078097,48.185465965433,35.2905505436942,94164.27507085906 +19.375266392350056,14.01216961816405,35.31316264516609,32354.394804436644 +38.01561650068955,-22.59620175554741,35.4019135250721,53424.90672140293 +8.820680266221947,-49.98136202227313,-30.290058248256834,-65355.329078455936 +27.95981633842086,-15.780950286323115,34.30609600748807,35696.669517113995 +10.267252289703531,48.665493694537986,26.385423248842578,76705.06505119684 +-40.69555722481809,33.77878905341124,16.391215588076,-3027.5060265037127 +-27.987724516721833,1.6804412838189342,-33.964820995581704,-24590.701282553262 +-12.695392346359736,24.478847903894774,-4.663360317563281,8614.061287284658 +16.14581176783114,39.93451438870558,20.152508892043297,44686.9907638695 +-40.79433001170162,-8.752654047014252,-18.38671662816571,-30998.859020141183 +-2.1548003775561986,39.68478394381787,-15.709968530663732,34760.24569924082 +24.14297840959234,-3.1723336976151484,33.77186138144474,31386.833414480137 +-26.42996144682126,2.345561584362965,13.181174186961965,-5415.308029202372 +-12.330027391635168,6.350265067597305,-20.32613633460332,-3130.3474637758777 +48.74257701149561,18.726069515168675,12.946005301312692,70807.7214387325 +43.45475244174081,-5.932700001299884,48.12693513952257,109212.43750412115 +-40.99860368510022,48.821152742405914,21.969208659648455,42630.51964841168 +7.993988098325611,-14.35134620480949,-29.691331221841644,-10775.06799250329 +48.255787491797655,-26.47783271387788,38.01076839452461,87685.81209647856 +-44.29525705437957,30.126431423974353,36.95844935103953,8130.842251520943 +-25.508757350589427,47.6953176313059,-12.816890569793893,54153.91870320834 +-34.164410928194435,-8.05098433876429,47.23256404630568,42879.74010749867 +-38.65087711184083,19.297228939475264,-36.39079683314529,-39678.35728892836 +18.52971523467589,-34.578006567703824,44.37498227638849,36674.154788810374 +41.37111507157033,48.44134064412808,37.841555405079774,135567.90700704005 +-11.40801100849249,-3.4197328655263926,-18.610992804035476,-2440.31442152708 +-0.7833989887245929,-26.209945258643387,46.005874969920704,48070.86735174635 +-8.214629406400187,-16.397897127681127,43.52751322549354,45429.740423810035 +-15.246910367210143,-7.850144265394798,12.79284060140573,432.23314216704694 +23.055655101001637,-7.4332169697563515,-27.77421242178163,-670.3952705277391 +12.189410517030364,-32.98644018851993,11.888284850825704,-12032.149523986262 +14.256517191554652,13.889502629747852,-14.801743577639915,3001.2866596179383 +-10.36791849036195,-23.498454571491422,28.936751327418964,9571.175708476634 +21.623920104252512,19.14375700387616,47.1314938875828,69918.15910924201 +38.68182309268371,-7.08394625466754,25.79048422543456,43870.4763355053 +14.405028371087313,3.703035012485112,-35.99597507123193,-17192.48763032506 +-0.6351358794144168,-28.30430374686047,30.845816969724982,8604.343545358242 +23.929566308928084,-32.09087044663379,-40.96714801891811,-34104.01679230202 +-39.1413609092674,28.358697932117305,44.151604907222605,37254.24750350748 +-21.027305050461486,-39.075501521025835,20.77200880480975,-22708.409575037145 +2.259669111348317,10.56704673066574,0.18214229649801128,934.9989499542571 +30.97408394574408,8.489697054863942,30.221284782258973,34671.56643430668 +15.775940937925636,18.49531790587575,23.658063198232636,15102.120011048479 +7.818758469758458,-14.023899672761564,-10.373682625028335,-551.987720507222 +-47.76739297350604,-46.282179101653554,-3.51793976582202,-90573.18092545339 +30.197321875103523,20.722641295680276,-11.511049487041802,21820.215042338456 +-2.04703250010676,33.811421490102255,28.769287284362697,37046.85864127979 +11.022218484946523,34.90630750418045,47.920766273112704,87687.28897282027 +12.29663619543324,46.98816487012293,-42.19909432003936,27624.164064616052 +27.58557756473874,-40.38951952838335,-27.830868212069404,-23624.66622713246 +-16.082991051820105,-38.32992113650226,21.59628261720047,-18532.64633580071 +-15.056455410846837,-33.13668768663963,-28.525741048995723,-24918.93172833872 +-47.523270977528384,46.053520467050056,45.118209287484504,60261.927844324164 +-24.555885225758487,19.9273568296089,-45.3568640615881,-40820.729998160634 +-15.042853936947775,17.626621679901888,-27.23233040749794,-5165.763465025857 +-16.0851086051519,-36.886360798714314,-34.868335774272296,-39669.18589632995 +-49.37898228610237,-16.136910030174768,-7.42609814088655,-54085.4031113687 +-7.740024943425872,-21.50834975807394,3.173158334072046,-3524.49953032565 +-47.46218185054266,-9.422556469741682,11.289842062672406,-45653.61901833676 +26.40757265066167,49.27272007553838,-6.062507484613711,78256.39210477965 +44.01886070610846,41.63719944000809,-36.08091560225923,70086.38291757535 +0.08433126549155512,-27.571930071247287,29.307751259037516,6976.1085551429105 +23.51680592926868,47.34565585029734,-44.066577860116595,30952.27707560575 +-6.696525263990949,-13.546820415623673,15.567810455092179,1929.7871769073074 +3.0821138793604375,7.0188154392508695,-35.79575411237531,-18661.907602864223 +44.11300377284276,-17.501826800362043,-10.678489497315269,46712.772263405444 +-27.140306117169068,-19.663864695767863,-12.125520193879169,-10744.84556121311 +-23.939544347068487,-4.650145491910196,33.308963957419344,16682.19672211777 +34.36661332896415,11.231720260636191,5.270948555536259,24986.111354390683 +10.228267552915081,0.42387569339193965,-42.89979424460873,-33029.569732994896 +-39.80040230244225,-2.1332813000312756,-42.61581585743406,-59822.935518292885 +-37.028290236450545,12.577226975407763,44.558394452622466,30349.553293358447 +-46.52370219139053,10.231504394816781,-4.751052431313962,-42900.305220295944 +-46.04915010067899,28.037204504107937,20.468063119133895,-23532.170169569214 +43.43381019132787,16.394045323038398,21.55044353604245,55878.25898732835 +-13.989480327173432,7.909851890411501,12.047313021966833,972.0471118327224 +-38.349446570040314,-30.078387645264193,-26.391394192379803,-41579.4655482106 +10.988024139205987,4.288469847949939,-17.725414151291265,-702.3748897276913 +28.978944344808745,19.181385179264044,-36.06845357316435,-253.92232298411142 +28.98023019274316,-19.044677696411405,-3.3879813272815418,12335.330151121758 +-31.82512760123507,-9.671974455567112,-27.038464159214204,-20790.998054932974 +23.336903284954147,8.824644880033528,38.144726174314215,40551.5643243431 +-34.19398072953044,7.469148283313631,-2.7924774885151438,-16025.119046904227 +-2.383963162051428,25.544586908084522,-8.532071755890925,10189.069262289975 +19.527122193905456,-22.128850104863098,-37.2924046993035,-20745.963751145595 +29.285787715517785,2.585641693491336,-25.224380049888808,9036.594578472932 +-4.8205790073563515,13.264649244106575,-25.306464964380538,-4421.019408650978 +-31.937430279749,49.05707051900403,-31.55642557746684,40341.06025694596 +-16.573488514000434,-10.165364939478938,36.11596210247603,25792.927148940937 +-22.17662030483112,-27.83817861040805,-37.33170872950598,-34081.91890612791 +26.059468684948015,6.51829513323412,-40.572121173973926,-17280.534932808932 +-4.505153404481554,48.84450478413549,42.30719336688262,108510.07919363798 +6.2383859232236105,-26.481657978291263,8.897910698701528,-6323.622852756536 +1.27042973938164,46.99801133441254,-48.4959540153612,8578.082070619705 +-18.865350373689836,-9.685192576405255,23.03094548780784,5257.91217109568 +24.919255140297913,23.419557733559625,6.888681810226405,17870.413817809545 +5.16822845204965,-20.974635045217127,36.88648389303515,25996.707412126456 +-7.312354371092466,-14.246309091605191,29.512531508544726,14592.121393531534 +22.474258794629698,-18.14484655821581,-47.63120135620198,-41937.485051142015 +-49.161689281590384,35.08259091847421,-34.89534202890692,-44364.16584138215 +10.24455888827217,9.073165193476896,-27.46463762712693,-6592.847061783232 +-5.441500809006805,-8.097696024120104,0.2707936664096522,-18.932319197292053 +35.70221404469523,41.59716235725127,-41.34299529250869,37492.464072977455 +-7.091730117443628,-20.546306820629955,28.78490726932408,11317.097892731246 +-15.415210263144207,-1.489440195488323,20.6576725169341,4585.328886872154 +13.521927126547572,24.34359397139042,-6.9079832452145435,10704.699262264976 +4.13231703596999,-22.785593000047967,27.709508390129255,8672.324302041437 +36.629004883309946,-19.787050887551906,-0.22425197880499015,25877.553752899614 +-39.53945504004119,-38.82732602009619,-35.53712561710223,-69367.56640320276 +12.990535550581617,28.626404028025476,-37.08095263963946,-5582.585824314961 +49.74358992292366,-14.61335324141777,39.334464427665836,102979.81966031315 +49.960862393585614,34.10594346903096,-11.964645241931093,92607.00830742391 +-47.58365628451363,0.7971668567170687,-1.2056673673526808,-46953.6419440804 +-49.64816588894446,36.86523949270766,-35.381592848484246,-42951.589049373455 +12.700537640057629,-23.74851175517071,-8.570741974019747,-3545.283140756345 +-3.011285728156965,8.766368020234971,1.9519352012368762,590.8562249925072 +-13.556072882569515,-45.95376794229688,-37.339540831436736,-64525.08550168844 +12.399097532332037,10.601776992997202,16.82722167033863,5512.199409767818 +-41.9622973221789,-25.020331104148674,-26.512963625593787,-44630.140824079535 +31.463114844669484,25.980154799931398,25.164151390816404,39045.660944322146 +47.190283767825136,41.5851293738422,14.407491865029009,102298.64249447628 +0.8843945659853469,31.765403829417636,4.966259503065318,19117.67438262032 +26.761874570947608,-31.98290238543382,1.3005646116046599,-1526.588081505929 +-1.6394395951786378,-1.5349367238857603,1.9503300002780888,46.36758353432259 +11.399031897192756,10.54181277477203,45.25856357237025,54430.22041670399 +-28.045161947523887,-35.60825188159226,22.942023422431657,-19737.836824599577 +-25.65199010709526,-21.94971111848063,-32.056588851307296,-23531.368056525538 +-2.247219011546431,-9.050848990376458,47.51672079765892,60240.34540299813 +17.51841931516789,8.487261876986684,7.734280655368719,4487.0691545397785 +-21.49965947653939,38.71847192223194,-38.36441989564142,6166.800439170835 +23.55548244432073,-37.59869963819569,-0.1609680326614793,-14088.477424946088 +-28.360225619448475,5.382278682394482,-30.373999532802888,-19942.799065241514 +0.28689327221288474,-46.8890943656616,-25.323129544972435,-50990.882753356695 +23.539490876056423,1.9689621141791513,-0.4864725121698332,8161.210271563054 +13.648859349060881,2.5254821794041815,-23.693303175266202,-3071.973890657096 +38.99712799867525,-18.68382688218373,-48.17691763235084,-16874.992810912467 +-31.049748124216116,-9.092879435061885,-49.023935989398446,-63710.86425669567 +4.570431068605751,45.327615102270016,5.970450498052838,52954.512088013 +-29.29328116260902,-43.58240667960737,4.057075062714166,-45463.18782216053 +18.544865387843068,14.155920284010747,6.748438213383279,6459.341397820093 +-13.209832498156027,-11.163959407828239,36.239645214015084,26781.815020978716 +-45.16608392831666,-20.117350023885038,-21.275463425751873,-46082.54426263953 +48.137964980061135,0.17722646083042637,-31.87841067192494,49562.324728830776 +34.7957393667657,-12.625349618613269,-11.4958791333035,23800.121046001223 +-16.2843390563971,-34.97444422885152,-5.337296503763522,-18953.43181643565 +4.921181587126422,-4.71633540921077,-11.86870521416996,-226.75425478104393 +-27.03056725805628,35.87027759875595,36.30318271083679,47055.14672227255 +6.271803454943181,21.016569341621516,41.09798737683431,45868.94764335738 +-33.9541694247523,-37.26479014925776,-30.165840819769464,-48600.79140175881 +9.137072530548096,-42.665721250242605,23.382871591080068,-24673.901194066028 +-45.0097212799159,-47.43475186394755,46.62956971131573,-28813.958920038505 +-14.672575170542078,5.9386954641738265,-1.7080983025629992,-673.2347201519166 +14.72040670411664,44.21715784313566,5.710899720412188,51399.778341943864 +-17.734220948054613,-45.951556793944114,14.48607113030066,-41763.52475885745 +-7.948137677963318,45.53701155931659,8.520378962793728,53822.213206928354 +13.40375526595301,14.138749772173643,4.2994114985158705,3802.611696470638 +-11.199684723107307,-3.8985332707610842,18.286893306819707,3759.614999099769 +-26.115869558609084,-31.745964943023264,39.92605125405375,16820.222197360446 +18.281176305129254,37.1299481153065,-13.268287359916098,33084.641363022674 +7.586698172311824,10.430259572026767,39.46191874099154,36586.153219635205 +37.74322712110948,-23.973005355903677,46.85623517038664,83912.44873408707 +-12.776892254077843,10.966951468420238,49.32316096166146,67691.74856033744 +-9.282129142338302,14.187630558899,48.830500543367116,67161.84274872205 +12.929266067123068,15.761890712681126,28.816070458856046,18637.357062105337 +28.791029095919896,44.80155242598125,14.891307408827503,67556.74219017602 +-24.89364967691835,-43.88198499290681,-42.02818781155662,-73919.15715704704 +46.230101778488894,32.33068275251362,9.33765643242931,76358.58582641289 +39.99714862983479,37.0132480865728,-14.042376557844705,65348.149072998 +30.94519705004617,-30.094675076336408,48.383807533942324,70349.4157877805 +-18.38807804052521,-22.040936440705572,-31.768397006552895,-18834.441530426047 +5.534463990464933,40.13382254329616,5.4274113677619695,37410.10498788058 +-46.10159495561202,-44.66603082957605,1.8277668674085534,-80986.48481860886 +38.99439179946834,8.334783274031121,24.64268778696439,43881.021467053266 +33.67354421971538,-36.8468190098692,-7.104615866530207,1552.8814774909963 +-49.61853478767744,-8.116532830136647,35.84560783662785,-26823.32418974206 +28.74681046119889,-16.550077731947344,21.288303654087116,19039.51444521377 +21.253912383574082,-0.8572608689624728,-39.61296092840049,-20160.57731534164 +42.617489790095405,7.258040302119806,-32.15902615834079,30953.329203355166 +17.3914908676416,27.104791189592316,-38.85500091152283,-9102.449000205643 +-7.501037241401953,44.9653829822483,8.738470608334625,51967.29520265319 +28.48268586630953,-34.8549436811436,-23.29109015605547,-8154.404312100311 +46.31306961251427,-41.921332711935165,39.410267714267974,59732.685254994845 +-43.64406951761595,9.442333471041376,-48.620100302961,-85367.63453606034 +40.233267732442435,3.4706479744821217,3.7337899247914863,37449.42660965095 +-11.149457718805401,19.727916957140078,16.71399236666147,7821.166769355202 +10.16791139218094,-3.848175887576566,-31.049331353093923,-11171.693726397276 +7.951175977077051,43.90468814436838,-20.09276505247646,45645.91171629325 +-3.9523622805224035,-44.24348924277456,-41.4697825865963,-67729.31315734901 +-30.05554394220623,13.01639899054523,-22.75496858479147,-13497.259828871562 +44.98162693179154,-8.379849703425313,12.421997770424975,52823.53369379718 +6.550601718220273,-0.29838987474443135,-10.031459452923542,76.98496465489444 +-5.385825839002378,49.601678345442224,-40.79239973070143,39456.47249311642 +46.61462354594641,-24.657161449089127,29.80482894748845,67305.82542513053 +-26.90652564746532,-10.856132524729956,21.252476213053228,-1663.737317535065 +42.44958761163935,-6.369589564394074,10.964510876810252,44586.383098133454 +-15.254494521318673,-29.05513192580638,44.034582384573596,37715.852146459714 +43.90485422820174,47.60349368692701,47.82219128365689,170120.52542304754 +40.29285082745886,6.0702050746527565,-19.080793321731417,35384.908723470515 +-10.842158891836728,-20.737119560608498,-18.237309580216476,-5368.397163938076 +26.635454119020107,43.977922369533985,6.996832730476433,60076.60670041804 +21.325301456069777,-22.591978027244775,39.5021850968097,37414.61079898334 +3.0589171275551386,16.225051336877595,36.40173609693331,30966.292334682777 +-18.376595822971844,-31.189513846023676,5.7143309573246315,-14052.415245529706 +31.754208072260948,35.831227424840925,-44.984068853854374,6412.401353573776 +29.26098027528583,-22.474284217355013,-39.388310660994584,-14893.773951494108 +-20.315980733800522,-37.827745163271906,-12.659035315328481,-26102.622385243718 +-1.5144795588905913,42.28768492753827,37.489451885227645,73598.22791637947 +25.224334786638014,-40.21041789090649,-4.972915085851881,-17663.436603338556 +-16.928726683594864,47.79063119524872,41.47762238022571,100576.32819613349 +41.386887923006086,33.83845059764313,24.929539959400405,72810.11500851344 +21.07604664607323,2.6938341241271924,8.227828026087202,6478.58875175177 +-1.9739360624932978,0.5936163966326236,-33.89539509430599,-15926.236980427551 +-25.677088418527994,-26.58288676443059,-15.906878259050018,-14863.360881697525 +-3.331935571588396,-5.669629726383196,41.64741673297358,41289.794143682586 +-33.59530447843685,-6.722154166956839,-24.9617937714409,-21347.62966817869 +46.933642750956835,0.5868856163969371,9.757298802581504,58956.76294356554 +46.102698791009985,18.82174795668129,1.2134689659569986,59653.32718816622 +-13.502707691117067,27.444149587031607,-9.100947350935328,11782.394390931555 +25.69589252380239,-29.94692455102006,-47.62953265817473,-47382.839676502044 +-18.51198681610754,21.877761208211478,49.3411364423264,71797.15009086885 +-29.545497822890066,31.339343556977127,10.238867562932462,8907.593436605666 +-2.7575504162180353,41.55356404216154,4.946774003470278,41117.95588105947 +5.361107842271151,-46.204606741444096,12.356070435249855,-41284.85562250828 +27.630010862652977,8.342872919630862,30.646922755202688,30418.60077133152 +8.868279067884588,20.122064852218845,-21.8148524167459,2103.651602988209 +-34.79783989268096,6.515607010343826,23.27947045950236,-9212.712337117506 +4.816288157588799,-32.240087918543026,30.6796579078479,3756.302875172424 +-32.397061763471726,-8.493075791590831,36.10677411913402,13524.876987317408 +-29.623231394969096,-19.662501338254135,45.62817115780157,40757.47531715974 +-0.3070428770673983,-23.68594347644607,-49.45178549352737,-57930.28804375615 +0.7201406152734902,36.781029158882816,-24.432474138131223,23416.939416081743 +10.597771356799257,-45.24520851729509,-49.688039556302,-92986.47800097904 +5.484059057752355,-38.94177265504793,47.7321754022971,36386.194434290985 +14.470792262896047,-0.7670202342809573,-6.157324047958268,2136.3186196017814 +-40.03960302707983,22.055884062904894,46.65202592505351,36787.20362815205 +5.72186021506782,6.675584352162178,-29.994462483531425,-10277.620728764592 +-29.837339540926965,-48.024061777574424,20.87825448313452,-53095.43310483315 +28.33187688219119,10.537400834614296,-41.15994267182715,-15069.0723570239 +-40.75505125537461,-16.23682819131985,17.197402698217722,-26687.998697973817 +31.109446462907155,14.81300775647072,-41.43432054935901,-10174.885434681888 +-8.408085849567026,-38.67708730534846,-11.518403763545182,-24769.192194136314 +39.84057961796569,32.83337209619612,13.197626241850225,58827.23147888011 +-28.918080700803163,-39.798275776445024,34.89203886560126,-11370.51156082318 +0.25091100121046317,-41.76325248825356,37.81937868377023,168.85052514573158 +4.359616717877978,43.622089378552886,-46.272814968914844,4213.665386880308 +-26.609232949390904,-16.76822358798471,-38.33563744856242,-32395.9610552381 +-32.02585261149776,5.0346034490381335,-18.508596248959886,-15244.266459293518 +-3.370796917930796,-38.09498945570747,46.73303791134632,34311.91283165734 +1.720972174813562,-17.058674264016748,0.6939964172433921,-1549.8691383596301 +17.74737605033462,-6.066481506383736,3.663396815250919,3787.993037892907 +0.811903339614406,16.091555295970362,-21.839706842713525,-887.7389905135444 +26.741281417343654,-6.24157686041642,35.32532951709803,37388.44977999636 +-13.953333724084427,-30.085022309168274,-22.633672717948894,-15783.724601518335 +-41.63928141152572,15.167451598128245,-25.994160962484337,-35093.904138736405 +-10.043825031694809,-20.56938494625723,-24.086836750897632,-8411.535741134374 +42.10811464124935,47.745777826453164,25.946390578024715,114443.69933836868 +41.723582328285794,-27.526082673650563,-49.10482083241738,-18510.81188096224 +-16.734503658498177,-31.482193067950735,-34.343374311229844,-30662.41701971912 +48.66490439257498,-31.694188245533304,-13.94950155605299,51060.401634378606 +-46.525140683377884,20.026704011203066,-1.220370226453693,-38573.44029469392 +-37.38564608973112,-23.11571464994817,-44.5142159187207,-64438.88773559881 +47.670758498762424,-19.376156832690917,-43.70854630835683,22505.08345446058 +37.140221236131396,4.672649420555109,7.0306433950950815,30110.544261569223 +-11.650269731868601,16.01742281106918,-19.646492935163195,-145.59580915667775 +9.22211332344528,-25.168163964626366,-7.491947060377358,-5400.123071159277 +-26.107340678688416,42.146638187380894,-1.300577184098628,35899.603012543485 +9.86007989369907,10.296631526727573,38.15153035959249,33668.96770938562 +0.19914977013570923,45.557982983400855,30.304967462141352,70034.28597163034 +38.94823341685212,8.625903997378225,-20.140906316380804,31725.63632301103 +-32.92989022996835,17.64655974394981,-45.313401949667586,-51153.91067827399 +8.177156484465819,-6.961467103638041,-30.502973016991643,-10878.504273202574 +37.449082187549756,-22.395838158589555,-38.811366585130536,1702.710749919429 +-22.635421886230322,-4.827032595152636,6.495189209750607,-3931.7163803186013 +44.987756261227275,-14.25484675884282,32.123818557301064,70314.92676835341 +28.285281174843103,-18.492056338528272,15.740812611495436,14226.014097233476 +17.500312991892454,-30.222256305937524,43.33686746633757,38817.34855551048 +-43.63282860827829,-43.81932347924331,5.358716003061725,-71786.86628621905 +-18.673599398343498,5.283510495292598,-20.34467743386621,-4935.890646208118 +38.66665173905835,-4.549980122522346,-38.71619681802056,8907.66170388603 +-22.691122983142353,-33.94203779760818,48.88481266852689,45219.47933979789 +26.479787747658,-26.12447913421594,-29.348651081752653,-5465.991119336291 +20.97474363910148,28.360114095693245,-0.16784158119653725,19669.299538872296 +42.261523820383104,-6.693364693896553,9.667048931229216,43739.628123754235 +-43.77982524773788,4.006883887878498,-27.107455071932986,-43734.20299337927 +-37.81997711031037,-13.792269520789468,9.633503406339706,-22684.69536895482 +34.579041840650504,-16.686902526462244,1.5639636643709043,22745.03625739295 +16.783807070046596,-48.923168166886,6.499210384476106,-47827.69953913766 +10.329556104944526,-37.89515505244191,-5.421947526981596,-21947.69067126235 +-5.930111772645697,24.567118232812845,-18.488532184895355,7107.382224900177 +-13.64886577153106,-43.957901159001565,-25.30741453773645,-43379.49065937676 +15.421794822838987,-18.465143193765833,9.398376912663597,1106.5597173745678 +-13.837734448541328,8.95369166683453,15.14204831178063,2264.1309470530186 +-9.48514400520627,38.547256622007474,-49.405812236154325,-19977.38437956278 +-37.00688663387152,5.467666857967835,-34.143458680315966,-37312.90750039284 +-20.22815793348416,-26.081616148992637,31.31616322852687,8599.644452850845 +-24.356782606145565,-4.450491800740131,36.677333512611746,23278.9286403852 +-2.5838304976305015,37.98243876773043,11.338892348298547,32772.84212115378 +30.561686157757308,-11.0035846338987,4.912403420647671,16869.825532395418 +-48.1148316629732,17.864886616509757,-47.88647106575448,-92801.67906410509 +24.726742779055055,49.31328648514368,45.691966623136,130381.19974710023 +12.890282526374241,28.482696269693065,-26.858784484012467,8013.018038204981 +-3.8084638918823077,24.013806859941955,-36.91902237313567,-12356.76309601898 +-21.017705012710085,-32.74222365853466,-24.148763011982055,-22777.97696288657 +-38.82608706110835,-29.449883001435197,12.12249973870808,-33450.42983109045 +45.73385122169734,4.580656814272254,42.53408879687638,97938.54123275289 +-13.43137321324348,21.16808904007935,-16.000299128301087,4162.385592590044 +1.171689162108247,-35.1077964701085,26.750381687373004,-6187.002081981951 +-23.780883874752213,-2.9826378493576167,47.29295194533832,54553.91307407851 +-3.0424877858321264,40.97331512568558,34.4748028491642,63360.862134555486 +0.2236810271088685,-36.561861248088455,-31.487641480976215,-32907.39911067844 +-7.768241418895194,-6.34863565381345,26.85566672191816,11773.841482908048 +24.4617946426928,-41.929101089623856,-13.252307397636354,-23024.05126092029 +-46.07596924936351,-27.241894414552505,45.59781988648513,3280.786796817652 +-23.264472932768975,-39.06505698179619,18.493458472985893,-25627.319504981508 +-40.42888464082344,41.554796069461815,12.669374985280314,14405.970422754359 +19.181489540469954,5.295905902665976,-13.902953796175243,4019.56618796309 +-46.96261228687225,-21.351994104982275,-44.009890926705694,-85235.70758054082 +27.12188310570216,-6.991136816025523,17.497710312584434,15687.899691500235 +33.508153218555655,-20.434536880932043,37.46167061836301,49575.43134357415 +-37.50390090355186,2.6928286199578433,27.739534222719854,-9121.55254391935 +23.984231453575454,16.08141469184139,6.513041248310547,11666.52712152413 +-27.965195675210673,-26.154354685228544,-49.06834255441981,-67105.8790784769 +-5.174334618237719,-23.464715466571352,-25.918473056253255,-11363.927183608334 +13.853014254449326,-34.31419656122178,-26.349501998872636,-21726.072530702688 +24.648478810810705,-10.297079247714446,26.779698744809288,20768.655551587424 +-31.950119982549786,-11.742197764329898,12.175365276172734,-12210.4788704989 +8.202015665905371,-20.398066745234754,49.24143215143098,64398.10618603454 +-11.021184665858197,13.8642354862745,-33.30167068330504,-13463.620259128393 +-32.658480750445705,-48.626013301913595,-26.241933177464183,-71359.13046267057 +-30.036096385456656,29.508795371693687,-32.23395120277785,-8932.524337966304 +-12.92791509146507,42.633254300947,-11.6907545526037,43211.09048017494 +-34.210354079158314,38.798626873960565,-33.72752045982986,1512.3643417940407 +44.377600403344594,44.77705225696671,-29.14342607293906,90570.44185877446 +-24.30922846021364,18.066355786112165,-15.805373031415392,-2654.208589526073 +-36.50058083757726,-0.5210976592896377,-49.43325635652257,-73195.52770148436 +-25.4834377540205,11.902328834049447,47.55939199868545,55459.16336439611 +-44.07538661811531,-40.90995795091922,-3.6756197794555634,-65996.54277736593 +32.238734991509865,-32.90819093666073,7.510098396725439,5677.744097374628 +-16.48596310798841,-3.129403116848062,-35.28487976082849,-19515.681666196106 +34.725398472192126,-8.023042570938399,-47.316053640253486,-21703.803194512522 +11.235391406680684,-24.248170008759818,26.030733862938916,6559.668846513874 +-48.81850187677605,-8.365795295539446,13.960825286167989,-49059.17590720619 +-17.7607259878125,-12.557984506181208,-10.986506295814058,-2578.995248794668 +18.12392238431615,42.94784221050946,42.904873852766634,93916.43391944718 +-27.980289118169644,4.800082787610737,-5.271906110563407,-8395.200037474622 +-27.39470316481324,17.41152804776651,34.95718630557055,20507.26609533266 +19.26806837907815,-25.80821495894501,36.38662000607984,26104.422699116898 +23.735668076053518,-10.852742057342468,11.194707137169058,9142.069928703966 +22.274314276911255,22.9350342458969,-11.790546248239542,14173.975762884813 +-38.67318697371894,16.168939029268692,4.89653986940991,-21354.91660293351 +7.860960061581368,32.82968767221782,36.61481828272258,49770.48321373602 +10.61831597735342,24.39078615742718,18.404113933893484,14020.054499848186 diff --git a/Models/LinearRegressionModel.py b/Models/LinearRegressionModel.py new file mode 100644 index 0000000..6bc19d3 --- /dev/null +++ b/Models/LinearRegressionModel.py @@ -0,0 +1,47 @@ +import numpy as np + +class LinearRegression: + def __init__(self): + self.weights = None + + def fit(self, X, y): + # Add a bias column to the input data + X = np.c_[np.ones(X.shape[0]), X] + # Closed-form solution for linear regression + XTX = X.T @ X + XTy = X.T @ y + self.weights = np.linalg.solve(XTX, XTy) + + def predict(self, X): + # Add bias term for prediction + X = np.c_[np.ones(X.shape[0]), X] + return X @ self.weights + + +class RegressionMetrics: + @staticmethod + def mean_squared_error(y_true, y_pred): + return np.mean((y_true - y_pred) ** 2) + + @staticmethod + def r_squared(y_true, y_pred): + ss_total = np.sum((y_true - np.mean(y_true)) ** 2) + ss_residual = np.sum((y_true - y_pred) ** 2) + return 1 - (ss_residual / ss_total) + + @staticmethod + def root_mean_squared_error(y_true, y_pred): + return np.sqrt(np.mean((y_true - y_pred) ** 2)) + + + @staticmethod + def aic(y_true, y_pred, n_features): + n = len(y_true) + rss = np.sum((y_true - y_pred) ** 2) + k = n_features + 1 # Adding bias as a parameter + return n * np.log(rss / n) + 2 * k + + @staticmethod + def mean_absolute_error(y_true, y_pred): + return np.mean(np.abs(y_true - y_pred)) + diff --git a/Models/bootstrapping.py b/Models/bootstrapping.py new file mode 100644 index 0000000..9ff1612 --- /dev/null +++ b/Models/bootstrapping.py @@ -0,0 +1,44 @@ +import numpy as np +from Models.LinearRegressionModel import LinearRegression, RegressionMetrics + +class BootstrapModelSelection: + def __init__(self, n_iterations=100, seed=42): + self.n_iterations = n_iterations + self.seed = seed + + def evaluate(self, X, y): + np.random.seed(self.seed) + n_samples = len(y) + mse_scores, r2_scores, aic_scores, mae_scores, rmse_scores = [], [], [], [], [] + + for i in range(self.n_iterations): + bootstrap_indices = np.random.choice(range(n_samples), size=n_samples, replace=True) + oob_indices = np.setdiff1d(range(n_samples), bootstrap_indices) + + if len(oob_indices) == 0: + continue + + X_train, X_oob = X[bootstrap_indices], X[oob_indices] + y_train, y_oob = y[bootstrap_indices], y[oob_indices] + + model = LinearRegression() + model.fit(X_train, y_train) + y_pred = model.predict(X_oob) + + mse_scores.append(RegressionMetrics.mean_squared_error(y_oob, y_pred)) + r2_scores.append(RegressionMetrics.r_squared(y_oob, y_pred)) + aic_scores.append(RegressionMetrics.aic(y_oob, y_pred, X.shape[1])) + mae_scores.append(RegressionMetrics.mean_absolute_error(y_oob, y_pred)) + rmse_scores.append(RegressionMetrics.root_mean_squared_error(y_oob, y_pred)) + + print(f"Iteration {i + 1}/{self.n_iterations} - MSE: {mse_scores[-1]:.4f}, " + f"R-Squared: {r2_scores[-1]:.4f}, AIC: {aic_scores[-1]:.4f}, " + f"MAE: {mae_scores[-1]:.4f}, RMSE: {rmse_scores[-1]:.4f}") + + return { + "mean_mse": np.mean(mse_scores), + "mean_r2": np.mean(r2_scores), + "mean_aic": np.mean(aic_scores), + "mean_mae": np.mean(mae_scores), + "mean_rmse": np.mean(rmse_scores), + } diff --git a/Models/kfold.py b/Models/kfold.py new file mode 100644 index 0000000..921ef16 --- /dev/null +++ b/Models/kfold.py @@ -0,0 +1,38 @@ +import numpy as np +from Models.LinearRegressionModel import LinearRegression, RegressionMetrics + +class KFoldCrossValidation: + def __init__(self, n_splits=5, seed=42): + self.n_splits = n_splits + self.seed = seed + + def evaluate(self, X, y): + np.random.seed(self.seed) + indices = np.random.permutation(len(y)) + fold_size = len(y) // self.n_splits + mse_scores, r2_scores, aic_scores, mae_scores, rmse_scores = [], [], [], [], [] + + for fold in range(self.n_splits): + val_indices = indices[fold * fold_size: (fold + 1) * fold_size] + train_indices = np.setdiff1d(indices, val_indices) + + X_train, X_val = X[train_indices], X[val_indices] + y_train, y_val = y[train_indices], y[val_indices] + + model = LinearRegression() + model.fit(X_train, y_train) + y_pred = model.predict(X_val) + + mse_scores.append(RegressionMetrics.mean_squared_error(y_val, y_pred)) + r2_scores.append(RegressionMetrics.r_squared(y_val, y_pred)) + aic_scores.append(RegressionMetrics.aic(y_val, y_pred, X.shape[1])) + mae_scores.append(RegressionMetrics.mean_absolute_error(y_val, y_pred)) + rmse_scores.append(RegressionMetrics.root_mean_squared_error(y_val, y_pred)) + + return { + "mean_mse": np.mean(mse_scores), + "mean_r2": np.mean(r2_scores), + "mean_aic": np.mean(aic_scores), + "mean_mae": np.mean(mae_scores), + "mean_rmse": np.mean(rmse_scores), + } diff --git a/README.md b/README.md index f746e56..adda2c3 100644 --- a/README.md +++ b/README.md @@ -1,29 +1,157 @@ -# Project 2 +Team: Data Dynamos +Project Members: +Rohit Kumar Mamidi(A20541036) +Ganesh Maddula(A20541032) -Select one of the following two options: +Contributions: +Rohit Kumar Mamidi +Developed and implemented K-Fold Cross-Validation and Bootstrapping model selection methods. +Conducted performance evaluation and designed modular scripts for data generation and training. +Debugged the testing pipelines for error-free execution. -## Boosting Trees +Ganesh Maddula +Designed and implemented Linear Regression and Dataset generation modules. +Created and prepared final evaluation metrics for K-Fold and Bootstrapping methods. +Led the documentation and testing framework integration. +Both members contributed equally to brainstorming and refining the model selection process. -Implement the gradient-boosting tree algorithm (with the usual fit-predict interface) as described in Sections 10.9-10.10 of Elements of Statistical Learning (2nd Edition). Answer the questions below as you did for Project 1. +Requirements: +Python Version: 3.8+ +Required Libraries: +numpy +pandas +pytest -Put your README below. Answer the following questions. -* What does the model you have implemented do and when should it be used? -* How did you test your model to determine if it is working reasonably correctly? -* What parameters have you exposed to users of your implementation in order to tune performance? (Also perhaps provide some basic usage examples.) -* Are there specific inputs that your implementation has trouble with? Given more time, could you work around these or is it fundamental? +Project Overview +This project, Efficient Model Selection Techniques, focuses on implementing and comparing two robust statistical methods for model evaluation: K-Fold Cross-Validation and Bootstrapping. These methods ensure the generalizability and reliability of predictive models, particularly in regression tasks, and allow for meaningful insights into their performance across diverse datasets. -## Model Selection +By addressing practical challenges in model selection, such as overfitting, variance reduction, and computational efficiency, we aim to provide a flexible and user-friendly framework to evaluate and compare models effectively. -Implement generic k-fold cross-validation and bootstrapping model selection methods. +Key Features +Model Selection Methods: -In your README, answer the following questions: +K-Fold Cross-Validation: Splits the dataset into k subsets (folds) and evaluates the model k times, ensuring fair performance assessment. +Bootstrapping: Generates multiple resampled datasets to estimate performance and variability across iterations. -* Do your cross-validation and bootstrapping model selectors agree with a simpler model selector like AIC in simple cases (like linear regression)? -* In what cases might the methods you've written fail or give incorrect or undesirable results? -* What could you implement given more time to mitigate these cases or help users of your methods? -* What parameters have you exposed to your users in order to use your model selectors. +Versatile Data Handling: -See sections 7.10-7.11 of Elements of Statistical Learning and the lecture notes. Pay particular attention to Section 7.10.2. +Supports generated datasets with configurable parameters (size, noise, and seed). +Accepts predefined datasets like those generated from professors’ algorithms. +Allows evaluation on custom CSV datasets (e.g., test_data.csv). -As usual, above-and-beyond efforts will be considered for bonus points. +Performance Metrics: + +Mean Squared Error (MSE): Quantifies prediction error. +Mean Absolute Error (MAE): The average magnitude of errors in predictions. +Root Mean Squared Error (RMSE): The square root of the average squared difference between predictions and actual values. +R2 Score: Evaluates variance explained by the model. +Akaike Information Criterion (AIC): Balances model fit against complexity. + +Extensibility: + +Modular design enables integration with other machine-learning models beyond linear regression. +Parameterized for custom evaluation scenarios. + +Setup Instructions: +Clone the repository and install the necessary libraries: +https://github.com/MamidiRohit/Project2.git +pip install -r requirements.txt + +Running the test file +python test.py +python run_model.py + +Synthetic Data Arguments: +Number of Samples (N): Specifies how many data points (samples) will be generated for testing and training the models. + +Regression Coefficients (m): These are the coefficients used in the linear regression equation to define the strength of the relationship between each feature and the target variable. For instance, a simple linear regression model could have one coefficient per feature, and the target variable 𝑦 + +Intercept (b): The intercept is the baseline value of the target variable when all feature values are zero. This is part of the linear regression equation. + +Noise (noise_level): Adds randomness or variability to the data to simulate real-world imperfections. This helps prevent overfitting to perfectly linear data. + +Feature Range (rnge): Specifies the range within which the feature values should fall. For example, the features might be generated in the range between 0 and 10. + +Random Seed (random_seed): Ensures that the data generation process is reproducible across different runs by fixing the random number generation process. + +Generated Data Arguments: +--rows: +Description: Specifies the number of rows (samples) in the generated dataset. +Example: --rows 2000 means the dataset will contain 2000 samples. + +--cols: +Description: Specifies the number of columns (features) in the generated dataset. +Example: --cols 20 means the dataset will have 20 features for each sample. + +--noise_level: +Description: Controls the noise level added to the data to simulate randomness and real-world imperfections. This is typically added to the target variable to prevent perfect linear relationships. +Example: --noise_level 0.5 means noise will be added with a scale of 0.5. + +--random_seed: +Description: Sets the random seed to ensure reproducibility of the generated data. This allows the dataset to be regenerated with the same random values each time. +Example: --random_seed 35 ensures that the random number generator used to generate data is consistent across runs. + +Questions: +1.Do your cross-validation and bootstrapping model selectors agree with a simpler model selector like AIC in simple cases (like linear regression)? +In simple cases like linear regression, where the model is not overly complex, the results from K-Fold Cross-Validation and Bootstrapping typically align with the model selection suggested by AIC. Both K-Fold and Bootstrapping are designed to evaluate how well a model generalizes to new, unseen data by repeatedly splitting the data into training and test sets. They provide performance metrics like Mean Squared Error (MSE) and R², which are useful for assessing model accuracy. + +AIC, on the other hand, focuses on balancing model fit and complexity. It penalizes models with more parameters to avoid overfitting, preferring simpler models that still fit the data well. In cases like linear regression, where the model complexity is low and the number of parameters is small, K-Fold and Bootstrapping methods will likely produce similar results to AIC, as they all support the selection of models that both generalize well and fit the data adequately. + + +2.In what cases might the methods you've written fail or give incorrect or undesirable results? +The methods used in our project may fail or give undesirable results in several scenarios: + +1.Multicollinearity in the data can lead to instability in linear regression models, inflating coefficients and distorting predictions. +2.Non-linear relationships between features and the target can make linear regression inadequate, causing poor model performance. +3.For small datasets, bootstrapping may fail due to insufficient out-of-bag samples, leading to unreliable estimates. +4.Lack of diversity in bootstrapped samples can result in inaccurate model validation if the data does not represent the overall population. +5.Imbalanced datasets can cause biased performance metrics in K-fold cross-validation, as some classes may dominate certain folds. +6.With limited data, K-fold results can vary significantly, making it difficult to assess the model’s true performance consistently. + + +3.What could you implement given more time to mitigate these cases or help users of your methods? +1.Handling Multicollinearity: Implement feature selection techniques, such as Principal Component Analysis (PCA) or Lasso regularization, to reduce multicollinearity and stabilize coefficient estimates in linear regression models. + +2.Non-Linear Relationships: Introduce more advanced models like decision trees, random forests, or support vector machines (SVMs) to capture non-linear patterns, ensuring better performance on non-linear data. + +3.Bootstrap with Small Datasets: Enhance bootstrapping by using Stratified Bootstrapping or increasing the number of bootstrap iterations to improve the accuracy and reliability of out-of-bag estimates for small datasets. + +4.Data Augmentation: For sparse datasets, implement data augmentation techniques to artificially expand the dataset, making the bootstrapping process more effective by introducing more diversity. + +5.Model Performance Monitoring: Add cross-validation performance tracking to monitor the stability of the evaluation metrics across multiple runs, helping identify variability in small datasets and offering more robust performance estimates. + +6.Outlier Detection and Handling: Implement methods to detect and handle outliers or anomalies in the data that could skew the model's performance and the evaluation metrics. + + +4.What parameters have you exposed to your users in order to use your model selectors? +For Linear Data Generator (ProfessorData class): + +Synthetic Data Arguments +rnge: Range of values for features. +-random_seed: Seed for reproducibility. +-N: No of samples. +-m: Regression coefficients. +-b: Offset. +-scale: Scale of noise. + +Data Generator Arguments: +cols: Number of features in the generated data from data generator. +--noise: Noise level in the generated data. +--seed: Random seed for reproducibility. +--rows: Number of samples in the generated data. + +Results: +Kfold: +Mean Squared Error (MSE): 270171044.1141 +R² (Coefficient of Determination): 0.8401 +Mean AIC: 1948.4523 +Mean Absolute Error (MAE): 13006.6129 +Root Mean Squared Error (RMSE): 16395.1934 + +BootStrapping: +Mean Absolute Error (MAE): 13159.8830 +Mean Squared Error (MSE): 279085329.9941 +Root Mean Squared Error (RMSE): 16693.5849 +R² (Coefficient of Determination): 0.8372 +Akaike Information Criterion (AIC): 3698.0397 diff --git a/Test/test.py b/Test/test.py new file mode 100644 index 0000000..0902983 --- /dev/null +++ b/Test/test.py @@ -0,0 +1,105 @@ +import numpy as np +import pandas as pd +import argparse +import os +import sys + +sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), '..'))) + +from Models.LinearRegressionModel import LinearRegression, RegressionMetrics +from Models.kfold import KFoldCrossValidation +from Models.bootstrapping import BootstrapModelSelection +from Data.Data_generator import SyntheticDataGenerator, CustomDataGenerator + + +def parse_arguments(): + parser = argparse.ArgumentParser(description="Train an Elastic Net Model on Generated Data") + + # CSV input arguments (group them together) + parser.add_argument('--csv_file_path', type=str, help="CSV file path") + parser.add_argument('--target_column', type=str, help="Name of the target column in the CSV file") + + # Model evaluation arguments (group together) + parser.add_argument('-k', type=int, help="Number of k-folds.", default=5) + parser.add_argument('-n_iter', type=int, help="N_Iterations for Bootstrapping.", default=10) + + # Custom data generation arguments (group together) + parser.add_argument('-N', type=int, help="Number of samples.", default=100) + parser.add_argument('-m', nargs='+', type=float, help="Expected regression coefficients", default=[1, -2, 3]) + parser.add_argument('-b', type=float, help="Offset", default=5.0) + parser.add_argument('-scale', type=float, help="Scale of noise", default=0.5) + parser.add_argument('-rnge', nargs=2, type=float, help="Range of Xs", default=[-10, 10]) + parser.add_argument('-random_seed', type=int, help="A seed to control randomness", default=42) + + # Data generation arguments (group together) + parser.add_argument('--rows', type=int, help="Number of Rows/Samples in Generated Data", default=100) + parser.add_argument('--cols', type=int, help="Number of Columns/Features in Generated Data", default=10) + parser.add_argument('--noise_level', type=float, help="Noise Scale in Generated Data", default=0.5) + + # Optional Arguments (group together) + parser.add_argument('--random_seed', type=int, help="Random Seed for Data Generation", default=42) + + return parser.parse_args() + + +if __name__ == "__main__": + args = parse_arguments() + + # Load data based on input arguments + if args.csv_file_path and args.target_column: + df = pd.read_csv(args.csv_file_path) + print("Columns in DataFrame:", df.columns.tolist()) + + if args.target_column in df.columns: + X = df.drop(args.target_column, axis=1).values + y = df[args.target_column].values + else: + raise KeyError(f"Column '{args.target_column}' not found in DataFrame.") + + elif args.rows and args.cols and args.noise_level: + data_gen = SyntheticDataGenerator(rows=args.rows, cols=args.cols, noise_level=args.noise_level, random_seed=args.random_seed) + X, y = data_gen.generate_data() + + else: + cust_data_gen = CustomDataGenerator( + rnge=args.rnge, + scale=args.scale, + m=args.m, + b=args.b, + N=args.N, + random_seed=args.random_seed + ) + X, y = cust_data_gen.linear_data_generator() + + # KFold Cross Validation + cv = KFoldCrossValidation(n_splits=args.k) + results_cv = cv.evaluate(X, y) + + mse_cv = float(results_cv["mean_mse"]) + r2_cv = float(results_cv["mean_r2"]) + aic_cv = float(results_cv["mean_aic"]) + mae_cv = float(results_cv["mean_mae"]) + rmse_cv = float(results_cv["mean_rmse"]) + + print(f"\nAverage k-Fold CV MSE: {mse_cv:.4f}") + print(f"Average k-Fold CV R-Squared: {r2_cv:.4f}") + print(f"Average k-Fold CV AIC Score: {aic_cv:.4f}") + print(f"Average k-Fold CV MAE: {mae_cv:.4f}") + print(f"Average k-Fold CV RMSE: {rmse_cv:.4f}") + + # Bootstrapping Evaluation + print("\nBootstrapping Results:") + bs_model = BootstrapModelSelection(n_iterations=args.n_iter) + results_bs = bs_model.evaluate(X, y) + + mse_bs = float(results_bs["mean_mse"]) + r2_bs = float(results_bs["mean_r2"]) + aic_bs = float(results_bs["mean_aic"]) + mae_bs = float(results_bs["mean_mae"]) + rmse_bs = float(results_bs["mean_rmse"]) + + print(f"\nAverage Bootstrap MSE: {mse_bs:.4f}") + print(f"Average Bootstrap R-Squared: {r2_bs:.4f}") + print(f"Average Bootstrap AIC Score: {aic_bs:.4f}") + print(f"Average Bootstrap MAE: {mae_bs:.4f}") + print(f"Average Bootstrap RMSE: {rmse_bs:.4f}") diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 0000000..92b0000 --- /dev/null +++ b/requirements.txt @@ -0,0 +1,4 @@ +numpy +pandas +pytest +python diff --git a/run_model.py b/run_model.py new file mode 100644 index 0000000..0030e3b --- /dev/null +++ b/run_model.py @@ -0,0 +1,81 @@ +# run_model.py + +from Models.LinearRegressionModel import LinearRegression, RegressionMetrics +from Models.kfold import KFoldCrossValidation +from Models.bootstrapping import BootstrapModelSelection +from Data.Data_generator import SyntheticDataGenerator +import pandas as pd + +def load_data(file_path): + """ + Load data from a CSV file. + Assumes the target column is 'y' and all other columns are features. + """ + # Read the CSV file + df = pd.read_csv(file_path) + + # Debugging: Print column names to verify + print(f"Columns in {file_path}: {df.columns.tolist()}") # Print column names for verification + + # Define the target column + target_column = 'y' # Update target column name based on your CSV + + # Validate if the target column exists + if target_column not in df.columns: + raise ValueError(f"Target column '{target_column}' not found in the CSV file.") + + # Extract features (X) and target (y) + X = df.drop(columns=[target_column]).to_numpy() # Drop 'y' column to get features + y = df[target_column].to_numpy() # Extract 'y' as target variable + + return X, y + + +def run_linear_regression(X, y): + """ Run linear regression model """ + model = LinearRegression() + model.fit(X, y) + y_pred = model.predict(X) + mse = RegressionMetrics.mean_squared_error(y, y_pred) + r2 = RegressionMetrics.r_squared(y, y_pred) + print(f"Linear Regression - MSE: {mse:.4f}, R-Squared: {r2:.4f}") + return mse, r2 + +def run_bootstrapping(X, y): + bootstrap = BootstrapModelSelection(n_iterations=5) + bootstrap_results = bootstrap.evaluate(X, y) + print(f"Bootstrapping - Mean MSE: {bootstrap_results['mean_mse']:.4f}, " + f"Mean R-Squared: {bootstrap_results['mean_r2']:.4f}, " + f"Mean AIC: {bootstrap_results['mean_aic']:.4f}, " + f"Mean MAE: {bootstrap_results['mean_mae']:.4f}, " + f"Mean RMSE: {bootstrap_results['mean_rmse']:.4f}") + return bootstrap_results + + +def run_k_fold(X, y): + kfold = KFoldCrossValidation(n_splits=5) + kfold_results = kfold.evaluate(X, y) + print(f"K-Fold - Mean MSE: {kfold_results['mean_mse']:.4f}, " + f"Mean R-Squared: {kfold_results['mean_r2']:.4f}, " + f"Mean AIC: {kfold_results['mean_aic']:.4f}, " + f"Mean MAE: {kfold_results['mean_mae']:.4f}, " + f"Mean RMSE: {kfold_results['mean_rmse']:.4f}") + return kfold_results + + +if __name__ == "__main__": + # Path to the CSV file + csv_file_path = 'Data/test_data.csv' + + # Load the data + X, y = load_data(csv_file_path) + + # Run and evaluate models + print("Running Linear Regression...") + run_linear_regression(X, y) + + print("\nRunning K-Fold Cross Validation...") + run_k_fold(X, y) + + print("\nRunning Bootstrapping...") + run_bootstrapping(X, y)