diff --git a/Elaborated_Data/normalized_data.csv b/Elaborated_Data/normalized_data.csv index 4875cf6..6158f6a 100644 --- a/Elaborated_Data/normalized_data.csv +++ b/Elaborated_Data/normalized_data.csv @@ -1,91 +1,91 @@ ,Unnamed: 0,Ticker,Valuation,Financial Health,Estimated Growth,Past Performance -0,0,AAPL,99.66725122809231,66.36553167681646,111.32,39.06731462476843 -1,1,ABBV,160.98123119547898,52.44250540564119,54.12,38.816439109405074 -2,2,ABT,0.010900003867217779,88.4847135044686,60.11,104.36222986694207 -3,3,ACN,98.07248876261579,196.5348267265113,116.12,43.99884594359548 -4,4,ADBE,130.64497830681407,121.33329683650732,138.99,41.77566086253358 -5,5,AMAT,75.39043306730187,107.22096954841571,135.94,71.01980883066668 -6,6,AMGN,136.79045884196086,41.63779272111307,80.13,46.662518965274614 -7,7,AMZN,114.62413820054807,70.96420763276674,0.0,0.593123489053842 -8,8,APD,125.8450702813671,66.0396829422447,117.97,39.47760235265585 -9,9,AVGO,139.59379881714588,47.409737426959204,112.7,41.90801333540908 -10,10,BA,160.98123119547898,56.68999303341564,199.97,200.0 -11,11,BAC,67.36367760818494,172.62681490942356,88.12,59.31337794386356 -12,12,BDX,110.18184446244406,65.56101875270619,120.23,53.09513094145142 -13,13,BIDU,150.82537602985602,89.36785915209987,85.13,135.63074628505646 -14,14,BMY,160.98123119547898,55.61000755608042,90.05,57.248659978974956 -15,15,CAT,133.9628473349977,53.44915611716712,134.18,105.21027752682537 -16,16,CCI,48.96872890304626,40.71018606848477,53.29,37.51941455427019 -17,17,CHTR,154.98194518352693,42.145288189151366,150.4,27.228633916550713 -18,18,CMCSA,146.7680629125239,60.9072388344174,108.35,68.20633978961776 -19,19,CME,70.163169032576,199.9999944399706,93.92,40.79282933144908 -20,20,COST,80.41604288665233,146.75290668120707,115.0,36.58364459954663 -21,21,CRM,134.59603167296376,141.96722446585485,159.84,100.91497446549263 -22,22,CSCO,120.55997440080642,187.8181891543031,108.2,42.44050233000708 -23,23,CSX,104.27713894583977,54.32939990722109,112.16,54.74916607300668 -24,24,CVS,135.19103895654334,68.13585480437237,91.29,55.90979252844121 -25,25,CVX,101.3396698471697,184.89508868758,41.41,60.95337842784888 -26,26,D,4.3923133815296085,52.4099609978203,99.27,40.760366389641874 -27,27,DE,140.52774327374226,45.06401997558897,136.33,57.453186220311125 -28,28,DHR,87.79588678965173,90.19066851102973,85.42,82.78805519627885 -29,29,DIS,141.3476576227695,88.8908622945864,166.75,43.14687042534553 -30,30,DUK,94.91164830660327,54.4493244587776,100.27,33.88522180364372 -31,31,EXC,106.0647977464432,54.41341938145345,102.77,44.20510797449332 -32,32,FDX,135.00252241230626,53.34828594370465,95.17,25.114194866864718 -33,33,FIS,148.46144015856456,66.7532456598581,81.72,39.63626807743001 -34,34,GE,91.15790200486788,147.08103270034468,175.64,146.22351162424394 -35,35,GILD,151.2044952147543,56.52871315531706,82.69,67.802408084516 -36,36,GOOGL,140.11321872176285,195.01205475339648,153.22,20.354197361697015 -37,37,GS,118.74543520148052,104.91754173574667,77.22,36.94371228161387 -38,38,HD,126.71316498144698,43.03978176601594,81.72,39.445926743799376 -39,39,HON,114.29369431763827,68.05851146515485,110.23,45.880078753481484 -40,40,IBM,118.4751329913031,52.02481130473244,104.36,40.56599243772292 -41,41,INTC,30.39471860378832,78.46005320973636,101.37,11.620366089371919 -42,42,ISRG,86.49035040805836,49.498626511899,147.05,36.25598063973711 -43,43,JNJ,63.72903613156852,98.89324695085209,92.98,49.25049996292883 -44,44,JPM,88.97475154629515,153.33382263164697,53.49,75.5222345002856 -45,45,KO,83.43140990057667,54.05918775871132,101.12,51.0539972645096 -46,46,LIN,85.4463293760633,89.97115353516222,113.68,175.39951162067177 -47,47,LLY,123.56822878561087,62.60962660154526,173.14,27.798098864965354 -48,48,LMT,89.63955979696466,74.97011666247903,125.16,34.939329264522925 -49,49,LOW,137.92406986378234,37.942774645770555,108.64,50.03421862699726 -50,50,LRCX,126.45062656347639,81.50472102113417,72.08,75.89863458999143 -51,51,MA,131.41764068463203,57.33384578800031,162.13,49.54808199123212 -52,52,MCD,79.58085418616103,37.14128945781223,114.02,56.192189033719856 -53,53,MCO,119.54500732824769,47.43024635444107,131.24,64.35179405953912 -54,54,MDT,108.42969734788738,72.09166633965734,76.89,35.51979739263485 -55,55,MMC,114.22021877736745,53.998842198480105,119.66,43.01166990391676 -56,56,MMM,60.91079809533632,63.90352156150345,79.75,51.5498465941439 -57,57,MO,9.33315076334979,41.77257707398821,90.89,34.42332481903656 -58,58,MRK,112.94421971054255,76.0102792430849,112.06,61.12301790550875 -59,59,MSFT,113.26609475449267,129.13298836649895,132.72,42.574394371216634 -60,60,NEE,105.90038834256646,54.74899947615555,115.15,71.52441621014867 -61,61,NFLX,129.11959281556602,73.59886372009423,166.33,76.7954778466989 -62,62,NKE,119.51855642731759,66.67074321544456,113.97,117.48351818421081 -63,63,NSC,96.88076222678136,59.188937679864566,98.62,49.3247825186535 -64,64,NVDA,82.25461700620143,74.4533858647976,164.85,6.926609061624467 -65,65,ORCL,122.92734777644266,41.548459098001416,116.42,46.376925277680336 -66,66,PEP,87.131497664537,52.96770941659908,110.23,53.91814705158701 -67,67,PFE,140.47340520393576,117.33062086687076,22.44,116.51242007359423 -68,68,PG,64.31230077832718,70.78374002008977,98.17,38.07115813063641 -69,69,PM,109.50100591046719,40.03460385353996,108.25,48.18188763164932 -70,70,PYPL,151.48799177385294,144.477957779145,146.26,60.19328753757178 -71,71,SCHW,129.0234669420565,196.0891176710779,119.99,45.70354212187421 -72,72,SO,84.46652562371243,52.934831801195735,107.75,71.93845531637749 -73,73,SPG,1.1854441448309712,39.91624507014297,114.17,75.66329877350253 -74,74,SPGI,114.22266821500354,105.82958475937723,133.43,43.418194870339185 -75,75,T,61.586410114552315,58.49189947763173,69.11,59.731454906145466 -76,76,TGT,146.61361867919015,61.82217064046817,41.98,28.280252582031757 -77,77,TMO,73.99122697155062,60.38671518508789,114.02,50.826203770832095 -78,78,TMUS,155.01159044367853,48.17225938313191,199.49,58.89699852799944 -79,79,TSLA,129.88191763420065,199.99687772267245,124.08,62.575536448354775 -80,80,TXN,95.34312077123577,63.82608388490933,120.95,61.63351739609634 -81,81,UNH,130.59286903995337,84.89118704487024,134.93,50.071745102527345 -82,82,UNP,102.08194911395603,47.78896102415891,116.17,39.50929713815176 -83,83,UPS,109.31516556780723,61.23566132359956,89.41,42.27357028519867 -84,84,USB,142.45442985947,139.9993021005325,90.49,41.1838844914599 -85,85,V,132.2376969692613,80.8097095034298,141.79,61.08058325638432 -86,86,VZ,25.824157206441292,51.278180522481826,70.84,35.57825810344986 -87,87,WFC,147.69065957371842,148.2762330181531,99.67,19.075069084803722 -88,88,WMT,80.94310440425323,81.35774870114794,98.07,80.66162547687941 -89,89,XOM,125.08994915257153,167.8541937577409,32.26,74.58447727917255 +0,0,AAPL,105.20185265325186,91.27312587891294,111.32,66.0148171052622 +1,1,ABBV,200.0,87.14034308193199,54.12,65.83803735194121 +2,2,ABT,3.502927155884448,97.10915729637422,60.11,102.18215353548281 +3,3,ACN,102.99006147737678,146.5852111543022,116.12,69.37291802458431 +4,4,ADBE,157.08692422406043,105.41122532364618,138.99,67.88534342574849 +5,5,AMAT,75.81577697045441,101.80819279063635,135.94,85.19217777229771 +6,6,AMGN,168.77019572724964,83.45503615220474,80.13,71.10456290005165 +7,7,AMZN,128.19260030021755,92.5399579016255,0.0,10.343561187034048 +8,8,APD,148.0669503043199,91.18186622650158,117.97,66.30259668856391 +9,9,AVGO,174.0182170622495,85.49149673125568,112.7,67.97505869592548 +10,10,BA,200.0,88.45899771456277,199.97,200.0 +11,11,BAC,67.79173261178073,122.62143587847078,88.12,78.73693105719734 +12,12,BDX,120.9311241861305,91.04741945362844,120.23,75.0926302092075 +13,13,BIDU,192.47942261306,97.33251356390144,85.13,118.41983126540988 +14,14,BMY,200.0,88.1293000093566,90.05,77.54667138353885 +15,15,CAT,163.40118417419154,87.45836482385222,134.18,102.60690920936649 +16,16,CCI,51.60759610039482,83.11031841390277,53.29,64.9139252760998 +17,17,CHTR,197.12970389804275,83.64140709738348,150.4,56.834816031842664 +18,18,CMCSA,186.53241729625944,89.7141435974903,108.35,83.67975731415228 +19,19,CME,70.51225582214956,197.45041307754047,93.92,67.21432356277394 +20,20,COST,81.21604015295037,112.60518280329671,115.0,64.2361867612725 +21,21,CRM,164.6066568792097,111.13597542401217,159.84,100.45749680810641 +22,22,CSCO,138.45301784981535,132.92094138672394,108.2,68.3344933392558 +23,23,CSX,111.84871270542078,87.73355418263719,112.16,76.0800366682177 +24,24,CVS,165.73828672281633,91.7653314706724,91.29,76.76473012861851 +25,25,CVX,107.56926163193683,130.32510900427462,41.41,79.66975386460486 +26,26,D,15.290217372440877,87.1300009352824,99.27,67.19201264338382 +27,27,DE,175.73738275715903,84.68485645841167,136.33,77.66540274605386 +28,28,DHR,89.74740588127347,97.54025196764677,85.42,91.32932741301067 +29,29,DIS,177.2304186526414,97.211927884558,166.75,68.80763358274393 +30,30,DUK,98.73477290665436,87.77084286355695,100.27,62.22564604607788 +31,31,EXC,114.53011384059165,87.75968377384388,102.77,69.50891012595386 +32,32,FDX,165.3799074709708,87.42665956706824,95.17,54.96214905661287 +33,33,FIS,189.15029196529755,91.38143775152557,81.72,66.41344938655487 +34,34,GE,93.89495615810021,112.70868281352884,175.64,124.49891622222334 +35,35,GILD,192.9724525123606,88.40999016045565,82.69,83.46083095677405 +36,36,GOOGL,174.97659262783273,142.86606486439246,153.22,50.36697854819834 +37,37,GS,135.25159681247422,101.23031576744079,77.22,64.49809547105107 +38,38,HD,149.68177206214273,83.96621489926906,81.72,66.28043734328139 +39,39,HON,127.63986325220993,91.74395100952218,110.23,70.60128984661448 +40,40,IBM,134.77945084892974,87.00731101342731,104.36,67.05822404426115 +41,41,INTC,37.22910058041551,94.53478392384825,101.37,39.79063206782623 +42,42,ISRG,88.1824052503914,86.18849955277852,147.05,63.99659688732255 +43,43,JNJ,64.37383689552667,99.72330114583912,92.98,72.7395741022917 +44,44,JPM,91.18219867928472,114.76133290510394,53.49,87.57208391417619 +45,45,KO,84.61107192396322,87.64935894296252,101.12,73.8539904481114 +46,46,LIN,86.94865586807126,97.48486218669902,113.68,145.50692299373404 +47,47,LLY,143.87624697553244,90.20764020964458,173.14,57.3242838499275 +48,48,LMT,92.00055125094745,93.61540663667986,125.16,63.02141545211876 +49,49,LOW,170.9052945742457,82.04827653234443,108.64,73.22625178253621 +50,50,LRCX,149.19248955823937,95.32575646727052,72.08,87.76904354555414 +51,51,MA,158.55479153795613,88.65386527495919,162.13,72.92481223231144 +52,52,MCD,80.29678974670271,81.7305112785843,114.02,76.93034944230925 +53,53,MCO,136.65551753769535,85.49843400732152,131.24,81.57050820275153 +54,54,MDT,118.16829492456176,92.8450544959632,76.89,63.45384058629298 +55,55,MMC,127.51723231747657,87.63052220000459,119.66,68.71739139872444 +56,56,MMM,61.806185203921274,90.57815945543335,79.75,74.15702943811968 +57,57,MO,20.53657072101916,83.5046846085962,90.89,62.63359712085422 +58,58,MRK,125.4034643977795,93.89099066030111,112.06,79.7656401374788 +59,59,MSFT,125.93383004616338,107.48643824754653,132.72,68.42449476554214 +60,60,NEE,114.28104697519642,87.86381321251984,115.15,85.46125669802359 +61,61,NFLX,154.19903240107166,93.24989411142877,166.33,88.23720618918928 +62,62,NKE,136.60890150159412,91.35841457629517,113.97,108.80960310364354 +63,63,NSC,101.36586853042037,89.20863062134259,98.62,72.7858647538479 +64,64,NVDA,83.27167524546657,93.4779727148943,164.85,31.849171398287666 +65,65,ORCL,142.70944266140097,83.42206901803506,116.42,70.92136793998438 +66,66,PEP,88.94786061768049,87.30671593584621,110.23,75.58570064005832 +67,67,PFE,175.63787032294806,104.37403854217264,22.44,108.31326906980352 +68,68,PG,64.91401871892884,92.49093498053787,98.17,65.30915014958158 +69,69,PM,119.85073876884272,82.85582774836678,108.25,72.06978657720182 +70,70,PYPL,193.33300975831932,111.897714400579,146.26,79.23875043299401 +71,71,SCHW,154.01759201257377,145.37010019920012,119.99,70.48713540796912 +72,72,SO,85.80487600994968,87.29633007414964,107.75,85.681572457534 +73,73,SPG,9.996654397458014,82.81093561235873,114.17,87.64593238546239 +74,74,SPGI,127.52131883874166,101.45894697883429,133.43,68.98828676742554 +75,75,T,62.4154643001036,89.00131684237897,69.11,78.97575456014215 +76,76,TGT,186.2853419515832,89.98024192579905,41.98,57.73409404457928 +77,77,TMO,74.36621243620229,89.5618195230685,114.02,73.71429954550699 +78,78,TMUS,197.15621675792158,85.74814478393527,199.49,78.49836132485574 +79,79,TSLA,155.64037394861813,188.17185266067338,124.08,80.58222343783717 +80,80,TXN,99.30575999707457,90.55609065377291,120.95,80.05353115294714 +81,81,UNH,156.98803331417588,96.19549222156785,134.93,73.24946125157986 +82,82,UNP,108.63594543845102,85.61946199526078,116.17,66.32475976772288 +83,83,UPS,119.5573457818638,89.80989999120914,89.41,68.2220717003117 +84,84,USB,179.21741918122777,110.5515927499423,90.49,67.4823393537137 +85,85,V,160.11517917436944,95.1460154537915,141.79,79.74166492408365 +86,86,VZ,33.803385687015506,86.76789485014307,70.84,63.49717039153255 +87,87,WFC,187.98025116241868,113.0889697385693,99.67,49.02255338919394 +88,88,WMT,81.80078636041182,95.28778506125856,98.07,90.23868149368765 +89,89,XOM,146.6696098368374,120.37115026559049,32.26,87.08011637537514 diff --git a/indexer/indexer.py b/indexer/indexer.py index a718ddf..c6bd33c 100644 --- a/indexer/indexer.py +++ b/indexer/indexer.py @@ -95,10 +95,11 @@ def normalizer(): ''' Normalize the dataframe columns to a range between 0 and 200''' not_normalized = pd.read_csv('Elaborated_Data/Not_Normalized.csv') # Read Not_normalized .csv - v_values = (200/(1+math.e**( -0.5*(not_normalized['Valuation'].mean()-not_normalized['Valuation'])))) #VALUATION STAT + # v_values = (200/(1+math.e**( 0.1*(-not_normalized['Valuation'].mean()+not_normalized['Valuation'])))) #VALUATION STAT + v_values = (200/(1+(1/9*not_normalized['Valuation']**2))) # VALUATION STAT not_normalized['Valuation'] = v_values - fh_values= (200/(1+math.e**( -0.4*(-not_normalized['Financial Health'].mean()+not_normalized['Financial Health'])))) #FINANCIAL HEALTH STAT + fh_values= (200/(1+math.e**( -0.1*(-not_normalized['Financial Health'].mean()+not_normalized['Financial Health'])))) #FINANCIAL HEALTH STAT not_normalized['Financial Health'] = fh_values not_normalized['Estimated Growth'] = not_normalized['Estimated Growth'].str.strip("%").astype("float") eg_values= (200/(1+math.e**( -0.1*(-not_normalized['Estimated Growth'].mean()+not_normalized['Estimated Growth'])))) #ESTIMATED GROWTH STAT @@ -106,7 +107,7 @@ def normalizer(): eg_values[i] = float(round(eg_values[i],2)) not_normalized['Estimated Growth']= eg_values - pf_values = (200/(1+math.e**( -0.1*(-not_normalized['Past Performance'].mean()+not_normalized['Past Performance'])))) #PAST PERFORMANCE + pf_values = (200/(1+math.e**( -0.05*(-not_normalized['Past Performance'].mean()+not_normalized['Past Performance'])))) #PAST PERFORMANCE not_normalized['Past Performance'] = pf_values # Create normalized dataframe for main page