scieee Open visual document viewer

Grammatical evolution for the prediction of hypoglycemia in diabetes

Cruz López, Marina de la

Abstract

Diabetic patients have to manage their blood sugar correctly to prevent complications. One such complication is hypoglycemia or low blood sugar, which occurs when the blood glucose concentration goes below a certain threshold. A hypoglycemic episode needs to be rectified before it becomes harmful and can be a very distressing situation for the patient. The main goal of this study is to program Structured Grammatical Evolution and Dynamic Structured Grammatical Evolution algorithms and use them to generate models for the prediction of hypoglycemic episodes in patients with diabetes. The algorithms will be used to obtain a white-box model made up of if-then-else statements that given some input data, comprised of the blood glucose and exercise readings of the patients from the previous 2 hours, optimizes a logical relation between these variables. The resulting formula will be able to determine if the patient is going to have a hypoglycemic episode in a 30, 60, 90 and 120 minutes prediction horizon.

Full text

GRAMMATICAL EVOLUTION FOR THE PREDICTION OF HYPOGLYCEMIA IN DIABETES G amá icas E olu i as pa a la p edicción de hipoglucemias en diabe es MARINA DE LA CRUZ LÓPEZ T abajo Fin de G ado en Ingenie ía In o má ica Facul ad de In o má ica, Uni e sidad Complu ense de Mad id Mayo de 2022 di igido po Ca los Ce igón Rückaue Depa amen o Ingenie ía del So wa e e In eligencia A i icial Facul ad de In o má ica Uni e sidad Complu ense de Mad id Resumen Los pacien es con diabe es deben con ola co ec amen e su ni el de azúca en sang e pa a e i a complicaciones. Una de es as complicaciones es la hipoglucemia o ni el bajo de azúca en sang e, que ocu e cuando la concen ación de glucosa en la sang e cae po debajo de cie o umb al. Un episodio de hipoglucemia debe co egi se an es de que se uel a dañino y puede se una si uación muy angus iosa pa a el pacien e. El obje i o p incipal de es e es udio es p og ama los algo i mos de G amá icas E olu- i as Es uc u adas y G amá icas E olu i as Es uc u adas Dinámicas, y u iliza los pa a gene a modelos de p edicción de episodios hipoglucémicos en pacien es con diabe es. Los algo i mos se u iliza án pa a ob ene un modelo de caja blanca o mado po sen en- cias i - hen-else que, dados unos da os de en ada, compues os po el ni el de la glucosa en sang e y las lec u as de da os de eje cicio de los pacien es de las 2 ho as an e io es, op imiza una elación lógica en e es as a iables. La ó mula esul an e se usa pa a de e mina si el pacien e a a ene un episodio de hipoglucemia en un plazo de 30, 60, 90 y 120 minu os. Palab as cla e Diabe es, G amá icas E olu i a, Algo i mos Gené icos, Ap endizaje Au omá ico, P edic- ción de Glucosa, G amá icas E olu i as Es uc u adas, G amá icas E olu i as Es uc u adas Dinámicas Abs ac Diabe ic pa ien s ha e o manage hei blood suga co ec ly o p e en complica ions. One such complica ion is hypoglycemia o low blood suga , which occu s when he blood glucose concen a ion goes below a ce ain h eshold. A hypoglycemic episode needs o be ec i ied be o e i becomes ha m ul and can be a e y dis essing si ua ion o he pa ien . The main goal o his s udy is o p og am S uc u ed G amma ical E olu ion and Dy- namic S uc u ed G amma ical E olu ion algo i hms and use hem o gene a e models o he p edic ion o hypoglycemic episodes in pa ien s wi h diabe es. The algo i hms will be used o ob ain a whi e-box model made up o i - hen-else s a e- men s ha gi en some inpu da a, comp ised o he blood glucose and exe cise eadings o he pa ien s om he p e ious 2 hou s, op imizes a logical ela ion be ween hese a iables. The esul ing o mula will be able o de e mine i he pa ien is going o ha e a hypoglycemic episode in a 30, 60, 90 and 120 minu es p edic ion ho izon. Keywo ds Diabe es, G amma ical E olu ion, Gene ic Algo i hms, Machine Lea ning, Glucose P e- dic ion, S uc u ed G amma ical E olu ion, Dynamic S uc u ed G amma ical E olu ion. Con en s Index i Acknowledgmen s iii 1 In oduc ion 1 1.1 In oduc ion.................................... 1 1.2 Hypoglycemia................................... 2 1.3 Objec i e ..................................... 3 2 Rela ed Wo k 5 2.1 In oduc ion.................................... 5 2.2 Symbolic P edic ion using Gene ic p og amming . . . . . . . . . . . . . . . . 6 2.2.1 S uc u ed G amma ical E olu ion . . . . . . . . . . . . . . . . . . . 6 2.3 Classi ica ion ................................... 7 2.3.1 Va iables and p edic ion ho izon . . . . . . . . . . . . . . . . . . . . . 7 2.3.2 Machine lea ning algo i hms . . . . . . . . . . . . . . . . . . . . . . . 7 3 Me hodology 10 3.1 G amma icalE olu ion.............................. 10 3.2 S uc u ed G amma ical E olu ion . . . . . . . . . . . . . . . . . . . . . . . 11 3.2.1 S a ic S uc u ed G amma ical E olu ion . . . . . . . . . . . . . . . . 14 3.2.2 Dynamic S uc u ed G amma ical E olu ion . . . . . . . . . . . . . . 16 3.2.3 Dep h ................................... 21 3.3 Ope a o s ..................................... 22 3.3.1 Mu a ionope a o ............................ 22 3.3.2 C osso e ope a o ............................ 23 3.4 G amma ..................................... 27 3.5 Fi nessFunc ion ................................. 30 3.5.1 Mul i-classRecall............................. 30 3.5.2 F1measu e ................................. 31 3.5.3 Weigh edAccu acy............................ 31 3.6 E olu iona yAlgo i hm ............................. 32 4 Da a 33 4.1 In oduc ion.................................... 33 4.2 Desc ip ion .................................... 33 4.2.1 Classi yingda a.............................. 36 4.3 Da aP ep ocessing................................ 37 i 4.3.1 Co ela ions................................ 38 4.3.2 Classbalancing.............................. 43 5 Resul s 45 5.1 Expe imen alSe -up ............................... 45 5.1.1 Gene al and Indi idual Models . . . . . . . . . . . . . . . . . . . . . 47 5.2 2Classes...................................... 48 5.2.1 30Minu es ................................ 49 5.2.2 60Minu es ................................ 53 5.2.3 90Minu es ................................ 57 5.2.4 120Minu es................................ 61 5.2.5 Resul s o 2classes............................ 65 5.2.6 Used a iables............................... 66 5.3 3Classes...................................... 71 5.3.1 120minu es................................ 72 5.3.2 Resul s o 3 Classes . . . . . . . . . . . . . . . . . . . . . . . . . . . 77 5.3.3 Used a iables............................... 78 5.4 Fu u eWo k.................................... 80 5.5 Di usion...................................... 81 Bibliog aphy 85 A JECO and Panc eas Model Tools 86 ii Acknowledgmen s Fi s ly, I would like o hank my amily o suppo ing me du ing hese pas yea s, my classma es and iends who ha e s udied alongside me and all he eache s ha ha e been a pa o my educa ion. An special hanks o Ca los Ce igón Rückaue and J. Ignacio Hidalgo o aiding and men o ing me h ough he c ea ion o his p ojec . I am also hank ul o Jo ge Al a ado o compiling he da a and o all he pa ien s whose da a was used o pe o m his s udy. A inal hanks o he Facul y o Compu e Science o he UCM ha has made all o his possible, and o he Adap i e and Bioinspi ed Sys em G oup o gi ing me he oppo uni y o add o his g ea p ojec . iii Chap e 1 In oduc ion 1.1 In oduc ion Diabe es is an illness cha ac e ized by high blood suga le els, hese le els a e caused by insulin abso p ion de iciency ha makes he body unable o keep he blood glucose le els wi hin a no mal ange. This can be a esul o ei he he body no p oducing enough insulin o he cells no being able o use i p ope ly. The e a e wo main ypes o diabe es. •Type 1 diabe es, he panc eas is no able o p oduce enough insulin o con ol blood suga le els as a esul o he loss o he be a cells o he panc eas ha p oduce i , mos commonly due o an au oimmune esponse om he body. Type 1 pa ien s need o injec insulin o keep hei no mal blood suga le el. •Type 2 diabe es, is gene ally caused by a high insulin esis ance ha o ces he pan- c eas o make mo e insulin han no mal o main ain heal hy blood glucose le els, as a esul o his he panc eas migh e en ually s op gene a ing enough insulin and end in a s a e simila o ha o ype 1 diabe es, al hough i s de elopmen akes longe and can be s opped o e e sed in some cases h ough a li es yle change ea ly on in he illness de elopmen . In his case, depending on he e olu ion o he illness he e a e di e en ea men op ions. Keeping blood suga le els wi hin a ce ain ange is impe a i e o main ain heal h and 1 p e en complica ions ha can esul om a bad blood glucose managemen , he e o e i ’s impe a i e o a pe son wi h diabe es o ha e good con ol a all imes. Fo ou s udy, we will be cen e ing ou sel es in Type 1 insulin dependan pa ien s as, by he na u e o he insulin injec ions, and o he ac o s, hey ha e mo e blood suga a iabili y and will be a isk o su e some o he s a es desc ibed husly. 1.2 Hypoglycemia Hypoglycemia, o low blood suga , is a s a e ha can happen mos commonly in people wi h diabe es. I is due o an excess in he ac i e insulin ha esul s in oo much o he blood suga being abso bed. I is conside ed hypoglycemia once he blood suga le el is less han 70 millig ams pe decili e (mg/dL), o 3.9 millimoles pe li e (mmol/L). The body has glucose homeos asis mechanisms ha p e en hypoglycemia om occu ing in mos cases, howe e people wi h diabe es ha e a sub-op imal glucagon esponse4and o he coun e - egula o y ho mones o insulin, making i easie o en e a hypoglycemic s a e. Ha ing blood suga le el below a ce ain h eshold can se iously a ec b ain unc ions and p oduces a ne ous esponse in he body, some o i s symp oms include, swea ing, dizziness, hunge , shakiness o embling. I no ea ed i can de elop in o se e e hypoglycemia and esul in he pe son passing ou , o e en dea h in ex eme cases. Hypoglycemic episodes should be p e en ed o a ious easons: •The ange o alues conside ed is ela i ely small and he e o e he ea lie a po en ial hypoglycemia is caugh he easie i is o p e en i om de eloping u he . •Ha ing a lo o hypoglycemic episodes makes he body ge used o hem so he symp- oms ha cha ac e ize hem become less appa en , his makes he pe son less likely o ecognize hem ea ly on wi hou measu ing hei blood suga . •An episode migh lead o an o e -compensa ion and esul in hype glycemia o high blood suga la e on. 2 The main issue ega ding being able o p e en hypoglycemia e en s is ha an excess in he insulin injec ed is no always easy o ealize, because i depends on he body’s insulin sensi i i y, which can a y du ing he day depending on di e en ac o s. One o he causes o a ia ion in insulin sensi i i y is he p ac ice o exe cise, which enhances i . I inc eases he abili y o he body o abso b glucose and ans o m i in o ene gy wi h less amoun o insulin. This can be e y help ul o a pe son wi h diabe es, and as such, i is ecommended o pe o m egula exe cise o s abilize glucose alues. The less insulin a pe son has o injec o ob ain he same esul , he mo e s able hei blood glucose will be, and i also p e en s hype glycemia episodes o high blood suga . Howe e , inc easing insulin sensi i i y means ha he pe son may be a isk o hypo- glycemic episodes om pas insulin injec ions and u u e ones i hey a e no calib a ed co ec ly in acco dance wi h he amoun o exe cise pe o med. This inc eased isk is one o he easons why people wi h diabe es a e o en sca ed o pe o m exe cise, e en hough he posi i es hea ily ou weigh he nega i es. Since he symp oms o hypoglycemia a e so no iceable, he hough o en e ing in o a hypoglycemic s a e can cause a psychological e- ac ion in he pe son ha makes hem a aid o pe o ming ac i i ies ha migh cause a hypoglycemic s a e, e en i his is coun e ac i e o hei well-being. Fo his s udy, we will use exe cise (o ac i eness) da a and glucose alues o p edic u u e hypoglycemia episodes a di e en ime ho izons. 1.3 Objec i e In o de o p edic u u e hypoglycemic e en s, we will use S uc u ed G amma ical E olu- ion, bo h he o iginal SGE and Dynamic SGE, o ob ain a whi e-box model composed o i - hen-else s a emen s ha pe o m a classi ica ion o u u e hypoglycemia episodes. These i - hen-else s a emen s will ha e a se ies o inpu a iables whose alues de e mine wha class we ob ain as a esul . The a iables conside ed will be he glucose eadings o he las wo hou s in i e-minu e in e als, ob ained by means o a con inuous glucose moni o 3 Chap e 3 Me hodology In his chap e , we will explain how he classi ica ion me hod we ha e de eloped wo ks. We will explain he implemen a ion o bo h S uc u ed G amma ical E olu ion ypes and o he ope a o s needed o use hem in an e olu iona y algo i hm. Ope a o s ha a e no discussed in his sec ion, such as selec ion, ha e no been implemen ed speci ically o SGE and o pe o m he es s we ha e used he ones al eady a ailable in he JECO lib a y. 3.1 G amma ical E olu ion G amma ical E olu ion (GE) is a a ia ion o Gene ic P og amming (GP) ha uses a g am- ma o gene a e he pheno ype om he geno ype o he indi iduals. The geno ype is made up o a lis o numbe s, each one o which will gene a e a p oduc ion om a ule made up o e minal and/o non- e minal symbols o he g amma . The indi idual pheno ype will be o med by he e minals o he g amma and ha e he s uc u e de ined by i . The lis ha con o ms he geno ype is o ixed leng h, de e mined by he use . I we inish decoding he lis and ou indi idual’s pheno ype is s ill incomple e, we can go back o he s a o he lis and epea he p ocess o an namoun o imes, called w aps, which a e also de ined by he use . I a e his ou indi idual is s ill incomple e we s op, gi e i a bad i ness, and do no compu e i , he indi idual is conside ed in alid. Each numbe on he lis s could gene a e any o he p oduc ions o ming he pheno ype 10 un il he e a e no mo e possible expansions, and i has been comple ely c ea ed, o be able o gene alize his p ocess he numbe in he lis go om 0 o a codon uppe bound, o example, 256, and he modulus o he o al amoun o p oduc ions o one ule is he ope a ion used o decode he esul when gene a ing he pheno ype. This ype o e olu ion has a couple o issues. On one hand, since each allele depends on he p e ious one a small change in one can comple ely change he inal esul , making mu a ion and c osso e a po en ially des uc i e p ocess. On he o he , as we use a modulus ope a o o de e mine he nex ule we could po en ially change an allele, bu he esul gene a ed migh be he same one, i depends g ea ly on he numbe o p oduc ions a ule has, he e o e mu a ing ce ain alleles migh e u n he same esul . Bo h hese issues ha e an impac on he o e all e olu ion o he esul and a e wha he S uc u ed G amma ical E olu ion is ying o imp o e. Howe e , he abili y o change he p oblem by changing he g amma a he han edi ing he code is a g ea ea u e o G amma ical E olu ion (GE) because i makes i e y lexible as i can wo k wi h any p oblem o which we ha e a G amma c ea ed, wi hou needing o pe o m any changes o he implemen a ion. Wi h di e en g amma iles we can change he way ou indi iduals will be s uc u ed, he inpu a iables we wan o conside , and how complex we wan he inal solu ions o be. 3.2 S uc u ed G amma ical E olu ion Al hough GE has been success ully applied o di e en p oblems, i p esen s some d awbacks de i ed om he p ocess o decoding he solu ions. In o de o pa ially sol e hese conce ns, Lou enço e al. p oposed S uc u ed G amma ical E olu ion17. In compa ison o G amma ical E olu ion, whe e indi iduals a e made up o a lis o num- be s o a se leng h and each numbe is used o gene a e he nex symbol o he pheno ype, in S uc u ed G amma ical E olu ion, indi iduals a e made up o a lis o lis s. Each in e nal lis ep esen s a non- e minal o he g amma and he numbe s con ained 11 a e he possible expansions o his ule o a ce ain indi idual in ou popula ion, he e o e each in e nal lis ’s leng h can be a mos he maximum numbe o e e ences o ha ule. Each o he numbe s con ained in he in e nal lis ep esen s a p oduc ion o he ule in ques ion, he e o e he numbe s can go om 0 o Cn−1wi h Cnequal o he maximum amoun o p oduc ions o a non- e minal, as shown in Figu e 3.1. Figu e 3.1:Possible alleles o each ule When decoding an indi idual we will ha e a lis o indexes, ins ead o jus one as we had in G amma ical E olu ion (GE). E e y ime we ha e o decode a non- e minal, we will go o he lis o p oduc ions o his non- e minal and ge he nex elemen o he lis we ha e no consumed up o ha poin , gi en o us by he index alue o ha lis o non- e minals, as shown in Figu e 3.2. Wi h his, he decoding p ocess will be: I he nex symbol is a e minal, we add i o ou pheno ype and con inue wi h he nex elemen . I he nex symbol is a non- e minal hen 12 we ge he co esponding p oduc ion based on wha he indi idual’s geno ype s a es and epea he p ocess o all he symbols o he p oduc ion un il we don’ ha e mo e symbols. Figu e 3.2:Geno ype o pheno ype 13 3.2.1 S a ic S uc u ed G amma ical E olu ion The o iginal e sion o S uc u ed G amma ical E olu ion uses s a ic in e nal lis s, whose leng hs will no a y du ing he e olu ion, o ep esen he di e en ules. We ha e called he o iginal e sion S a ic S uc u ed G amma ical E olu ion o S a ic SGE o di e en ia e i om he dynamic e sion and highligh i s main di e ence. To ensu e he p econdi ion o ha ing s a ic lis s each in e nal lis is gene a ed comple ely o i s maximum possible leng h, and he maximum numbe o e e ences o each non- e minal elemen o he g amma , e en i said expansions a e no being used by an indi idual. In Figu e 3.3 can be seen an example o his p ocess, o each non- e minal o he g amma we need o compu e he uppe bound o imes ha a ce ain ule can be called om ano he one. The i s ule will always be called once, as is i he en y poin o he pheno ype cons uc ion. This mechanism o coun ing e e ences o ces us o elimina e ecu sion om he g amma ile since ha ing ecu sion in ou g amma means ha he e could exis an in ini e numbe o e e ences o he ecu si e ule. We ha e pe o med his by se ing a maximum ecu si e dep h, de ined by he use , and ans o ming he ecu si e ule in o a se o ules ha mimic he ecu sion up o he se dep h, wi h dep h = 0 equi alen o elimina ing he ecu si e p oduc ion and only keeping he non- ecu si e ones. <exp > ::= <exp > <op> <exp > As an example, o dep h 3 his ule will be ans o med in o: <exp > ::= <exp 0> <op> <exp 0> | < e m> <op> < e m> <exp 0> ::= <exp 1> <op> <exp 1> | < e m> <op> < e m> <exp 1> ::= <exp 2> <op> <exp 2> | < e m> <op> < e m> <exp 2> ::= < e m> <op> < e m> 14 Figu e 3.3:Coun ing he maximum amoun o e e ences o a non- e minal We change he o iginal ecu si e ule o call o he newly c ea ed non- ecu si e ules, each dep h numbe calls o he nex one. The inal one will elimina e all he ecu si e p oduc ions and only keep he ones ha ha e non- ecu si e symbols, he newly made ules will be added o he loaded g amma and a e wa d, he e e ences a e coun ed. Conside a ions o S a ic SGE In s a ic SGE he indi idual’s geno ype will be e y long since we ha e o gene a e he uppe bound o possible alleles gene a ed. As a esul , he mo e ecu si e dep h is added by he use he longe he indi idual, as we will ha e o add as many ex a lis s as non- e minals gene a ed h ough he dep h, each one wi h a leas 1 elemen . This will a ec 15 he pe o mance o he e olu ion o e hem, making S a ic SGE slowe han he dynamic e sion. Gene a ing non- ecu si e ules in his ashion will change he s uc u e o he inal in- di idual in compa ison o he Dynamic e sion, his a ec s bo h mu a ion and c osso e , making hem no equi alen . In he case o c osso e , i inc emen s he numbe o elemen s ha can be in e changed be ween he indi iduals and also allows a mo e speci ic exchange, al hough he e is a highe chance ha he non- e minal lis exchanged won’ be used o gene a e he pheno ype. In he case o he mu a ion i only a ec s i we a e pe o ming a mu a ion on he le el o he lis s and no he alleles, because we ha e mo e lis s we can mu a e (because we ha e mo e non- e minals) we will mu a e mo e alleles pe indi idual. 3.2.2 Dynamic S uc u ed G amma ical E olu ion The o iginal S uc u ed G amma ical E olu ion o S a ic SGE is able o sol e he main issues wi h G amma ical E olu ion, al hough i adds a new one due o he need o g amma p epossessing and dele ing ecu sion. Making ou solu ions o be o he maximum leng h ensu es ha we will ne e go o e he se bound, howe e , his leng h will be unnecessa y in mos cases, as mos solu ions will no need he maximum leng h. Pai ed wi h ecu sion, i becomes e y unscalable. As a esul , a dynamic app oach o he lis gene a ion was implemen ed called Dynamic S uc u ed G amma ical E olu ion ha would ix his issue by making he geno ype able o g ow dynamically. In Dynamic SGE he lis s a e gene a ed dynamically, meaning, when he indi iduals a e gene a ed we gene a e he lis s up o wha is needed o comple e he indi idual’s pheno ype (all he gene a ed indi iduals mus be alid om c ea ion). This adds a le el o complexi y in compa ison o he S a ic e sion as an indi idual migh become in alid a e we ha e pe o med c osso e and mu a ion o e hem. To a oid gene a ing in alid indi iduals when he pheno ype is being compu ed we can add ex a alleles o a ce ain non- e minal lis as needed o comple e he indi idual pheno ype and be able o calcula e i s i ness. 16 Figu e 3.4:Geno ype o pheno ype in DSGE when indi idual is in alid As seen in Fig. 3.4, he indi idual a e c osso e and mu a ion is in alid, he e o e when gene a ing he pheno ype as we ge o he second < op > ob ained om expanding < e m > he e is no possible elemen o expand, we will ha e o gene a e a andom allele, in he example case, we gene a e allele 1 and append i o he end o he lis o < op >. 17 The same hing happens in he nex non- e minal < a > o which we also don’ ha e an expansion, we gene a e a new alue and append i . A he end o he geno ype o pheno ype con e sion, he indi idual has changed o become alid. The index compu ing emains he same as in S a ic SGE. As wi h he s a ic e sion ecu sion poses an issue since we could po en ially c ea e an indi idual ha ne e comple es i sel , o s op his om happening and om ha ing indi id- uals ha a e ex emely big, we add a maximum dep h. In he o iginal implemen a ion,16, he maximum dep h was implemen ed h ough maximum ee dep h, which limi ed how long an indi idual can be. I was en o ced only when gene a ing ex a alleles in he pheno ype c ea ion, i he dep h o he ee became bigge o equal o he numbe se by he use he algo i hm could only gene a e non- ecu si e expansions and no ecu si e ones. Using his implemen a ion a b anch o he ee migh become longe han he maximum ee dep h, since we ha e o gene a e alid indi iduals, howe e , as a esul o no gene a ing ecu si e ules he maximum leng h is s ill limi ed. In Fig. 3.5 he e is a g aphical ep esen a ion o how he maximum dep h is en o ced in he o iginal implemen a ion. We ha e changed he g amma so ha he < exp > ule is now ecu si e. When we each he second < exp > p oduc ion, we don’ ha e any mo e alleles, so we need o dynamically gene a e hem o comple e he indi idual. Since he cu en dep h o his b anch is equal o he maximum dep h se , we only ha e one op ion in he possible p oduc ions we can gene a e: < e m > as i is he only non- ecu si e p oduc ion o he ule. The ac ha a b anch can become longe han he maximum dep h makes his imple- men a ion dependen on he g amma s uc u e, i he ecu si e ules appea u he down in he g amma ee i will ha e less p obabili y o pe o ming ecu sion han up he g am- ma ee. Due o his, we ha e chosen o p og am ano he implemen a ion ha makes i equi alen o he s a ic SGE. In his al e na e implemen a ion, we ha e changed he maximum ee dep h by a ecu - 18 Figu e 3.5:Geno ype o pheno ype in DSGE showing limi ed ecu si e dep h si e dep h jus as wha we had in he S a ic e sion, each ecu si e ule can be expanded n imes, comple ely independen o he non- ecu si e ules and he es o he g amma s uc u e. Ano he change we ha e added is an op ion o mo e bloa ing con ol o he indi iduals. 19 we each a e minal, o we don’ change any mo e lis s. This p ocess is shown in Fig. 3.9 I wo ks a bi be e han he Uni o m c osso e in some cases, especially o he s a ic lis s uc u ed g amma ical e olu ion, whe e adding ecu sion gene a es new ules o he g amma . When pe o ming a andom in e change o lis s, he child en will look less han he pa en s he mo e dep h added in c ea ion, because mo e in e media e non- e minals can be exchanged. I main ains he s uc u e o he pa en s be e in he child en, adding less a ia ion o he o sp ing. Figu e 3.9:T ee C osso e Diag am 26 3.4 G amma As we ha e s a ed be o e, he geno ype o pheno ype con e sion is pe o med by means o a g amma ile ha de e mines he s uc u e o he pheno ype o he indi idual. In SGE, compa ed o no mal GE, he g amma s uc u e also a ec s he indi idual in e nally. The g amma will be he one ha s a es he s uc u e o ou indi iduals in e ms o he numbe o lis s, which co esponds o he numbe o ules o he g amma , and he maximum leng h ha each lis can ha e, which co esponds o he numbe o e e ences made o a ce ain ule o non- e minal expansion. The classi ica ion will also be pe o med h ough he g amma ile in he geno ype o pheno ype con e sion, i will allow us o change he numbe o classes jus by edi ing he g amma ile. Fo ou p oblem, he g amma will be used o ans o m he lis o lis s in o a sequence o i - hen-else s a emen s ha e u n a class. The classes ha e o also be de ined in he inpu da a o compa e he esul om he i - hen-else o he ac ual alue o he inpu example. The i - hen-else s a emen s use he inpu da a and some cons an s o c ea e condi ions, i all he condi ions a e me hen we conside ha he example belongs o ha speci ic class. Since we a e e u ning he s a emen s as ou models, he condi ions can be s udied o obse e wha inpu pa ame e s he model has conside ed o e o he s. This whi e-box app oach makes i so ha we can gi e a medical explana ion o he esul s, o disca d a model ha we conside is no co ec using knowledge om he p oblem speci ica ion. We ha e es ed wo di e en ypes o g amma s depending on he numbe o classes we ha e o classi y, one o 2 classes 3.10 and ano he o 3 classes 3.11, hei s uc u e is he same and hei only di e ence is he ule < ype > ha gene a es a cons uc ion o 2 classes o one o 3 classes. In e ms o he s uc u e o he condi ions ha hey can gene a e hey a e as ollows: The < ype > ule is he en ance o he p og am and he one ha will wield he inal esul , i gene a es < binexp > ules ha c ea e he logical condi ions. The < binexp > 27 Figu e 3.10:Example G amma 2 Classes Figu e 3.11:Example G amma 3 Classes 28 ule is a ecu si e ule ha c ea es a sequence o condi ions used by "&&" o "||" logical ope a o s. The in e nal condi ions a e s a emen s ha can be e alua ed and compa ed wi h each o he using he ela ional ope a o s "<", ">", "≥", "≤". The le -hand side o he s a emen s has he < exp > ecu si e ule ha gene a es a ma hema ical ope a ion made up o he inpu a iables, ha in ou g amma appea as he "ge Va iable(x,k)" unc ion, and cons an s ha a e gene a ed wi h he < numbe > ule. The igh -hand side is he < mix > ule ha can ei he gene a e a < exp > o a < numbe >. Recu sion appea s in wo di e en places in ou g amma , so he max dep h we se o each ype o algo i hm will con ol he numbe o condi ions ha a e gene a ed by he indi idual, by he < binexp > ule, and he leng h o he condi ions, om he < exp > ule. The inpu a iables, de ined by he "ge Va iable(x,k)" unc ion, ep esen each ype o a iable "x", o each example "k" in ou inpu o aining o es . We will explain he inpu da a s uc u e in he Da a sec ion, bu in gene al e ms, he a iables a e de ined as such: •Glucose alues o he wo hou s be o e he ime o p edic ion (x∈(0,25]). •Hea a e alues o he pa ien o he wo hou s be o e he ime o p edic ion (x∈(25,50]). •Amoun o s eps pe o med by he pa ien on he wo hou s be o e he ime o p edic- ion (x∈(50,75]). •Amoun o calo ies bu ned by he pa ien in he wo hou s be o e he ime o p edic ion (x∈(75,100]). As can be obse ed in ig 3.10 and ig 3.11 we ha e no aken in o accoun e e y single possible inpu o gene a e he models, we ha e handpicked a subse o hem o cons uc he solu ions, howe e , he a ailable inpu s ha could be used by he g amma a e he ones desc ibed abo e. This selec ion will be discussed in Chap e 4. 29 3.5 Fi ness Func ion As wi h any e olu iona y algo i hm, we need o es ablish a i ness unc ion ha will de e - mine how good an indi idual is. Since we a e conside ing a classi ica ion p oblem, we can es di e en classi ica ion me ics and compa e hei ou pu wi h he esul s ob ained om he es . In ou p oblem, he main me ic we a e going o conside when es ing whe he a solu ion is good o no is he sensi i i y (o ecall) o each class. This e e s o he numbe o elemen s ha ha e been classi ied as one class and ac ually belong o his class. This me ic is he mos impo an as we wan o be able o ecognize all ins ances o a po en ial Hypoglycemia o e all he cases, mo e han we wan ha he ones ha we ha e classi ied o be co ec . In bina y classi ica ion we alk abou sensi i i y (o ecall) and speci ici y since we only conside posi i es o nega i es, hese e e o he pe cen ages o ue-posi i es and ue- nega i es o e he o al numbe o posi i es o nega i es in ou da a. In mul i-class classi ica ion, we can jus look a he sensi i i y o each class, which would be equi alen . All he i ness unc ions conside ed will e u n a alue be ween 0 and 1 whe e he highe he esul he be e he classi ica ion. Since we a e minimizing in ou e olu iona y algo- i hm, we will use 1−F i nessF unc ion in all cases so ha he esul ha ge s close o 0 is he bes esul o e all. 3.5.1 Mul i-class Recall This i ness unc ion calcula es he sensi i i y o each class and makes he ha monic mean o all he classes. In bina y classi ica ion, i would be equi alen o making 2*(sensi i - i y*speci ici y)/(sensi i i y+speci ici y). By pe o ming he ha monic mean o he ecalls, we make su e ha no one class has a much highe ecall han he o he s. 30 Mul i −classRecall =numClasses PnumClases i=1 1 Recalli (3.1) Recall =T ueP osi i es To alP osi i es (3.2) I s main ad an age is ha i can wo k wi h unbalanced da a se s because i doesn’ ma e how many examples we ha e o one class, each class coun s he same as he es . 3.5.2 F1measu e This is a classi ica ion me ic ha makes he ha monic mean o he p ecision and ecall o he class 0. F1measu e =2∗Recall ∗P ecision Recall +P ecision (3.3) whe e P ecision co esponds o he ac ion o elemen s ha we a e classi ying co ec ly in he Hypoglycemia class om he he o al amoun we ha e classi ied in his class and Recall o he ac ion o elemen s ha we a e classi ying co ec ly om he o al amoun o elemen s in he Hypoglycemia class. In a mul i-class p oblem, we will calcula e he F1measu e measu e o each class and e u n he a e age (mac o-a e age). 3.5.3 Weigh ed Accu acy This is a i ness o mula p oposed in3 o E olu iona y algo i hms in he con ex o classi i- ca ion. I combines he F1measu e wi h accu acy in a 50% spli . I s main d awback is ha because i uses accu acy, we won’ be able o use i wi h unbalanced classes. 31 WA = 0.5∗Accu acy + 0.5∗F1measu e (3.4) I gi es good esul s, be e han when we a e only conside ing he F1-measu e s an- dalone, which is why we ha e used i o pe o m he es s. 3.6 E olu iona y Algo i hm Finally, we ha e implemen ed an e olu iona y algo i hm ha pe o ms he p ocess o selec- ion, c osso e , and mu a ion, o each gene a ion. These a e made sequen ially and a e he s anda d p ocess o a gene al gene ic algo i hm. We selec 2 indi iduals using he selec ion me hod chosen, we pe o m c osso e , hen mu a ion, and hen we add hem o he lis o child en. The wo main di e ences be ween ou algo i hm and a gene al e olu iona y algo i hm is he eplacemen policy and he egene a ion o he popula ion. In e ms o eplacemen , o each gene a ion, we will ge he bes indi iduals be ween he pa en s and child en, and hose a e he ones ha will compose he popula ion o he nex gene a ion. This makes he e olu ion a e y eli is p ocess and migh end up in he popula ion con e ging oo quickly and no e ol ing u he han a local op imum, in o de o pallia e his om happening we ha e added a egene a ion o a sec ion o he popula ion. I he popula ion i ness e e con e ges o a numbe a pe cen age o he popula ion, se by he use , will be egene a ed om sc a ch o add new genes o he e olu ion and hope ully make he p oblem ge o e he local op imum. 32 Chap e 4 Da a 4.1 In oduc ion As s a ed be o e he goal o ou sys em is o be able o p edic hypoglycemic episodes a a ce ain ime, ou da a will only include glucose eadings, numbe o s eps, hea a e, and calo ies bu ned o e he p e ious wo hou s om he ime o p edic ion measu ed in 5-minu e in e als. The glucose eadings ha e been ob ained by means o a Con inuous Glucose Moni o (CGM) F eeS yleLib e, and he es o he da a is ob ained h ough a sma wa ch Fi bi Ionic, making all he necessa y da a o ou model ob ainable wi hou needing use inpu . 4.2 Desc ip ion The da a used in his s udy has been ob ained om 11 pa ien s wi h ype 1 diabe es, whose desc ip ions appea in 4.1. We will es ic he da a o a maximum o 2 weeks wo h o obse a ions pe pa ien . F om he 11 pa ien s, we ha e 4 males and 7 emales, whose ages ange om 20 yea s old o 56. They ollow 2 di e en ea men me hods, 3 pa ien s con ol hei blood suga h ough mul iple doses o insulin and he o he 8 do i by means o an insulin pump ha adminis e s a con inuous subcu aneous s eam o insulin. Thei HBA1c alues ep esen he a e age alue o blood suga in he pas 8 o 12 weeks and a e used as a ep esen a ion o 33 he glycemic his o y25. The pa ien ’s alues go om 6.4% o 8.5%, which is ans o med o a e age glucose mg/dl would be om 137 mg/dL o 197 mg/dL on a e age. In gene al, a heal hy ange o a pe son wi h diabe es should be 7% o less, howe e , i ’s impo an o keep in mind ha his is an a e age and a low alue does no necessa ily mean a good con ol, a pe son wi h a low o high HBA1c can s ill ha e equen hypoglycemias and high glucose a iabili y. In e ms o hei BMI 7 pa ien s a e wi hin he no mal ange (18.5-24.9), 3 a e in he o e weigh ca ego y (25-29.9) and one is in he obese ange (30 o highe ), his is impo an o ake in o accoun in e ms o hei blood glucose con ol because an excess in weigh gain dec eases insulin sensi i i y and makes glucose con ol ha de . Finally, we can obse e ha all pa ien s ha e been diabe ic o mo e han 8 yea s wi h he maximum being 36 yea s, his implies ha hei le o e insulin p oduc ion is p obably negligible. ID Gende Age IMC HBA1c T ea men Yea s DMT1 HUPA001 F 56.3 22.76 8.2 ISCI 15.46 HUPA002 M 48.6 23.82 7.1 ISCI 36.47 HUPA003 F 43.4 18.72 7.3 ISCI 12.45 HUPA004 M 41.2 27.16 7.8 ISCI 8.5 HUPA005 F 20.9 22.57 6.9 ISCI 39.5 HUPA007 M 37.6 30.64 6.6 ISCI 10.1 HUPA011 F 35.0 23.92 7.8 ISCI 27.3 HUPA014 F 50.0 25.39 8.5 MDI 12.9 HUPA015 F 43.1 22.33 6.4 MDI 11.2 HUPA016 F 29.9 26.33 6.5 ISCI 20.1 HUPA027 M 26.4 22.21 7.0 MDI 23.7 Table 4.1:Cha ac e is ics o he pa icipan s: ID, Gende (M=Male; F=Female), Age, BMI, HbA1c, T ea men (MDI: Mul iples doses o insulin; ISCI. In usion Subcu aneal con- inuous o Insulin)Yea s o e olu ion o DMT1. The inpu da a ob ained om he pa ien s is s uc u ed as ollows: Each ow con ains 101 columns, he i s one is he glucose alue a he ime ho izon H∈ {30,60,90,120} ollowed by he glucose eadings om he p e ious 2 hou s, hen he hea a e, ollowed by he s eps and ending in he calo ies bu ned. Each one o hese ypes has 25 eadings, whe e 34 he i s alue is always eading a ime and he nex alues a e he eadings om -120 o -5 in 5-minu e in e als o each ype o da a. In his way, o each da a poin we can access o all he a ailable in o ma ion by looking a he column alues. We will ha e as many ows as da a poin s o each pa ien . Figu e 4.1:O iginal Da a o +30 Figu e 4.2:Edi ed Da a In Fig. 4.1 we can obse e a agmen o he o iginal da a s uc u e ha we hen p ocess so ha ou algo i hm can wo k wi h i , i includes he alues om -120 o +30 as in his example his is he alue o p edic ion, sepa a ed in 5-minu e in e als, he i s column is he ime a which he da a is aken. I allows o a Wha -I scena io, whe e we can use he o +30 da a as i we knew i , bu we will no be using i . In Fig. 4.2 we see he inal da a s uc u e ha is sen o he algo i hm, he i s column 35 Fig. 4.6 Figu e 4.6:Co ela ions o he 7 Hea a e alues conside ed S eps This is he inpu a iable wi h he leas amoun o co ela ion be ween i sel , which makes sense as he numbe o s eps aken om one 5-minu e in e al o ano he can a y a lo . Fo ou p oblem we a e in e es ed in i desc ibing ’ac i eness’ since he mos common exe cise people do in hei daily li e is walking o unning we ha e aken i in o accoun . Fo he a iables used we ha e chosen S eps ( ), S eps ( -15), S eps ( -30), S eps ( -45), S eps ( -60), S eps ( -75), S eps ( -90), S eps ( -105), S eps ( -120), ha co espond o he amoun o s eps aken a ins an , ime o p edic ion, minus kminu es. Thei co ela ion alues can be seen in Fig. 4.7 Calo ies bu ned The co ela ion o he numbe o calo ies bu ned in 5-minu e in e als is lowe han he Glu- cose o Hea a e, bu highe han he co ela ion o e he numbe o s eps. This a iable ep esen s a so o combina ion o he p e ious wo, alongside a basal alue ha is cons an . 42 Figu e 4.7:Co ela ions o he 9 S eps alues conside ed Al hough he speci ic o mula used o compu e he alue depends on he Sma wa ch used. The a iables included a e Calo ies ( ), Calo ies ( -20), Calo ies ( -40), Calo ies ( -60), Calo- ies ( -80), Calo ies ( -100), and Calo ies ( -115), o a o al o 7 a iables, ha co espond o he numbe o calo ies bu ned a ins an , ime o p edic ion, minus kminu es. Thei co ela ions can be seen in Fig. 4.8 4.3.2 Class balancing A e pe o ming he classi ica ion, we will ob ain a da a se whe e he classes a e e y unbalanced, since he ecommended pe cen age o hypoglycemia alues is unde 4% o he o al alues. To help he algo i hm lea n p ope ly and quicke , we should pe o m class balancing, so ha he e a e app oxima ely he same amoun o examples in each class. Fo balancing he di e en classes we can ei he do unde -sampling; whe e we ge all he examples o he class wi h ewe ins ances and a andom sample o he o he classes so ha he amoun o ins ances o each class is app oxima ely he same, o o e sampling; whe e we gene a e ex a samples o he classes wi h he leas amoun o ins ances syn he ically. 43 Figu e 4.8:Co ela ions o he 7 bu ned calo ies alues conside ed Fo ob aining he esul s shown in he nex chap e we ha e chosen o pe o m an unde - sampling o he da a, as in e ms o pe o mance i is he cheapes op ion and he esul s ob ained om p e ious es s don’ show a huge ad an age in pe o ming an o e sampling o he da a. The balancing will only be pe o med o e he aining se . Fo he 3.1 unc ion discussed p e iously he da a doesn’ need o be balanced o wo k, howe e , i is ecommended since he inal esul s a e be e wi h balanced aining da a. 44 Chap e 5 Resul s In his chap e , we will show and explain some esul s ob ained using he me hodology commen ed p e iously wi h he da a o he pa ien s discussed. The da a has been di ided in o aining and es wi h 70% and 30% o he o al da a espec i ely, main aining he o iginal da a dis ibu ion o he classes. The i ness unc ion we ha e used o pe o m he p edic ion, om he ones desc ibed, is he Weigh ed Accu acy, al hough any o hem could be used. As a esul o his decision he aining da a mus be balanced o ob ain good esul s, in gene al e en i we use he Recall i ness unc ion, which can deal wi h an unbalanced da a se , we will ob ain he bes esul s a e pe o ming he da a balancing. The da a balancing chosen was andom unde -balancing. The es da a will main ain he o iginal dis ibu ion o he classes. This ensu es ha he da a we a e es ing o e is he same da a ha will be encoun e ed in a eal-li e scena io. 5.1 Expe imen al Se -up To ob ain he esul s om he e olu iona y algo i hm, we ha e se i s pa ame e s as such o all he es s: S a ic S uc u ed G amma ical E olu ion •Replacemen policy: Bes indi iduals om pa en s and child en wi h a 10% egene - a ion pe cen age 45 •100 popula ion size •500 gene a ions o +30 and +60 and 800 gene a ions o +90 and +120 •Recu si e Dep h: 3 •Tou namen selec ion ope a o wi h p essu e 2 •T ee c osso e ope a o –70% c osso e p obabili y –60% in e change p obabili y •Basic mu a ion o all alleles –5% p obabili y Dynamic S uc u ed G amma ical E olu ion •Replacemen policy: Bes indi iduals om pa en s and child en wi h a 10% egene - a ion pe cen age •100 popula ion size •500 gene a ions o +30 and +60 and 800 gene a ions o +90 and +120 •Maximum T ee Dep h and Ini ial Maximum T ee Dep h: 7 •Ini ial Minimum Recu si e Dep h: 0 •Tou namen selec ion ope a o wi h p essu e 2 •Uni o m c osso e ope a o –70% c osso e p obabili y –20% in e change p obabili y 46 •Basic mu a ion o all alleles –5% p obabili y We ha e se he pa ame e s o be equi alen o bo h algo i hm ypes, he wo main di e ences a e he dep hs: whe ein he S uc u ed G amma ical E olu ion as we ha e wo ecu si e ules we se dep h 3 o each o hem and in Dynamic G amma ical E olu ion we se maximum ee dep h o 7 ha conside s bo h ecu si e ules plus he ini ial ule. And he c osso e ope a o , whe e we es ed he ee c osso e o he S a ic SGE, since i wo ks be e because we ha e mo e ules and he Uni o m c osso e o he Dynamic SGE. Fo each se o da a, we ha e execu ed 30 imes he algo i hm and ob ained he mean, median, and s anda d de ia ion o he bes esul o each execu ion. Wi h he bes elemen o hose 30 gene a ions, we ob ain he ecall alue on he Tes da a-se which will ep esen how well he model is able o classi y he da a o each class. 5.1.1 Gene al and Indi idual Models Fo each o he 11 pa ien s, we a e able o gene a e an indi idual model, ha only uses hei da a o aining, bu i can also be use ul o c ea e a gene al model, ha has been ained wi h he da a o all he pa ien s and es his model on each pa ien . E en hough an indi idual app oach will gi e us be e esul s in almos all cases, using a gene al model can be use ul i we wan o p edic a pa ien ha we don’ ha e a lo o da a on, o a all. How well his model wo ks will g ea ly depend on he speci ic pa ien and whe he he da a om o he pa ien s can be gene alized o hem o no . We will no make such dis inc ions in his s udy, howe e , we will obse e ha some pa ien s consis en ly gi e wo se esul s in he gene al models han o he s, whose sco e is highe . 47 5.2 2 Classes The da a will only be di ided in o wo classes, Hypoglycemia (Hypo) = 0 and Non-hypoglycemia (No Hypo) = 1, o each p edic ion ho izon we will ob ain how well he algo i hm classi ies he di e en inpu pa ame e s and compa e he ecall o he gene al and indi idual models. The g amma used will be he one shown p e iously in Fig. 3.10. This p ocess is epea ed o he 4 p edic ion ho izons, [30, 60, 90, 120] minu es. Fo each p edic ion ho izon, we ge he Mean, Median, S d. De . and bes i ness o he 30 execu ions, his in o ma ion is shown in he ables; +30: Tab. 5.1 , +60: Tab. 5.4 , +90: Tab. 5.7 and +120: Tab. 5.10. Fo he model wi h he smalles i ness alue o he 30 execu ions (bo h indi idual and gene al) we ob ain he Recall o he classes, his is shown in he ables; +30: Tab. 5.2 , +60. Tab. 5.5 , +90: Tab. 5.8 , +120: Tab. 5.11. Fo each p edic ion ho izon, we ha e also es ed o he machine lea ning algo i hms om SkLea n o compa e how he bes -ob ained model a es in compa ison wi h o he Machine Lea ning algo i hms, his can be seen in; +30: Tab. 5.3 , +60: Tab. 5.6, +90: Tab. 5.9 and +120: Tab. 5.12. The numbe shown is he a e age Recall o each class o all he pa ien s by pe o ming he aining and es o e he da a om all he pa ien s since we jus wan ed a gene al iew o he compa ison. 48 5.2.1 30 Minu es Table 5.1:S a is ics: Mean, Median, S anda d de ia ion and Bes Fi ness o all he models we ha e ained Pa ien Algo i hm Type Mean Median S d. De . Bes Fi ness HUPA001 S a ic 0.0197 0.0227 0.0091 0.0 HUPA001 Dynamic 0.0186 0.0227 0.009 0.0 HUPA002 S a ic 0.101 0.1031 0.0085 0.0791 HUPA002 Dynamic 0.1004 0.1002 0.0077 0.0839 HUPA003 S a ic 0.0833 0.0829 0.0053 0.0733 HUPA003 Dynamic 0.0832 0.0838 0.0059 0.0684 HUPA004 S a ic 0.0443 0.0472 0.0081 0.0304 HUPA004 Dynamic 0.0459 0.0493 0.0086 0.0279 HUPA005 S a ic 0.0732 0.0759 0.01 0.0522 HUPA005 Dynamic 0.069 0.0642 0.0085 0.0578 HUPA007 S a ic 0.0559 0.0612 0.0118 0.0324 HUPA007 Dynamic 0.053 0.0566 0.0122 0.0302 HUPA011 S a ic 0.0709 0.0703 0.0103 0.0510 HUPA011 Dynamic 0.0693 0.0694 0.0097 0.0510 HUPA014 S a ic 0.0556 0.0567 0.0086 0.0343 HUPA014 Dynamic 0.0507 0.0517 0.0098 0.0303 HUPA015 S a ic 0.0664 0.0721 0.0134 0.0321 HUPA015 Dynamic 0.0643 0.0679 0.0129 0.0413 HUPA016 S a ic 0.096 0.0976 0.008 0.0739 HUPA016 Dynamic 0.0931 0.0933 0.0098 0.0769 HUPA027 S a ic 0.0776 0.0787 0.0032 0.0694 HUPA027 Dynamic 0.0764 0.0761 0.0034 0.0674 All S a ic 0.0975 0.0984 0.008 0.0820 All Dynamic 0.0945 0.0930 0.0083 0.0791 P11_s a ic P11_dynamic P14_s a ic P14_dynamic P15_s a ic P15_dynamic P16_s a ic P16_dynamic P27_s a ic P27_dynamic All_s a ic All_dynamic 0.04 0.06 0.08 0.10 0.12 Figu e 5.1:Box plo o he i ness +30 49 P11_s a ic P11_dynamic P14_s a ic P14_dynamic P15_s a ic P15_dynamic P16_s a ic P16_dynamic P27_s a ic P27_dynamic All_s a ic All_dynamic 0.04 0.06 0.08 0.10 0.12 Figu e 5.2:Box plo o he i ness +30 Table 5.2:Compa ison o he ecall o he Indi idual and Gene al model o each pa ien in + 30 minu es Pa ien Algo i hm Indi idual Models Gene al Models Recall Hypo Recall No Hypo Recall Hypo Recall No Hypo HUPA001 S a ic 0.9412 0.9504 0.8824 0.9488 HUPA001 Dynamic 1.0 0.9289 0.9412 0.8329 HUPA002 S a ic 0.88 0.9266 0.9511 0.8435 HUPA002 Dynamic 0.8756 0.9169 0.9556 0.8698 HUPA003 S a ic 0.9125 0.9107 0.9250 0.8896 HUPA003 Dynamic 0.9375 0.8935 0.9500 0.9002 HUPA004 S a ic 0.9785 0.966 1.0 0.959 HUPA004 Dynamic 1.0 0.9426 0.9785 0.966 HUPA005 S a ic 0.9706 0.865 0.7353 0.9109 HUPA005 Dynamic 0.9706 0.865 0.7647 0.9298 HUPA007 S a ic 0.9394 0.9513 0.9899 0.9217 HUPA007 Dynamic 0.9394 0.9351 0.9697 0.9255 HUPA011 S a ic 0.9677 0.848 0.9677 0.9263 HUPA011 Dynamic 0.9677 0.9317 0.9677 0.8903 HUPA014 S a ic 1.0 0.9222 0.9787 0.957 HUPA014 Dynamic 0.9574 0.9597 0.9362 0.9689 HUPA015 S a ic 0.9535 0.9392 0.9767 0.9309 HUPA015 Dynamic 0.9535 0.9373 0.9535 0.9244 HUPA016 S a ic 0.9711 0.8906 0.9075 0.903 HUPA016 Dynamic 0.9306 0.8999 0.9480 0.9133 HUPA027 S a ic 0.9510 0.9194 0.9301 0.9044 HUPA027 Dynamic 0.9650 0.8969 0.9161 0.9203 50 Figu e 5.3:A e age ecall o he bes solu ion o all pa ien s in +30 Figu e 5.4:E olu ion o he a e age popula ion i ness in +30 As can be seen in Fig. 5.3 he a e age ecall o bo h classes o all pa ien s is be ween 90% and 95%, and bo h he gene al and indi idual models yield simila esul s on a e age. Indi idually, he only pa ien ha sees a big d op in he Recall alues is HUPA005, whe e using da a om he o he pa ien s does no seem o be e ec i e o he p edic ion. 51 P11_s a ic P11_dynamic P14_s a ic P14_dynamic P15_s a ic P15_dynamic P16_s a ic P16_dynamic P27_s a ic P27_dynamic All_s a ic All_dynamic 0.075 0.100 0.125 0.150 0.175 0.200 0.225 0.250 Figu e 5.10:Box plo o he i ness +90 Table 5.8:Compa ison o he ecall o he Indi idual and Gene al model o each pa ien in + 90 minu es Pa ien Algo i hm Indi idual Models Gene al Models Recall Hypo Recall No Hypo Recall Hypo Recall No Hypo HUPA001 S a ic 0.9375 0.8702 0.8750 0.8494 HUPA001 Dynamic 0.875 0.8309 0.8750 0.7877 HUPA002 S a ic 0.8739 0.6741 0.9009 0.6699 HUPA002 Dynamic 0.8604 0.7337 0.9054 0.6699 HUPA003 S a ic 0.825 0.8508 0.7875 0.7247 HUPA003 Dynamic 0.7875 0.8422 0.8250 0.7113 HUPA004 S a ic 0.8387 0.9353 0.8495 0.8776 HUPA004 Dynamic 0.8495 0.9106 0.9032 0.8341 HUPA005 S a ic 0.7647 0.7669 0.5882 0.7696 HUPA005 Dynamic 0.8235 0.6784 0.5294 0.7660 HUPA007 S a ic 0.8081 0.7969 0.7879 0.7711 HUPA007 Dynamic 0.8687 0.7778 0.8687 0.7366 HUPA011 S a ic 0.9677 0.7211 0.7419 0.8114 HUPA011 Dynamic 0.9032 0.7987 0.6452 0.7861 HUPA014 S a ic 0.8936 0.8431 0.8511 0.8385 HUPA014 Dynamic 0.8723 0.8450 0.7234 0.8523 HUPA015 S a ic 0.9024 0.7011 0.7805 0.7915 HUPA015 Dynamic 0.9268 0.7814 0.7805 0.7934 HUPA016 S a ic 0.8035 0.7772 0.8613 0.6974 HUPA016 Dynamic 0.8555 0.7119 0.7977 0.7161 HUPA027 S a ic 0.8844 0.7865 0.9184 0.7103 HUPA027 Dynamic 0.8980 0.8109 0.9048 0.7093 58 Figu e 5.11:A e age ecall o he bes solu ion o all pa ien s in +90 Figu e 5.12:E olu ion o he a e age popula ion i ness in +90 Fo +90 we can obse e ha once mo e he gene al model has less a e age Recall o bo h classes han he indi idual model, his is mo e no iceable han o +60, bu he di e ence is s ill no s a is ically signi ican . The a e age Recall alues a e be ween 80% and 90% as shown in Fig. 5.11. Lowe han be o e bu a signi ican pe cen age. 59 Compa ison wi h o he Machine Lea ning algo i hms Table 5.9:Compa ison o he a e age Recall o ou algo i hm wi h o he ML algo i hms o +90 Algo i hm Recall Hypo Recall No Hypo G adien boos ing 0.8209 0.8218 G adien boos ing wi h C oss al 0.8036 0.8202 Logis ic Reg ession 0.8260 0.7541 Random o es classi ie 0.9633 0.8544 Random o es Reg eso 0.9562 0.8491 Gaussian Nai e Bayes 0.7924 0.5963 Be noulli Nai e Bayes 0.5857 0.5312 Decision T ee Classi ie (6 dep h) 0.7924 0.8013 Ada Boos Classi ie 0.9186 0.8051 Bagging Classi ie 0.9532 0.8446 Ex a T ees Classi ie 0.9593 0.8807 SGDClassi ie 0.6998 0.8275 MLPClassi ie 0.8769 0.7055 Dynamic SGE 0.8654 0.7928 S a ic SGE 0.8630 0.7930 60 5.2.4 120 Minu es Table 5.10:S a is ics: Mean, Median, S anda d de ia ion and Bes Fi ness o all he models we ha e ained Pa ien Algo i hm Type Mean Median S d. De . Bes Fi ness HUPA001 S a ic 0.0788 0.0737 0.0261 0.0252 HUPA001 Dynamic 0.0774 0.0801 0.0325 0.0125 HUPA002 S a ic 0.2455 0.2446 0.0080 0.2264 HUPA002 Dynamic 0.2416 0.2393 0.0085 0.2274 HUPA003 S a ic 0.1942 0.1956 0.0167 0.1535 HUPA003 Dynamic 0.1925 0.1888 0.0136 0.1646 HUPA004 S a ic 0.1845 0.1841 0.0159 0.1553 HUPA004 Dynamic 0.1882 0.1844 0.0156 0.1541 HUPA005 S a ic 0.2006 0.1974 0.0186 0.1611 HUPA005 Dynamic 0.1972 0.1916 0.0153 0.1588 HUPA007 S a ic 0.2456 0.2535 0.0218 0.1951 HUPA007 Dynamic 0.2339 0.2358 0.0194 0.1875 HUPA011 S a ic 0.1414 0.1363 0.0190 0.1127 HUPA011 Dynamic 0.1374 0.1363 0.0148 0.1102 HUPA014 S a ic 0.1991 0.1938 0.0176 0.1639 HUPA014 Dynamic 0.1967 0.1930 0.0193 0.1632 HUPA015 S a ic 0.2078 0.2070 0.0220 0.1549 HUPA015 Dynamic 0.2021 0.2041 0.0238 0.1542 HUPA016 S a ic 0.2395 0.2378 0.0121 0.2170 HUPA016 Dynamic 0.2424 0.2398 0.0161 0.2160 HUPA027 S a ic 0.2209 0.2219 0.0117 0.2021 HUPA027 Dynamic 0.2206 0.2192 0.0085 0.2072 All S a ic 0.2840 0.2833 0.0100 0.2662 All Dynamic 0.2829 0.2820 0.0072 0.2678 P11_s a ic P11_dynamic P14_s a ic P14_dynamic P15_s a ic P15_dynamic P16_s a ic P16_dynamic P27_s a ic P27_dynamic All_s a ic All_dynamic 0.125 0.150 0.175 0.200 0.225 0.250 0.275 0.300 Figu e 5.13:Box plo o he i ness +120 61 P11_s a ic P11_dynamic P14_s a ic P14_dynamic P15_s a ic P15_dynamic P16_s a ic P16_dynamic P27_s a ic P27_dynamic All_s a ic All_dynamic 0.125 0.150 0.175 0.200 0.225 0.250 0.275 0.300 Figu e 5.14:Box plo o he i ness +120 Table 5.11:Compa ison o he ecall o he Indi idual and Gene al model o each pa ien in + 120 minu es Pa ien Algo i hm Indi idual Models Gene al Models Recall Hypo Recall No Hypo Recall Hypo Recall No Hypo HUPA001 S a ic 0.75 0.749 0.8125 0.6512 HUPA001 Dynamic 0.8125 0.7498 0.7500 0.7057 HUPA002 S a ic 0.8364 0.6893 0.8273 0.6574 HUPA002 Dynamic 0.7955 0.7060 0.8364 0.6630 HUPA003 S a ic 0.7875 0.7907 0.6625 0.6220 HUPA003 Dynamic 0.7625 0.8457 0.6625 0.7059 HUPA004 S a ic 0.8280 0.8196 0.7849 0.8160 HUPA004 Dynamic 0.8602 0.8443 0.7527 0.8408 HUPA005 S a ic 0.7647 0.7167 0.8235 0.5439 HUPA005 Dynamic 0.7059 0.7964 0.6176 0.6742 HUPA007 S a ic 0.7374 0.7553 0.6465 0.8052 HUPA007 Dynamic 0.6566 0.8666 0.6970 0.7850 HUPA011 S a ic 0.8387 0.8083 0.7742 0.7269 HUPA011 Dynamic 0.8710 0.7577 0.7097 0.7568 HUPA014 S a ic 0.8511 0.7711 0.6170 0.7381 HUPA014 Dynamic 0.8511 0.7693 0.6154 0.7426 HUPA015 S a ic 0.8974 0.6384 0.6154 0.7177 HUPA015 Dynamic 0.7949 0.6190 0.3846 0.7196 HUPA016 S a ic 0.7977 0.7095 0.8844 0.5902 HUPA016 Dynamic 0.8439 0.6784 0.7746 0.6992 HUPA027 S a ic 0.8725 0.7125 0.8859 0.6437 HUPA027 Dynamic 0.8188 0.7804 0.8255 0.7257 62 Figu e 5.15:A e age ecall o he bes solu ion o all pa ien s in +120 Figu e 5.16:E olu ion o he a e age popula ion i ness in +30 In +120 is whe e we obse e he algo i hm e u ning he wo s esul s, i is he ha des ime ame o p edic as we don’ ha e any da a o he p e ious 2 hou s. The compa ison be ween he indi idual and gene al model show he bigges di e ence. The a e age Recall ob ained o his p edic ion is be ween 70% and 80% as shown in Fig. 5.15. 63 Compa ison wi h o he Machine Lea ning algo i hms Table 5.12:Compa ison o he a e age Recall o ou algo i hm wi h o he ML algo i hms o +120 Algo i hm Recall Hypo Recall No Hypo G adien boos ing 0.7573 0.7995 G adien boos ing wi h C oss al 0.7390 0.7940 Logis ic Reg ession 0.7889 0.6984 Random o es classi ie 0.9347 0.8575 Random o es Reg eso 0.9317 0.8503 Gaussian Nai e Bayes 0.7624 0.5600 Be noulli Nai e Bayes 0.5857 0.5312 Decision T ee Classi ie (6 dep h) 0.7533 0.7520 Ada Boos Classi ie 0.9133 0.7756 Bagging Classi ie 0.9317 0.8056 Ex a T ees Classi ie 0.9531 0.8811 SGDClassi ie 0.7900 0.5823 MLPClassi ie 0.9255 0.4865 Dynamic SGE 0.7975 0.7648 S a ic SGE 0.8149 0.7418 64 5.2.5 Resul s o 2 classes As can be seen in he BoxPlo s included o +30: Fig. 5.1, Fig, 5.2, +60: Fig. 5.5, Fig. 5.6, +90: Fig. 5.9, Fig. 5.10 and +120: Fig. 5.13, Fig. 5.14, he e seems o be no s a is ical di e ence be ween he pe o mance o he S a ic o o iginal SGE and he Dynamic SGE, howe e he Dynamic SGE ge s sligh ly be e a e age esul s o almos all pa ien s. The ecall esul s o e he es da ase a e also e y simila wi h bo h e sions o he algo i hm, he sligh di e ence be ween bo h shows no s a is ical signi icance. In e ms o he gene al model, we can obse e ha i wo ks ela i ely well o all pa ien s wi h he excep ion o HUPA005, whe e i gi es lowe esul s han i s indi idual model, his end is also seen in HUPA014 and HUPA015 when conside ing bigge p edic ion ho izons ( +90 and +120). Howe e , he esul s ob ained in he o he pa ien s show ha a gene al model can be possible when a speci ic subse o pa ien s is conside ed. In compa ison wi h he o he ML lea ning algo i hms conside ed ou algo i hms do no do as well as some o hem, especially Ada Boos , Bagging Classi ie , Random Fo es , and Ex a T ees Classi ie . All o hem gi e excellen esul s o he ecall, especially in he Hypoglycemia class o all he ime ames conside ed, whe e bo h ou algo i hms s a o lose Recall pe cen age in bigge p edic ion ho izons. The main ad an age o ou algo i hm is ha he inal model is an exp ession ha can be easily unde s ood, s udied, and manually edi ed by an expe a e ob aining i . The esul s ob ained will ha e a s uc u e simila o he ollowing one, wi h di e en cons an s, a iables and ela ional/logical ope a o s: i (((ge Va iable(1,k)<=103.465)||(((ge Va iable(47,k)-(ge Va iable(28,k)* ge Va iable(43,k)/ge Va iable(31,k)))>=(ge Va iable(1,k)/6.184))&& (((3.956/(ge Va iable(21,k)+94.433))*406.226)<=ge Va iable(35,k))))) { esul =0:}else{ esul =1:} Which is equi alen o his exp ession wi h he ac ual names o he a iables: 65 i ((( Glucose( ) <=103.465)||((HR( -20) -(HR( -115) * HR ( -40)/HR( -100)))>=(Glucose( )/6.184))&& (((3.956/(Gluc( -25) +94.433))*406.226)<=HR( -80))))) { esul =0:}else{ esul =1:} 5.2.6 Used a iables The used a iables depend on he solu ion, he ime ame we a e conside ing o he p e- dic ion, and he pa ien , howe e , we can s udy in wide e ms wha a iables a e mos used by he bes solu ions o each un. In he able below 5.13 and in Fig. 5.17 we ha e all he a iables o de ed by hei numbe and wi h he co esponding name o + [30,60,90,120], whe e he o al numbe is he o al amoun o solu ions ob ained, and we only coun one appea ance pe solu ion. Fi s ly, we a e di ing be ween he S a ic o o iginal SGE and he Dynamic SGE. Clea ly, by a , he a iable ha he solu ions use mos is Glucose ( ), his makes sense as is i he mos ecen glucose alue be o e he p edic ion, he o he a iables a , Hea Ra e ( ), Cal ( ), and S eps ( ) a e also used in a highe p opo ion han o he a iables in hei espec i e ypes, al hough he di e ence is much smalle han o he Glucose ( ). In bo h algo i hms, he second and hi d mos used a iables, appea ing in mo e han 30% o he solu ions, a e Hea Ra e ( ) and Calo ies Bu ned ( ) espec i ely. A e his he o de o he a iables changes sligh ly o bo h algo i hms, howe e , he ac ual pe cen ages a e no oo di e en as hey a e all be ween 20% and 30%. The wo less used a iables in bo h algo i hms a e Glucose ( -10) and S eps ( -60) bu in a di e en o de o each one. The glucose alue migh be a esul o duplica ed in o ma ion as we ha e added he newe alues, bu he algo i hms don’ seem o use hem a lo in he solu ions. In gene al, besides he Glucose( ) all he o he a iables a e used be ween 18.7%, 19.7%, and 31%, 33% o each algo i hm. We canno see a big di e ence be ween he a iables used in bo h algo i hms, so we 66 a e doing o choose one, DSGE, and obse e he a iable dis ibu ion o he di e en p edic ion ho izons, Tab. 5.14 and Fig. 5.18. In his case, mo e a ia ion in he a iables use is no iceable, especially o +120 whe e he amoun o ins ances o Glucose ( ) is a lo less han in he o he p edic ion ho izons. None heless, Glucose ( ) is s ill, by a , he mos used a iable, and he es ollow a simila end o wha we explained p e iously. 67 Table 5.17:Recall o he Gene al model o each pa ien Pa ien Algo i hm Recall Hypo Recall L No-Hypo Recall H No-Hypo Recall Hypo + L No-Hypo Recall No-Hypo HUPA001 S a ic 0.0 0.4151 0.6759 0.6250 0.9498 HUPA001 Dynamic 0.3125 0.2453 0.7781 0.5625 0.9012 HUPA002 S a ic 0.6364 0.5054 0.4898 0.9546 0.8306 HUPA002 Dynamic 0.6455 0.4511 0.5289 0.9591 0.8417 HUPA003 S a ic 0.5125 0.4516 0.5578 0.8417 0.8417 HUPA003 Dynamic 0.3250 0.4452 0.5805 0.8000 0.8605 HUPA004 S a ic 0.5591 0.2955 0.7612 0.8279 0.9105 HUPA004 Dynamic 0.6452 0.2500 0.7886 0.7850 0.9017 HUPA005 S a ic 0.4412 0.3786 0.6497 0.6765 0.9052 HUPA005 Dynamic 0.2353 0.5049 0.6966 0.6765 0.9411 HUPA007 S a ic 0.3535 0.6486 0.7014 0.7070 0.8958 HUPA007 Dynamic 0.5354 0.4595 0.7368 0.7071 0.8861 HUPA011 S a ic 0.1613 0.6064 0.6492 0.7742 0.9427 HUPA011 Dynamic 0.3226 0.5000 0.7075 0.7742 0.9032 HUPA014 S a ic 0.4894 0.2368 0.7914 0.6596 0.8952 HUPA014 Dynamic 0.1489 0.2632 0.8143 0.4892 0.9191 HUPA015 S a ic 0.0513 0.4333 0.6358 0.7436 0.9195 HUPA015 Dynamic 0.4103 0.2444 0.6710 0.7180 0.9104 HUPA016 S a ic 0.6763 0.3377 0.6000 0.8902 0.7283 HUPA016 Dynamic 0.5318 0.5390 0.6160 0.8671 0.8740 HUPA027 S a ic 0.6174 0.5444 0.5573 0.9597 0.8853 HUPA027 Dynamic 0.5436 0.7000 0.5823 0.9462 0.9206 74 Figu e 5.21:E olu ion o he a e age popula ion i ness in +120 Figu e 5.22:Boxplo s o he Recall o he bes execu ion in +120 o 3 Clases and 2 Clases 75 Compa ison wi h o he Machine Lea ning algo i hms Table 5.18:Compa ison o he ecall be ween di e en ML algo i hms Algo i hm Recall Low No-Hypo Recall High No-Hypo Recall High No-Hypo Recall Hypo + Low No-Hypo Recall No-Hypo G adien boos ing 0.6676 0.5538 0.6770 0.8718 0.8797 G adien boos ing wi h C oss al 0.6676 0.5538 0.6770 0.8718 0.8797 Logis ic Reg ession 0.6727 0.2313 0.6693 0.8357 0.7979 Random o es classi ie 0.9378 0.8266 0.7371 0.9704 0.8967 Random o es Reg eso 0.8012 0.9535 0.4518 0.9999 0.9936 Gaussian Nai e Bayes 0.7054 0.1965 0.5004 0.8491 0.7097 Be noulli Nai e Bayes 0.5657 0.2943 0.2710 0.7505 0.5121 Decision T ee Classi ie (6 dep h) 0.5076 0.5854 0.5587 0.9194 0.8572 Ada Boos Classi ie 0.8888 0.7703 0.6184 0.9468 0.8451 Bagging Classi ie 0.9296 0.8175 0.7212 0.9596 0.8914 Ex a T ees Classi ie 0.9551 0.8349 0.7615 0.9551 0.9055 SGD Classi ie 0.6564 0.1426 0.7058 0.7746 0.7942 MLP Classi ie 0.7940 0.1393 0.6249 0.8327 0.6859 Dynamic SGE 0.5097 0.4701 0.6926 0.8318 0.8996 S a ic SGE 0.5321 0.4677 0.6512 0.8522 0.8902 76 5.3.2 Resul s o 3 Classes F om his expe imen al example, we don’ eally ob ain much be e esul s han in he case o he 2 classes. The indi idual class Recalls a e much lowe since pe o ming a 3-class classi ica ion is ha de han when we jus ha e 2 classes, he in e media e class is making i ha de o p edic he hypoglycemia s a e, as shown in Tab. 5.16 and Tab. 5.17. In e ms o he columns o "Recall Hypo + L No-Hypo" and "Recall No-Hypo" we can see a sligh imp o emen in compa ison o he Hypoglycemia p edic ion o he 2 classes. Howe e , we a e s ill making an e oneous p edic ion since "Recall Hypo + L No-Hypo" co esponds o he addi ion o he Hypoglycemic alues co ec ly classi ied and inco ec ly classi ied in o he second class, and "Recall No-Hypo" he Non-Hypoglycemic alues o e 90 mg/dl classi ied co ec ly and inco ec ly in o he second class. This compa ison is shown in Fig. 5.22 whe e we can obse e he a e age Recall alues o 3 Classes, conside ing hese p e iously desc ibed columns, and 2 Classes o +120. The a e age Recall o he usion o he classes ises o a alue be ween 80% and 90%. I we compa e ou p edic ion wi h o he ML algo i hms we ob ain simila esul s han o he 2 classes, he ensemble me hods (Ada Boos , Bagging Classi ie , Random Fo es , and Ex a T ees Classi ie ) ob ain be e esul s on he Recall, and ou algo i hms gi e simila esul s o Logis ic Reg ession o G adien Boos ing. The solu ions ob ained ha e his o m: i ((((ge Va iable(35,k)*ge Va iable(61,k)*ge Va iable(58,k)-ge Va iable(31,k ))<=(324.978-ge Va iable(76,k)*96.752))&&((ge Va iable(28,k)+ge Va iable(47,k) -ge Va iable(22,k))>(ge Va iable(73,k)-2.471)))) { esul =0:} else{ i (((ge Va iable(1,k)*ge Va iable(89,k))<805.928-(ge Va iable(89,k)+ ge Va iable(70,k)))){ esul =1:} else{ esul =2:}} 77 Tha wi h he a iables names ansla ed would be: i ((((HR ( -80) * S eps( -75) * S eps( -100) - HR ( -100) )<=(324.978- Cal ( ) *96.752))&&(( HR ( -115) )+ HR( -20) - Gluc ( -25) ) >(S eps ( -15) -2.471)))) { esul =0:} else{ i ((( Gluc( ) * Cal ( -60) )<805.928-( Cal ( -60) +S eps( -30) ))){ esul =1:} else{ esul =2:}} 5.3.3 Used a iables The pe cen age o he a iables being used by bo h algo i hms is s ill e y simila o he wo o hem as can be seen in he able 5.19 and in Fig. 5.23. The alue wi h he highes pe cen age is Glucose ( ) and he o he a iables ha e a used pe cen age o a ound 30% o 40%. The less-used a iable in bo h algo i hms is Glucose ( -20) wi h a pe cen age o 23.6% and 25.7% espec i ely. I we compa e i o he esul s ob ained o +120 o jus wo classes we can see some di e ences in some a iables, such as S eps ( -90) o HR ( -115) ha a e used much mo e o en in he 3 class e sion. I can also be seen ha he a e age o he pe cen ages a e a bi highe in he 3 class solu ions, which is p obably due o he ac ha he solu ions a e much longe han o wo classes so mo e a iables can be used pe solu ion. 78 Table 5.19:Pe cen age o a iable in ol emen in he inal solu ions o all execu ions o 30 uns Va iable Name S a ic +120 Dynamic +120 ge Va iable(1,k) Gluc ( ) 0.8273 0.7939 ge Va iable(6,k) Gluc ( -100) 0.3909 0.4182 ge Va iable(11,k) Gluc ( -75) 0.3455 0.3364 ge Va iable(16,k) Gluc ( -50) 0.2848 0.3242 ge Va iable(21,k) Gluc ( -25) 0.3091 0.2818 ge Va iable(22,k) Gluc ( -20) 0.2364 0.2576 ge Va iable(23,k) Gluc ( -15) 0.3000 0.2576 ge Va iable(24,k) Gluc ( -10) 0.3030 0.3030 ge Va iable(25,k) Gluc ( -5) 0.4364 0.4121 ge Va iable(26,k) HR ( ) 0.3667 0.3758 ge Va iable(28,k) HR ( -115) 0.3939 0.4121 ge Va iable(31,k) HR ( -100) 0.4030 0.3515 ge Va iable(35,k) HR ( -80) 0.3576 0.3303 ge Va iable(39,k) HR ( -60) 0.3152 0.2939 ge Va iable(43,k) HR ( -40) 0.3061 0.2788 ge Va iable(47,k) HR ( -20) 0.3364 0.3000 ge Va iable(51,k) S eps ( ) 0.4212 0.3848 ge Va iable(52,k) S eps ( -120) 0.3485 0.3030 ge Va iable(55,k) S eps ( -105) 0.3424 0.2939 ge Va iable(58,k) S eps ( -90) 0.3364 0.3576 ge Va iable(61,k) S eps ( -75) 0.2667 0.3121 ge Va iable(64,k) S eps ( -60) 0.3818 0.3485 ge Va iable(67,k) S eps ( -45) 0.3242 0.2939 ge Va iable(70,k) S eps ( -30) 0.2727 0.3091 ge Va iable(73,k) S eps ( -15) 0.3576 0.3273 ge Va iable(76,k) Cal ( ) 0.4212 0.3788 ge Va iable(78,k) Cal ( -115) 0.3242 0.3545 ge Va iable(81,k) Cal ( -100) 0.3879 0.3182 ge Va iable(85,k) Cal ( -80) 0.3394 0.2970 ge Va iable(89,k) Cal ( -60) 0.3333 0.3212 ge Va iable(93,k) Cal ( -40) 0.3576 0.3515 ge Va iable(97,k) Cal ( -20) 0.3424 0.3152 79 Figu e 5.23:Va iable dis ibu ion o +120 o SGE and DSGE 5.4 Fu u e Wo k This s udy can be expanded o y o p edic o he s a es, no only hypoglycemia, such as hype glycemia. This would be pe o med by using o he da a elemen s such as ca bohy- d a es, insulin, s ess da a, e c. Addi ionally, di e en class di isions can be made depending on wha each pa ien needs, o example, some pa ien s don’ co ec hei glucose alue un il i d ops o 65 mg/dl, o hey choose o co ec i when i eaches highe alues. The algo i hms de eloped should be es ed on mo e pa ien s o e a longe pe iod o ime, o he p ojec we ha e only included da a o 11 o he 38 pa ien s we cu en ly ha e a ou disposal, in he nea u u e we will make a s udy ha includes all o he pa ien s. We should also s udy wha condi ions can be me o c ea e a gene al model wi h wha ype o pa ien s. In ou s udy we ha e used he da a o all he pa ien s o es all o hem, howe e , i can be seen in he esul s ha some pa ien s wo k be e wi h some da a o e o he s. I we can di ide he da a in o di e en subse s we could p edic o a pa ien ha we don’ ha e da a on, i we choose a subse o o he pa ien ’s da a ha a e simila o he new pa ien . This gene a es a gene al model ha uses da a ha does no belong o a pa ien bu which would 80 yield good esul s because hei da a a ia ion is mo e simila . 5.5 Di usion Conside ing he impac ha he p ojec could ha e, we ha e decided o publish he JECO lib a y and Panc easModelTools on he Gi Hub pla o m, bo h p ojec s a e unde he Adap- i e and Bioinspi ed Sys em G oup. The wo k o de eloping his p ojec has allowed us o c ea e a pape wi h he i le "E ol ing Classi ica ion Rules o P edic ing Hypoglycemia E en s" and accep ed o he 2022 IEEE Wo ld Cong ess on Compu a ional In elligence. 81 Bibliog aphy [1] P edic ing and P e en ing Noc u nal Hypoglycemia in Type 1 Diabe es Using Big Da a Analy ics and Decision Theo e ic Analysis. Diabe es echnology & he apeu ics, 22(11):801–811, no 2020. [2] A hu Be achi, Cla a Viñals, Ly ia Biagi, I an Con e as, Josep Vehí, Ignacio Conge , and Ma ga Giménez. P edic ion o noc u nal hypoglycemia in adul s wi h ype 1 dia- be es unde mul iple daily injec ions using con inuous glucose moni o ing and physical ac i i y moni o . Senso s, 20(6), 2020. [3] U esh Bhowan, Mengjie Zhang, and Ma k Johns on. Gene ic p og amming o clas- si ica ion wi h unbalanced da a. In Anna Isabel Espa cia-Alcáza , Anikó Eká , Sa a Sil a, S ephen Dignum, and A. Şima Uya , edi o s, Gene ic P og amming, pages 1–13, Be lin, Heidelbe g, 2010. Sp inge Be lin Heidelbe g. [4] Mads Bisgaa d Beng sen and Niels Mølle . Mini- e iew: Glucagon esponses in ype 1 diabe es – a ma e o complexi y. Physiological Repo s, 9(16):e15009, 2021. [5] Ca los Ce igón, J. Manuel Velasco, Cla a Bu gos-Simón, Ra ael J. Villanue a, and J. Ignacio Hidalgo. P obabilis ic i ing o glucose models wi h eal-coded gene ic al- go i hms. pages 736–743, 2021. [6] Philip E. C ye , S ephen N. Da is, and Ha y Shamoon. Hypoglycemia in Diabe es . Diabe es Ca e, 26(6):1902–1912, 06 2003. [7] Da pi Da e, Daniel J. DeSal o, Balak ishna Ha idas, Si ipoom McKay, Akhil Shenoy, Ches e J. Koh, Ma k Lawley, and Madha E agun la. Fea u e-based machine lea ning model o eal- ime hypoglycemia p edic ion. Jou nal o Diabe es Science and Technol- ogy, 15(4):842–855, 2021. PMID: 32476492. 82 [8] I anoe De Falco, An onio Della Cioppa, Tomas Kou ny, Michal K cma, Umbe o Sca u i, and E nes o Ta an ino. Gene ic p og amming-based induc ion o a glucose- dynamics model o elemedicine. Jou nal o Ne wo k and Compu e Applica ions, 119:1–13, 2018. [9] Ampa o Güemes, Giacomo Cappon, Be na d He nandez, Monika Reddy, Nick Oli e , Pan elis Geo giou, and Pau He e o. P edic ing quali y o o e nigh glycaemic con ol in ype 1 diabe es using bina y classi ie s. IEEE Jou nal o Biomedical and Heal h In o ma ics, 24(5):1439–1446, 2020. [10] J. Ignacio Hidalgo, J. Manuel Colmena , Gab iel K onbe ge , S ephan M. Winkle , Osca Ga nica, and Juan Lancha es. Da a based p edic ion o blood glucose concen- a ions using e olu iona y me hods. Jou nal o Medical Sys ems, 41, 2017. [11] J. Ignacio Hidalgo, J. Manuel Colmena , José L. Risco-Ma in, Al edo Cues a-In an e, Es he Maqueda, Ma a Bo ella, and José An onio Rubio. Modeling glycemia in humans by means o g amma ical e olu ion. Applied So Compu ing, (20):40–53, 2014. [12] J. Ignacio Hidalgo, J. Manuel Colmena , J. Manuel Velasco, Gab iel K onbe ge , S ephan M. Winkle , Osca Ga nica, and Juan Lancha es. Iden i ica ion o Models o Glucose Blood Values in Diabe ics by G amma ical E olu ion, pages 367–393. Sp inge In e na ional Publishing, Cham, 2018. [13] J. Ignacio Hidalgo, Es he Maqueda, Jose L. Risco-Ma an, Al edo Cues a-In an e, J. Manuel Colmena , and Ja ie Nobel. glucmodel: A moni o ing and modeling sys em o ch onic diseases applied o diabe es. Jou nal o Biomedical In o ma ics, 48:183 – 192, 2014. [14] Jose Ignacio Hidalgo, Jose Manuel Velasco, Juan Lancha es, Se gio Con ado , and Osca Ga nica. An analysis o solu ions based on Gene ic P og amming o sol e p oblems o 83