FINAL DEGREE THESIS
Bachelo ’s Deg ee in Biomedical Enginee ing
MACHINE-LEARNING MODELS FOR OBESE PATIENTS
STRATIFICATION
Repo and Annex
Au ho : Nidà Fa ooq Akh a
Di ec o : Fla io Palmie i
Co-Di ec o : Pau Gama Pé ez
Call: June 2023
Machine lea ning models o obese pa ien s s a i ica ion
3
Resum
L'obesi a és un p oblema mundial en cons an c eixemen que augmen a el isc de malal ies
c òniques i é un impac e signi ica iu en el sis ema sani a i. El ac amen i la p e enció de l'obesi a
són essencials pe edui aques impac e en la salu indi idual i pública. Un ac o de e minan en els
iscos associa s amb l'obesi a és la dis ibució del eixi adipós, ambé conegu com a g eix. Més
especí icamen , el eixi adipós isce al (VAT), que es oba en la ca i a abdominal del cos en ol an
ò gans, s'ha assenyala en di e sos es udis com el g eix que més iscos associa s é.
Aques eball é com a objec iu a alua la quan i a de VAT en dones obeses u ili zan algo i mes
d'ap enen a ge au omà ic supe isa . Es eballa amb una base de dades de pacien s obesos que
con é dades clíniques, esul a s d'analí iques de sang i dades an opomè iques ( elacionades amb les
mesu es co po als). El eball es desen olupa en es pa s: p ep ocessamen de les dades,
classi icació dels pacien s segons la quan i a de VAT i la p edicció de la quan i a de VAT en se i
xa xes neu onals.
Mi jançan aques es asques i l'ús dels di e en s ipus de dades, s'a alua la quali a de les
classi icacions i p ediccions, ob enin in o mació elle an sob e les a iables i el seu impac e en
l'obesi a . Un esul a posi iu en la p edicció i classi icació se ia c ucial, ja que pe me ia la possibili a
de c ea una eina econòmica pe a l'ap oximació inicial dels iscos elaciona s amb l'obesi a ,
especialmen en si uacions on les eines con encionals pe es udia la dis ibució del g eix no són
àcilmen accessibles.
Annexos
4
Resumen
La obesidad es un p oblema mundial en cons an e c ecimien o que aumen a el iesgo de
en e medades c ónicas y iene un impac o signi ica i o en el sis ema sani a io. El a amien o y la
p e ención de la obesidad son esenciales pa a educi es e impac o an o en la salud indi idual como
en los sis emas de salud pública. Un ac o de e minan e en los iesgos asociados con la obesidad es
la dis ibución del ejido adiposo, ambién conocido como g asa. Especí icamen e, el ejido adiposo
isce al (VAT), que se encuen a en la ca idad abdominal en ol iendo ó ganos, ha sido señalado en
a ios es udios como la g asa con más iesgos asociados.
Es e abajo iene como obje i o e alua la can idad de VAT en muje es obesas u ilizando algo i mos
de ap endizaje au omá ico supe isado. Se abaja con una base de da os de pacien es obesos que
con iene da os clínicos, esul ados de análisis de sang e y da os an opomé icos ( elacionados con
las medidas co po ales). El abajo se desa olla en es pa es: p ep ocesamien o de los da os,
clasi icación de los pacien es según la can idad de VAT y la p edicción de la can idad de VAT usando
edes neu onales.
A a és de es as a eas y el uso de los di e en es ipos de da os, se e alúa la calidad de las
clasi icaciones y p edicciones, ob eniendo in o mación ele an e sob e las a iables y su impac o en
la obesidad. Un esul ado posi i o en la p edicción y clasi icación se ía c ucial, ya que pe mi i ía la
posibilidad de c ea una he amien a económica pa a una ap oximación inicial de los iesgos
elacionados con la obesidad, especialmen e en si uaciones donde las he amien as con encionales
pa a es udia la dis ibución de g asa no son ácilmen e accesibles.
Machine lea ning models o obese pa ien s s a i ica ion
5
Abs ac
Obesi y is a g owing wo ldwide p oblem ha inc eases he isk o ch onic diseases, signi ican ly
impac ing heal hca e sys ems. T ea men and p e en ion o obesi y a e essen ial o educe his
impac on indi idual and public heal h. One de e mining ac o in he isks associa ed wi h obesi y is
he dis ibu ion o adipose issue, also known as a . Speci ically, isce al adipose issue (VAT), which
is ound in he abdominal ca i y su ounding o gans, has been iden i ied in se e al s udies as he a
wi h he highes associa ed isks.
This s udy aims o e alua e he amoun o VAT in obese women using supe ised machine lea ning
algo i hms. By using a da abase o obese pa ien s ha includes clinical da a, blood es esul s, and
an h opome ic da a ( ela ed o body measu emen s). The s udy is di ided in o h ee dis inc pa s:
da a p ep ocessing, classi ica ion o pa ien s based on he amoun o VAT, and p edic ion o VAT
quan i y using neu al ne wo ks.
Th ough hese asks and he use o he di e en ypes o da a, he quali y o classi ica ions and
p edic ions is assessed, ob aining ele an in o ma ion abou he a iables and hei impac on
obesi y. A posi i e esul in he classi ica ions and p edic ions would be c ucial as i would allow he
possibili y o de eloping a cos -e ec i e ool o he ini ial assessmen o obesi y- ela ed isks,
pa icula ly in si ua ions whe e con en ional ools o s udying a dis ibu ion a e no easily
accessible.
Annexos
6
Acknowledgemen s
The c ea ion o his p ojec has been a ema kable lea ning expe ience, pa icula ly in he ield o
Machine Lea ning (ML) and i s applica ions in Biomedical Enginee ing.
Fi s and o emos , I would like o ex end my app ecia ion o my supe iso , Fla io Palmie i. Fo
o e ing me he oppo uni y o pa icipa e in his p ojec and o p o iding me wi h all he ools,
knowledge, and guidance h ough hese mon hs.
I would also like o acknowledge my co u o , Pau Gama Pé ez, o p o iding me wi h comp ehensi e
knowledge abou he biological basis o his s udy, and Pablo Miguel Ga cia o his supe ision and
insigh s abou his p ojec .
Fu he mo e, I ex end hanks o he Depa men o Biophysics o Uni e si a de Ba celona in Bell i ge
and Hospi al Clinic o p o iding me wi h access o a da abase which has been he ounda ion o his
hesis.
Las ly, I would like o exp ess my g a i ude o amily and iends o hei uncondi ional suppo
h oughou he comple ion o his hesis.
Machine lea ning models o obese pa ien s s a i ica ion
7
Glossa y
AT: Adipose Tissue
AUC: A ea Unde he Roc Cu e
BMI: Body Mass Index
DEXA: Dual-Ene gy X-Ray Abso p iome y
DF: Da a F ame
DT: Decision T ee
EDA: Explo a o y Da a Analysis
KNN: K-Nea es Neighbou s
LR: Logis ic Reg ession
ML: Machine Lea ning
MRI: Magne ic Resonance Imaging
MSE: Mean Squa ed E o
NB: Naï e Bayes
NN: Neu al Ne wo k
RF: Random Fo es
ROC: Recei e Ope a ing Cha ac e is ic Cu e
SAT: Subcu aneous Adipose Tissue
SVM: Suppo Vec o Machine
VAT: Visce al Adipose Tissue
An h opome ic da a: Da a ha o igins om non-in asi e measu emen s ela ed o he dimensions,
size, and p opo ions o he human body.
Hype pa ame e Tuning: P ocess o inding he op imal se o hype pa ame e s o a machine
lea ning model.
Annexos
8
Machine lea ning models o obese pa ien s s a i ica ion
9
Index
RESUM _____________________________________________________________ 3
RESUMEN __________________________________________________________ 4
ABSTRACT __________________________________________________________ 5
ACKNOWLEDGEMENTS ________________________________________________ 6
GLOSSARY __________________________________________________________ 7
1. INTRODUCTION ________________________________________________ 14
1.1. O igin o he s udy ................................................................................................. 14
1.2. Mo i a ion .............................................................................................................. 15
1.3. Objec i e and scope ............................................................................................... 15
2. THEORETICAL FRAMEWORK ______________________________________ 16
2.1. Obesi y ................................................................................................................... 16
2.1.1. Complica ions ....................................................................................................... 16
2.1.2. Obesi y ea men ................................................................................................ 17
2.2. Adipose Tissue ........................................................................................................ 17
2.2.1. Dis ibu ion and unc ionali y .............................................................................. 17
2.2.2. VAT and obesi y .................................................................................................... 18
2.3. Quan i ica ion o Visce al Adipose Tissue ............................................................. 18
2.3.1. Magne ic Imaging Resonance .............................................................................. 18
2.3.2. Dual-ene gy X- ay Abso p iome y ...................................................................... 19
3. MACHINE LEARNING ____________________________________________ 20
3.1. Py hon .................................................................................................................... 20
3.2. P e-p ocessing ........................................................................................................ 20
3.2.1. Explo a o y da a analysis ..................................................................................... 21
3.2.2. Da a impu a ion.................................................................................................... 22
Annexos
16
2. Theo e ical amewo k
2.1. Obesi y
Acco ding o he Wo ld Heal h O ganiza ion, obesi y is de ined as a complex condi ion ha is
cha ac e ized by an excessi e body a (adipose issue) accumula ion ha poses a h ea o one’s
heal h. Obesi y is commonly diagnosed when ha ing a Body Mass Index (BMI), which akes in o
accoun body weigh and heigh , o e 30kg/m2 [4].
The p e alence o obesi y a ises om a combina ion o di e en ac o s, such as en i onmen al,
gene ic and li es yle. When ene gy in ake su passes ene gy expendi u e he imbalance esul s in
excess s o age o he emaining unused calo ies in he o m o adipose issue.
This condi ion was once conside ed only a high-income coun y p oblem [5]. Ne e heless, i has
inc eased globally in he las decades, eaching epidemic-like magni udes. In some a eas like No h
Ame ica, one- hi d o he popula ion has been epo ed obese [4]. Mo eo e , in ecen yea s o e 4
million people a e epo ed each yea o die as a esul o being o e weigh o obese [6].
The si ua ion in Spain is a om di e en . As o 2020, 16.5% o adul men and 15.5% o adul women
su e ed om obesi y [7]. Se e al in es iga ions sugges hese numbe s won’ imp o e, as i is
expec ed ha he e will be an inc ease in obesi y i he cu en ends con inue [8][9].
While BMI is a commonly used measu e o assess obesi y, i may no p o ide a comp ehensi e
unde s anding o he heal h isks associa ed wi h i . In his con ex , a body composi ion analysis
eme ges as a mo e sui able indica o [10].
2.1.1. Complica ions
Obesi y alone poses a signi ican h ea o public heal h as i no only inc eases he isk o nume ous
ch onic condi ions such as ype 2 diabe es, ca dio ascula diseases, a y li e disease, hype ension,
ce ain ypes o cance s, espi a o y p oblems, and men al heal h issues bu also con ibu es o a
wide a ay o o he condi ions. Consequen ly, indi iduals a ec ed by obesi y expe ience a decline in
bo h quali y o li e and li e expec ancy.
Fu he mo e, he implica ions o obesi y ex end beyond pe sonal heal h. On one hand, he g owing
numbe o obese indi iduals di ec ly impac s he cos s incu ed by heal hca e sys ems, placing a
subs an ial bu den on esou ces. On he o he hand, obesi y has been associa ed wi h
unemploymen and educed socio-economic p oduc i i y, c ea ing addi ional economic challenges
[11]. Bo h si ua ions con ibu e o an o e all economic bu den.
Conside ing he escala ing p e alence o obesi y and he complex complica ions i en ails; i is
e iden ha his condi ion poses a signi ican h ea o public heal h [12].
Machine lea ning models o obese pa ien s s a i ica ion
17
2.1.2. Obesi y ea men
Due o he complica ions o obesi y, add essing i becomes a necessi y. The e is no one uni e sal
way o ea obesi y, as he e ec i eness o obesi y ea men a ies om pe son o pe son due o
indi idual ac o s such as gene ics, me abolism, li es yle, and unde lying heal h condi ions.
The e a e se e al app oaches o ea ing obesi y, wi h li es yle changes being he p ima y me hod.
This in ol es egula ing one's die and ea ing habi s and inc easing physical ac i i y. Howe e , i hese
li es yle changes a e no success ul o canno be e ec i ely implemen ed, o he op ions such as
medica ion may be conside ed. In ex eme cases, medical in e en ions can be pe o med o add ess
i .
Medical in e en ions o ea obesi y in ol e making changes o he diges i e sys em o aid he
weigh loss p ocess and imp o e he o e all excess o adipose issue. These su ge ies a e called
ba ia ic su ge ies. The e a e di e en a ie ies o ba ia ic su ge y, such as gas ic bypass, slee e
gas ec omy, gas ic banding, o gas ic balloon o name some o he mo e popula p ocedu es. All o
he abo e use di e en mechanisms o educe, o modi y in some way, he s omach o he in es ines
[13].
2.2. Adipose Tissue
Adipose issue o AT is one o he body’s la ges endoc ine o gans and an ac i e issue o cellula
eac ions and me abolic homeos asis. The dys unc ionali y o adipose issue is o en associa ed wi h
pa hologies such as diabe es, obesi y, ca dio ascula disease, and dyslipidemia o name a ew [14].
2.2.1. Dis ibu ion and unc ionali y
Adipose issue (AT) is a specialized connec i e issue ha mainly consis s o cells called adipocy es,
which a e ich in lipids, howe e , i is impo an o conside he di e si y in cellula componen s o
adipose issue, pa icula ly in he con ex o obesi y. AT cons i u es a ound 20-25% o he o al body
weigh in heal hy indi iduals. The p ima y unc ion o adipose issue is o s o e ene gy in he o m o
lipids.
Adipose issue dis ibu ion is impo an because i can ha e p o ound implica ions o bo h heal h
and he de elopmen o diseases. The wo main ypes o adipose issue dis ibu ion a e
subcu aneous adipose issue (SAT) and isce al adipose issue (VAT). SAT e e s o a loca ed di ec ly
benea h he skin, while VAT e e s o a loca ed a ound he o gans in he abdominal ca i y. Bo h SAT
and VAT ha e di e en oles. On he one hand, SAT se es o main ain body empe a u e, s o e
ene gy and cushion o gans, while on he o he , VAT is loca ed deep wi hin he body, and i eleases
a ious bioac i e subs ances.
The AT dis ibu ion, ega ding sex, di e s be ween men and women, on one hand, women ha e a
highe p opo ion o SAT whe eas men ha e a highe pe cen age o VAT [15].
Adipose issue, including VAT, is no only an ine a s o age depo bu also has an impo an ole in
endoc ine unc ions as i sec e es cy okines and ho mones ha in luence me abolism, and
in lamma ion and play an impo an ole in physiological homeos asis.
Annexos
18
2.2.2. VAT and obesi y
Su ely o desc ibe obesi y as an inc ease in adipose issue mass is an o e simpli ica ion. The obesi y-
associa ed mo bidi y and mo ali y in humans is associa ed wi h a accumula ion and o he ac o s
such as sex, gene ics, en i onmen , and he di e en ypes o adipose issue. The a ia ion in a
dis ibu ion is a po en ial explana ion o he ca diome abolic isk di e ences be ween Indi iduals
wi h he same BMI. Tha being he case, VAT is an in e es ing a depo conce ning he he e ogenei y
in obesi y and has a signi ican ole in me abolic isk.
Many s udies ha e di e en ia ed he isks associa ed wi h obesi y, and he e o e adipose issue, wi h
he amoun o VAT, as people wi h he same BMI ha e been shown o ha e a highe isk o
complica ions i hey possess mo e VAT mass. This concep o a iabili y be ween obese subjec s is
u he explained in he 2005 s udy done by Haslam & James o assess ea men o obesi y and he
need o ocus on he ema kable he e ogenei y ound in me abolic isk be ween indi iduals o
di e en body mass index, as some pa ien s wi h highe BMI bu lowe VAT mass show less isk han
pa ien s wi h lowe BMI bu highe VAT mass [16].
Mo eo e , a s udy done in he UK wi h he da a o o e 40.000 pa icipan s demons a ed ha a
deep lea ning app oach based on wo-dimensional MRI p ojec ions was adequa e o p edic and
quan i y VAT, SAT, and GFAT (Glu eo emo al Adipose Tissue) olumes a scale and sugges ed ha
VAT was linked o an inc eased isk o ype 2 diabe es and co ona y a e y disease, in con as wi h
he SAT and GFAT which we e mos ly neu al in he ma e [12].
The e o e, unde s anding he dis ibu ion o AT holds signi ican impo ance as i o e s aluable
in o ma ion abou an indi idual's o e all heal h and disease isk. Speci ically, e alua ing he
dis ibu ion and quan i y o VAT enables heal hca e p o essionals o iden i y indi iduals who may
ace inc eased isks o obesi y- ela ed complica ions. Thus, quan i ying VAT se es as a g ea
indica o o assess he po en ial isks associa ed wi h obesi y.
2.3. Quan i ica ion o Visce al Adipose Tissue
2.3.1. Magne ic Imaging Resonance
MRI is a non-in asi e c oss-sec ional omog aphic imaging me hod ha accu a ely assesses body a
dis ibu ion and composi ion as i can gene a e de ailed and segmen ed images o in e nal body
s uc u es.
Nowadays, MRI is he gold s anda d o VAT quan i ica ion, as i has been p o en o p o ide accu a e
quan i ica ion consis en ly and e icien ly [17]. The main easons o MRI o be he gold S anda d a e:
- The high accu acy wi h which i p o ides measu emen s o VAT as i o e s so issue
con as ha allows o di e en ia ion be ween all ypes o issue, VAT included.
- MRI p o ides imaging in co onal, axial and sagi al planes, which allows o a b oad
e alua ion o VAT dis ibu ion in he body.
- I has been alida ed nume ous imes h ough clinical analysis and esea ch s udies [18].
Machine lea ning models o obese pa ien s s a i ica ion
19
2.3.2. Dual-ene gy X- ay Abso p iome y
Nowadays, DEXA o Dual-ene gy X- ay abso p iome y is inc easingly being used in he heal hca e
sec o o quan i y a due o i s mino p epa a ion, ela i e simplici y, and inexpensi eness compa ed
o o he imaging me hods [19].
Dual-ene gy X- ay abso p iome y is an imaging echnique ha uses 2-dimensional p ojec ion da a
c ea ed by low-dose X- ays o c ea e a model ha can be used o di e en ia e be ween a , bone,
and lean issue; i is used o measu e body composi ion.
Mo e speci ically, i can be used o es ima e he quan i y o AT compa men s in di e en egions o
he human body. Also, by analysing he di e en ial abso p ion o X- ays by di e en issues, DEXA
scans can p o ide es ima es o an h opome ic measu es.
Despi e he con enience o DEXA, he gold s anda d o quan i y a depo s is magne ic esonance
imaging o MRI, as men ioned in he p e ious sec ion. Howe e , he speci ic use o DEXA and MRI o
VAT measu emen has been shown o be highly co ela ed as s a ed in ecen s udies [19].
The choice be ween DEXA and MRI depends on he speci ic use he da a ob ained om hese
echniques is going o ake. Fo la ge-scale s udies ha may equi e cos -e ec i e assessmen s o
VAT, DEXA is a p e e able op ion.
Annexos
20
3. Machine Lea ning
Machine lea ning is a b anch o A i icial In elligence ha cen es a ound he use o da a and
algo i hms o imi a e he human way o lea ning, p og essi ely imp o ing accu acy. The e a e wo
main ypes o machine lea ning depending on whe he he alue (o alues) o be p edic ed a e
a ailable o no ; i is supe ised ML i he expec ed ou pu o he ML models is known, and i he
expec ed ou pu is unknown hen i is unsupe ised ML.
Supe ised ML algo i hms a e buil using sample da a, known as he aining se and hen he
accu acy is es ed using a es ing da a se [20]. These models can be used o make p edic ions,
classi ica ions, o decisions wi h hei co esponding accu acies and o he me ics hanks o he ain-
es da a di ision. A common way o di ide he se s is o apply an 80-20 p opo ion o he ain- es
spli as shown in Figu e 3.1. [21]
Figu e 3.1. T aining and es ing se p opo ions isualisa ion. (Sou ce: Own elabo a ion)
Usually, he alues o be p edic ed a e called a ge da a, and he a iables ha a e used o p edic
and classi y can be named ea u es.
In he p o ided da abase he expec ed ou pu da a is a ailable so supe ised ML algo i hms will be
applied and, in his sec ion, he s eps ollowed o apply ML o da a classi ica ions and p edic ions will
be explained.
3.1. Py hon
The p og amming language chosen o compu e and c ea e Machine Lea ning algo i hms in his
p ojec is Py hon. Py hon is an in e p e ed and high-le el p og amming language ha is easily
a ailable and has easy- o-lea n syn ax. Mo eo e , i has al eady mul iple buil -in lib a ies ha come
in handy wi h ML p og amming. Some o hese lib a ies will be u he explained la e in he hesis.
3.2. P e-p ocessing
The i s s ep o any ML p ojec is he p e-p ocessing o he da a, i.e., p ope cleaning o da a, which
means ha ing a cohe en da abase wi hou any missing da a, wi h only meaning ul a iables,
s anda dized alues, and o he a ious s eps depending on he o ma and o igin o he da abase.
In his subsec ion, some o he common p e-p ocessing p ac ices will be men ioned.
T aining se 80%
Tes ing se 20%
Machine lea ning models o obese pa ien s s a i ica ion
21
3.2.1. Explo a o y da a analysis
One o he ini ial s eps o he p e-p ocessing is he explo a o y da a analysis o EDA. This analysis
in ol es he examina ion and p ope unde s anding o he da ase , including he cha ac e is ics and
in ica e ela ions be ween da a a iables. Also helps iden i ying missing alues o ou lie alues [22].
Some common asks done du ing EDA a e ge ing o know which kind o a iables a e he e in he
da abase, as well as he shape o such da abase. Da a can be classi ied in wo main g oups,
quali a i e and quan i a i e da a, as can be seen in Figu e 3.2:
- Quan i a i e da a: This da a e e s o nume ical da a, and can be u he classi ied in o wo
g oups:
o Con inuous: includes decimals, ypically comes om measu emen s, e.g., heigh .
o Disc e e: In ege s and coun able numbe s, e.g., nº o siblings.
- Quali a i e da a: Non-nume ical da a, ypically comes om obse a ions.
o Nominal: Values wi hou a speci ic o de , e.g., eye colou .
o O dinal: Values wi h a na u al o de ing, e.g., clo hing size.
Figu e 3.2. Types o da a (Sou ce: Own elabo a ion)
An explo a o y analysis usually o e s da a isualiza ion o p ope ly comp ehend he dis ibu ion and
p ope ies o he a iables in he da ase , his includes all ypes o isual ep esen a ions such as
sca e plo s, his og ams, boxplo s, e c.
Fu he mo e, o assess he pos e io ea u e selec ion, a hea plo can be p o ided o be e
unde s and he associa ion be ween a iables.
O e all, EDA o e s an ini ial unde s anding o he da ase o be wo ked wi h, i helps de ec po en ial
issues and isualise pa e ns, and he e o e, is a key ool o decision making.
Types o
da a
Quali a i e
Nominal O dinal
Quan i a i e
Con inuous Disc e e
Annexos
22
3.2.2. Da a impu a ion
Ano he s ep is he ea men o missing da a. I a aw da ase has missing alues o da a, da a
impu a ion is pe o med. Missing alues can happen o many easons, ei he om una ailabili y o a
speci ic alue, human e o , e c. Handling missing alues is an impo an pa o he p e-p ocessing
because many o he ML algo i hms equi e a comple e da ase o accu a ely unc ion.
Da a impu a ion wo ks by illing he missing alues based on he exis ing ones, which can be done in
mul iple ways as he e is no one p ope me hod o do i . Some o he mos common impu a ion
me hods a e he ollowing:
• Mean, mode o median alue impu a ion, in which he missing alues a e eplaced wi h one
o hese measu es o he a iable wi h missing da a.
• Reg ession impu a ion, in which a eg ession model is used o calcula e and p edic he
missing alues based on he exis ing ones. [23]
• K-nea es neighbou s, in which he missing alue is eplaced wi h he a e age alue o i s k-
nea es neighbou s, aking in o conside a ion he exis ing da a’s dis ance be ween samples.
K is a hype pa ame e o be manually chosen. [23]
• Ho deck impu a ion, in which a andomly selec ed alue is chosen om ano he simila
eco d wi hou missing da a. This echnique main ains he dis ibu ional cha ac e is ics o
he da ase . [23].
3.2.3. Ou lie da a emo al
Some imes DF can ha e ou lie alues, which a e da a poin s o obse a ions ha signi ican ly
de ia e om mos o he da a poin s in a da ase .
The de ec ion and emo al o hese abno mal alues is an impo an s ep in ML as hey can
nega i ely impac he ML model’s pe o mance and accu acy by in oducing noise. They can be a
sou ce o dis o ion o he da a; howe e , ou lie s can also p o ide aluable insigh s in o unique
alues o biological impo ance. By handling ou lie s app op ia ely, da a quali y and eliabili y can be
imp o ed, leading o mo e eliable models. All in all, he de ec ion and emo al o some ou lie
alues is good o enhance he model’s pe o mance, bu he o igin o he da a mus be aken in o
conside a ion, especially in he case o medical da a. [24]
3.2.4. Da a s anda disa ion
S anda dizing he da a is an impo an s ep because da abases can ha e a iables o di e en o igins
and measu emen s, which means ha each a iable migh ha e a di e en scale om he es . Fo
ha eason, i is some imes necessa y o apply da a no maliza ion o s anda diza ion o size all he
elemen s in a da ase o he same scale o p ope ly compa e hem. No e ha no all da ase s need
s anda diza ion, as all he a iables om a speci ic da ase could be om he same measu emen ,
ha is why i is necessa y o s udy he a iables be o ehand o p ope ly de e mine he need o
no maliza ion. Mo eo e , p edic ion and classi ica ion models equi e all da a o be in a common
scale o unc ion co ec ly. [25]
Machine lea ning models o obese pa ien s s a i ica ion
23
The s anda disa ion o da a should be applied o non-ca ego ical da a, as bina y and ca ego ical
alues migh lose meaning by s anda diza ion.
All in all, he scaling o da a helps wi h he in e p e abili y and he applica ion o some ML algo i hms.
3.2.5. Fea u e selec ion
Fea u e selec ion e e s o choosing he subse o he mos ele an ea u es om a da ase , his s ep
imp o es he pe o mance o ML models as non-impo an da a delays o obs acles he unc ionali y
o such algo i hms.
Fea u e selec ion should be done conside ing bo h he ma hema ical associa ion o a a iable wi h
he a ge and he knowledge on he a iables and hei meaning ega ding he ou pu in he speci ic
da a’s domain o ield, o his p ojec , a p ope unde s anding o VAT and he ela ion be ween each
ea u e is necessa y.
The main echniques used o his p ojec a e knowledge d i en ea u e selec ion, Spea man
co ela ion coe icien be ween he a ge alues and he ea u es, and C ame ’s V o he ew
ca ego ical a iables:
• Co ela ion coe icien : Co ela ion coe icien s measu e he co a iance be ween a iables o
de e mine he s eng h o hei ela ionship, his measu e as i is s anda dized, a ies om -1
o 1, -1 being s ong nega i e co ela ion, 0 being no co ela ion a all and 1 being s ong
posi i e co ela ion.
• C ame ’s V: This algo i hm measu es he s eng h o associa ion be ween ca ego ical
a iables, i is an ex ension o he chi-squa e es , and he measu e goes om 0 o 1, 0 being
no associa ion a all, and 1 being high associa ion. [26]
To sum i up, ea u e selec ion plays a c ucial ole in ML as i educes he compu a ional complexi y
o models and he e o e imp o es he e iciency. I helps iden i ying he mos in o ma i e ea u es in
a da ase , allowing o a mo e ocused analysis. By unde s anding which ea u es ha e he g ea es
in luence on he ou pu , i becomes easie o comp ehend he ela ionship be ween inpu and
ou pu , and in he speci ic case o his p ojec , i is o in e es o unde s and which inpu a iables a e
mo e ele an in he p edic ion and classi ica ion o VAT. [27]
3.2.6. Label da a encoding
Fo he success ul applica ion o a classi ica ion model, he label da a mus be in a ca ego ical o ma
a he han con inuous. This means ha he da a should be o ganized in o dis inc ca ego ies o
classes, allowing he model o classi y new ins ances accu a ely. Con inuous da a, on he o he hand,
ep esen s a ange o alues and may no be sui able o classi ica ion asks.
T ans o ming con inuous label a iables in o ca ego ical ones simply implies di iding he da a in o
dis inc g oups o in e als o said con inuous alues. Fo example, VAT mass can be di ided in o
h ee g oups: one con aining low VAT mass, ano he medium VAT mass and he hi d one con aining
high VAT mass.
Annexos
24
Howe e , o ca ego ical a iables o be used e ec i ely in ML algo i hms, hey need o be encoded
in a nume ical o ma . This ans o ma ion is necessa y as mos ML algo i hms ope a e on nume ical
da a. By encoding ca ego ical a iables in o nume ical alues, he algo i hms can p ocess and analyse
he da a accu a ely. When he o de o he label da a mus be p ese ed, i is impo an o assign
app op ia e nume ical alues o a oid losing aluable o dinal in o ma ion. Con inuing wi h he
p e ious example, each g oup should be encoded main aining he na u al o de , one way o do i
would be assigning he alues o 0, 1 and 2 o each g oup espec i ely.
All in all, he ca ego iza ion o da a is an impo an p e-p ocessing s ep o con e ca ego ical
a iables in o a sui able o ma o ML classi ica ion algo i hms. I in ol es encoding and handling
o dinal a iables, as his ensu es ha he ca ego ical da a can be e ec i ely u ilized in he ollowing
modelling s ages.
Machine lea ning models o obese pa ien s s a i ica ion
25
3.3. Classi ica ion
3.3.1. Classi ica ion models
In his sec ion, an o e iew o he classi ica ion models applied in he ML p ocess will be done.
3.3.1.1. Suppo Vec o Machine
The suppo Vec o Machine algo i hm inds an op imal hype plane ha p ope ly sepa a es classes in
a high-dimensional ea u e space. The main objec i e o SVM is o ind he hype plane ha
maximizes he ma gin, which ep esen s he egion o maximum sepa a ion be ween classes.[29]
A isual ep esen a ion o he SVM mechanism is shown in Figu e 3.3.
Figu e 3.3. Suppo Vec o Machine ep esen a ion (Sou ce: [28])
3.3.1.2. Logis ic Reg ession
Logis ic eg ession algo i hms de e mine he p obabili y o he label da a belonging o a ce ain class
by assessing he ela ionship o he label da a wi h he ea u es.
The p obabili y o a da a poin belonging o a class is es ima ed by using a logis ic unc ion, also
known as a sigmoid unc ion. The logis ic unc ion ans o ms he inpu in o a alue be ween 0 and 1,
which ep esen s he p obabili y o he da a belonging o he posi i e class being es ed (0 being less
p obable and 1 being highly p obable). This me hod can be also applied o mul iclass classi ica ion
a he han only bina y classi ica ion by using a ious me hods, such as he one- s- es app oach,
whe e an indi idual logis ic eg ession model is ained o each class and he model wi h he highes
p obabili y is selec ed as he p edic ed class.
3.3.1.3. K-nea es neighbou s
K-nea es neighbou s classi ie o KNN, is a simple algo i hm ha s o es all he possible a iables and
classi ies hem by hei measu e o simila i y. The nea es neighbou s a e de e mined by calcula ing
he dis ance be ween he obse a ion o be p edic ed and each obse a ion in he aining da ase .
The numbe o neighbou s o conside is k, as i can a ia e depending on he classi ica ion and he
dis ance can be compu ed using a ious me hods such as Euclidean, Manha an, Minkowski, e c. [30]
Annexos
32
4.2. P e-p ocessing
The i s s ep o he p e-p ocessing is impo ing he necessa y Py hon lib a ies, he e’s a summa y o
he lib a ies used:
- Pandas
- NumPy
- Seabo n
- Ma plo lib
- Sciki -lea n
- Dy hon
4.2.1. Impu a ion and cleaning o da a.
The nex s ep is iden i ying and co ec ing any missing da a in he da a ame as well as he emo al
o edundan o unnecessa y da a.
The de ec ion o null da a in he da a ame consis s o a simple Py hon loop, in which a iables ha
ha e missing da a (Nan) and how many he e a e, can be ob ained, as shown in Figu e 4.2.
Figu e 4.2. Missing da a summa y (Sou ce: Own elabo a ion)
I can be seen see how one o he a iables, “AñosHTA”, has 109 missing alues, which means mo e
han hal o he pa ien ’s da a is null, ha being he case he column is o be dele ed. The es o he
a iables ha e a ela i ely low amoun o Nan alues so impu a ion echniques can be applied.
Apa om dele ing “AñosHTA”, he ID- ela ed columns, "Base_o igen" and "NHC", do no p o ide
meaning ul in o ma ion o he ML echniques and will also be dele ed. Once his da a is handled a
169x164 da a ame is le .
Be o e inally impu ing da a, he only non-nume ical a iable o he DF (apa om he ID ones) mus
be encoded. I mus be conside ed ha his DF comes om a hospi al and some a iables ha e been
manually w i en, ha is he case o he “EnolUBEsem” a iable, which indica es he alcohol
consump ion o he pa ien . The da a encoding has ollowed he nex ules, as indica ed in he main
code shown in Figu e 4.3.
Machine lea ning models o obese pa ien s s a i ica ion
33
Figu e 4.3. O dinal da a encoding o he “EnolUBEsem” a iable (Sou ce: Own elabo a ion)
Once all he DF has nume ical alues, missing da a is impu ed using a KNN impu e om he Sciki -
lea n lib a y and a simple loop o i e a e o e he missing o Nan alues. The esul is a DF wi hou
any missing da a.
The subsequen s age is handling excess edundan da a. The an h opome ic da a in he DF comes
om a DEXA scan, which es ima es an h opome ic alues h ough calcula ions o di e en ial
abso p ion o X- ays by di e en issues in he body. I 's impo an o no e ha he scan cap u es
da a om bo h he igh and le sides o he body. As a esul , he e is edundan da a in he DF, as
o each a iable, he e is da a om he igh side, he le side, he o al alue (which is he sum o
le and igh -side da a), and he di e en ial alue (which is he di e ence be ween le and igh side
da a). An example o his is he nex a iables om he DF:
- “B azosMO_g”: To al bone mass o he a ms in g ams
- “B azosDcho_MO_g”: Bone mass o he igh a m in g ams
- “B azosIzq_MO_g”: Bone mass o he le a m in g ams
- “A msDi _MO_g”: Di e ence in bone mass be ween bo h a ms in g ams
To sol e his issue o su plus o in o ma ion, he co ela ion coe icien be ween hese measu emen s
and he a ge da a has been compu ed, o decide whe he o elimina e some o hese columns o
no . A simila co ela ion be ween he a ge da a and each o hese a iables would mean ha no
signi ican in o ma ion would be los when emo ing excess a iables. An example o he co ela ion
esul s is shown in Figu e 4.4.
Figu e 4.4. Co ela ion coe icien s be ween es ima ions o he same a iable in di e en egions o he body,
“le ” and “ igh ”, he sum o “ igh ” and “le ” sides (main) and he di e ence be ween hem “di ” (Sou ce:
Own elabo a ion )
I is clea ha he co ela ion coe icien s a e highly analogous be ween measu emen s, which is why
i has been decided o only main ain he o al o “main” alue, which is he sum o he igh and le
side es ima es o a a iable. Wi h he emo al o a iables con aining es ima es o a a iable om he
igh and le side and he di e ence be ween sides, a 169x75 DF is le , which means 89 columns
ha e been emo ed.
Annexos
34
Finally, i is necessa y o emo e he male pa ien s as he VAT dis ibu ion be ween men and women
a ies signi ican ly, and 13 men a e no enough da a o apply ML models o o c ea e syn he ic da a.
A e he emo al o male pa ien s, he a iable “sexo” ha indica es he sex o he pa ien becomes
unnecessa y, as all he da a is om he same sex. The esul is a DF o 156 emale pa ien s and 75
a iables (156x75).
4.2.2. Handling ou lie alues
The de ec ion o ou lie alues has been a combina ion o non-au oma ed and au oma ed asks:
Non-au oma ed ou lie handling
Each ex eme alue has been ca e ully conside ed aking in o accoun he human o igin o he da a.
Only alues conside ed “impossible” should be ea ed. An example o an “impossible” alue would
be a nega i e weigh .
The p ocess o de ec ou lie alues has been he ollowing:
- Re iewing he maximum and minimum alues o each a iable
- I a maximum o minimum is abno mal, u he in es iga e he es o he a iable and asses
he possibili y o he abno mal alues.
- I a alue is conside ed “impossible” e iew he es o he in o ma ion o he pa ien wi h an
anomaly. I he es o he alues a e co ec , ans o m he anomaly in o a null alue.
- Impu e he null alue.
The me hod o ea hese ou lie s would be o impu e ins ead o elimina ing he pa ien s wi h such
alues, o a oid he loss o in o ma ion. No ob ious ou lie s ha e been de ec ed in his manne .
Au oma ed ou lie de ec ion
To a oid ex eme alues ha nega i ely a ec he subsequen ML models, he Isola ion Fo es [42]
algo i hm om Sciki -Lea n has been used. Isola ion Fo es isola es anomalies using an ensemble o
decision ees.
This me hod has been chosen h ough a sys ema ic app oach, wi h an i e a i e p ocess o
expe imen a ion and e alua ion, he explo a ion o di e en combina ions o ou lie emo al
algo i hms (as well as no emo ing any a all) ha e been es ed and he ou lie handling echnique
ha has p o en o be mos e ec i e, in e ms o he pe o mance in he subsequen ML algo i hms,
has been chosen.
4.2.3. S anda disa ion o da a
As p e iously seen, he DF has da a om di e se o igins, and he e o e di e en scales, which
indica es he necessi y o s anda dising he da a o he same scale o in e p e abili y easons.
A min-max scale is applied o all he alues apa om he ca ego ical o bina y a iables: “Fuma”,
“EnolUBEsem”, “DM2” and “HTA”. The esul is all he con inuous a iables ha ing alues in he
ange o 0 o 1.
Machine lea ning models o obese pa ien s s a i ica ion
35
4.2.4. Explo a o y Da a Analysis
Pa o he explo a o y analysis is men ioned in 5.1. Da abase desc ip ion sec ion. The i s pa o he
EDA consis s o he desc ip ion o he aw da abase and he ypes o a iables i con ains. Mo eo e ,
a de ailed examina ion o he a iables is ecommended. Once a basic comp ehension o he DF is
gained, a isual explo a o y analysis is done.
Th ee kinds o isual ep esen a ions ha e been made, wi h each a iable and he a ge alue:
Sca e plo s
Figu e 4.5. Compila ion o all he sca e plo s o he a iables s. a ge da a (“Masa_VAT_g”) (Sou ce: Own
elabo a ion)
Annexos
36
As seen in igu e 4.5, mos o he a iables show high dispe sion o alues, none heless, some o
hem ha e an obse able linea beha iou .
Fo ha eason, i is o in e es o look in o he co ela ion ma ix and coe icien s o he a iables
wi h he label da a. To isualize he co ela ion coe icien s hea maps can be used.
Hea maps:
Hea maps a e g aphical ep esen a ions o isualise da a in a ma ix o ma using colou -coded cells,
ha in his case, ep esen he alue o he co ela ion coe icien .
The hea maps ha e been di ided in o subg oups o be e in e p e abili y. An example o a hea map
compu ed wi h he seabo n lib a y [43] can be seen in Figu e 4.6, he ows o in e es a e he las wo
ones, as hey ep esen he co ela ions wi h he a ge a iables.
Figu e 4.6. Hea map o some o he ea u es and label da a (Sou ce: Own elabo a ion)
O e all, he co ela ions can be quali ied wi h ei he no co ela ion o low o medium posi i e
co ela ion conside ing he ollowing c i e ia:
- Co ela ion coe icien = 0: no-co ela ion
- 0 < Co ela ion coe icien < 0.3: low co ela ion
- 0.3 < Co ela ion coe icien < 0.5: medium co ela ion
- Co ela ion coe icien > 0.5: High co ela ion
Machine lea ning models o obese pa ien s s a i ica ion
37
No e: This c i e ion wo ks he same o nega i e co ela ions by simply using he absolu e alue o
such coe icien s.
Mo eo e , he co ela ion coe icien s ha e been independen ly compu ed and he a iables ha
bes co ela e (Co ela ion coe icien > 0.3), which a e 19, ha e been s o ed in a sepa a e DF o he
subsequen ea u e selec ion.
Sca e plo s o he a iables ha co ela e he bes can be seen in igu e 4.7.
Figu e 4.7. Compila ion o all he sca e plo s o he a iables ha co ela e he bes wi h he a ge da a
“Masa_VAT_g” (Sou ce: Own elabo a ion)
Fu he mo e, boxplo s ha e been compu ed o assu e ha all he ou lie alues ha e been
conside ed, as boxplo s p o ide in o ma ion abou he dis ibu ion o he da a as well as po en ial
ou lie s.
Annexos
38
4.2.5. T ans o ming he a ge da a in o ca ego ical da a
The i s ML algo i hms ha will be applied a e aimed a classi ying VAT quan i ies. To pe o m his
classi ica ion, he a ge da a canno be in a quan i a i e da a o ma ; ins ead, i needs o be in a
ca ego ical o quali a i e o ma . To achie e his, he a ge a iable 'Masa_VAT_g' has been di ided
in o h ee g oups using e iles. This di ision has been done using he Panda’s lib a y 'quan ile' and
'cu ' unc ions, and he esul is he ollowing:
• 0: Values smalle han he i s e ile, lowe han 33.33% o he da a → Low VAT
• 1: Values be ween he i s and second e iles, be ween 33.33% and 66.67% o he da a →
Medium VAT
• 2: Values highe han he second e ile, abo e 66.67% o he da a → High VAT
This ans o ma ion has been s o ed in a new “Masa_VAT_ca ” a iable, ha has been added o he
da a ame. Please no e ha while hese h ee ca ego ies, 0, 1, and 2, ha e been labelled as Low,
Medium, and High VAT, espec i ely, i is impo an o unde s and ha hese names a e ela i e.
Technically, all VAT quan i ies in he da a ame a e abo e a e age since hey a e ob ained om
obese pa ien s.
4.2.6. Fea u e selec ion
Pa o he ea u e selec ion has been a g adual p ocess h oughou he p e-p ocessing, by
p og essi ely cleaning he da a, he DF has al eady been educed om 169x167 o a 156x75
dimension.
None heless, ea u es can be u he na owed down by using associa ion me ics be ween he
a iables and he a ge da a. One associa ion me ic ha has been al eady e iewed in 5.3.4. The
explo a o y Da a Analysis sec ion is he co ela ion coe icien , which quan i ies he deg ee o which
quan i a i e a iables a e linea ly ela ed o associa ed wi h he a ge da a.
Ano he associa ion me ic implemen ed is he C ame ’s V algo i hm om he Dy hon lib a y, his
algo i hm compu es he associa ion be ween ca ego ical da a, he measu es go om no associa ion,
0, o high associa ion, 1. The only ca ego ical a iables “Fuma”, “DM2”, “EnolUBEsem” and “HTA”
ha e had he ollowing esul s shown in Figu e 4.8.
Figu e 4.8. C ame V algo i hm used be ween ca ego ical a iables and a ge da a (Sou ce: Own elabo a ion)
I can be seen om he igu e ha he only a iable ha p o ides e idence o associa ion wi h he
a ge is “DM2”, consequen ly he es won’ be conside ed as ea u es o now.
Machine lea ning models o obese pa ien s s a i ica ion
39
To ecapi ula e, he main poin s o ea u e selec ion discussed up o his poin a e he ollowing:
- Fea u e selec ion wi h he co ela ion coe icien be ween quan i a i e a iables and he
a ge a iable: 19 possible ea u es.
- Fea u e selec ion wi h he associa ion be ween ca ego ical a iables and he a ge a iable:
1 possible ea u e.
None heless, a inal ea u e selec ion s a egy is a knowledge-d i en selec ion, mos ly non-
an h opome ic a iables (blood- ela ed da a and clinical da a) ha e been selec ed based on hei
known biological impo ance in obesi y. They can be seen in Table 4.1.
Selec ed ea u e
Reasoning
Selec ed ea u e
Reasoning
“Pesokg”
Weigh
Di ec ly co ela ed o
obesi y
"COLT"
To al choles e ol
Obesi y is known o inc ease
o al choles e ol le els
"TAS”
Peak sys olic blood p essu e
Blood p essu e- ela ed da a,
obesi y is known o inc ease
high blood p essu e isk.
"TG"
T iglyce ides
Obesi y is linked o ele a ed
iglyce ide le els
"TAD"
Minimum dias olic p essu e
Blood p essu e- ela ed da a,
obesi y is known o inc ease
high blood p essu e isk.
"LDL"
Low-densi y lipop o ein
“bad-choles e ol”, LDL le els
end o inc ease wi h
obesi y
"DM2"
Diabe es
Obesi y is known o inc ease
diabe es isk.
"HDL"
High-densi y lipop o ein
“good-choles e ol”, HDL
le els end o dec ease wi h
obesi y.
"HTA"
A e ial hype ension
Blood p essu e- ela ed da a,
obesi y is known o inc ease
high blood p essu e isk.
"Plaq"
Pla ele s
Obesi y is linked o ele a ed
pla ele le els.
"PCR_US"
Ul asensi i e c- eac i e
p o ein
Bioma ke used o e alua e
ca dio ascula isk. Obesi y
is known o inc ease
ca dio ascula disease isk.
"AST"
Aspa a e amino ans e ase
Li e disease- ela ed da a,
Obesi y is known o inc ease
non-alcoholic a y li e
disease isk.
"GB"
Basal glucose
Diabe es- ela ed da a,
obesi y is known o inc ease
diabe es isk.
“ALT”
Alanine amino ans e ase
Li e disease- ela ed da a,
Obesi y is known o inc ease
non-alcoholic a y li e
disease isk.
"HbA1c"
Glycosyla ed hemoglobin
Diabe es- ela ed da a,
obesi y is known o inc ease
diabe es isk.
“GGT”
Gamma-glu amyl
anspep idase
Li e disease- ela ed da a,
Obesi y is known o inc ease
non-alcoholic a y li e
disease isk.
Table 4.1. Knowledge-d i en ea u e selec ion a iables (Sou ce: Own elabo a ion)
Annexos
40
4.2.7. P e-p ocessing ou come
As i is o in e es o cap u e a mo e comp ehensi e iew o he unde lying mechanisms o VAT
dis ibu ion and a deepe unde s anding o obesi y, a compa ison be ween he esul s o he usage o
an h opome ic da a and non-an h opome ic da a will be done wi h he ollowing inal da a ames,
desc ibed in able 4.2. and igu e 4.9.
(To see he speci ic ea u es o hese da a ames see ANNEX A1 and A2)
Da a F ame name
In o ma ion
Nº o ea u es
Da aAP
DF wi h only an h opome ic da a om all he ea u e
selec ion me hods explained.
17
Da aPHY
DF wi h non-an h opome ic da a om knowledge-d i en
selec ion.
16
Da aALL
DF ha combines bo h Da aAP and Da aPHY.
33
Table 4.2: Da a ames ob ained a e he p e-p ocessing (Sou ce: Own elabo a ion)
Figu e 4.9. P e-p ocessing esul s diag am (Sou ce: Own elabo a ion)
Machine lea ning models o obese pa ien s s a i ica ion
41
4.3. Classi ica ion
The classi ica ion p ocess consis s o using he “Masa_VAT_ca ” a iable as he a ge da a, as i is he
a ge da a in a ca ego ical o m, and using he ea u es om each da ase , Da aAP, Da aPHY and
Da aALL, as inpu da a o he classi ica ions.
Each da ase has been spli in o a aining se and a es ing se , ollowing an 80-20 p opo ion
espec i ely, using he “ ain_ es _spli ” [44] unc ion om he Sciki -Lea n lib a y.
4.3.1. G idSea ch
Once he p e-p ocessed da a is impo ed, he G idSea ch algo i hm [45] om he Sciki -Lea n lib a y
is employed o ind he bes classi ica ion models and hei espec i e op imal hype pa ame e s.
G idSea ch essen ially wo ks as a c oss-Valida ion echnique, used o de e mine he op imal
hype pa ame e alues o a gi en model by exhaus i ely sea ching h ough a p ede ined se o
hype pa ame e alues and e alua ing he pe o mance o he model i e a ing o e each
combina ion o alues.
The classi ica ion models e alua ed wi h G idSea ch a e he ollowing:
- Logis ic Reg ession
- K-nea es neighbou s
- Suppo Vec o Machine
- Naï e Bayes
- Decision T ee
- Random Fo es
Finding he bes model and hype pa ame e uning wi h G idSea ch esul s, shown in Figu e 4.10.
Figu e 4.10. Resul s o he G idSea ch sea ch o he bes model wi h he da aAP da a ame (Sou ce: Own
elabo a ion)
F om he G idSea ch esul i can be seen ha some models pe o m be e han o he s, he models
wi h he highes sco es will be u he e alua ed.
The G idSea ch algo i hm has been used a o al o h ee imes, one o each subse o ea u es.
Annexos
48
Bes model ained wi h all ypes o da a, om da aALL da a ame
Suppo Vec o Machine model, as de ined wi h Py hon: s m.SVC(gamma='au o', C = 20,
ke nel = 'linea ')
Con usion ma ix
ROC cu e and AUC
E alua ion me ics
Table 5.3. Summa y o he SVM classi ica ion model wi h da aALL. (Sou ce: Own elabo a ion)
Discussion 1
As seen in ables 5.1, 5.2 and 5.3, he classi ica ion model’s pe o mance a ies o a ce ain ex en
be ween he di e en da abases used. Howe e , i is clea ha he wo s pe o mance is o he
da aPHY da abase, as he AUC is e y close o 0.5, pe o ming simila ly o a andom classi ie , and i s
e alua ion me ics a e also un a ou able. Ne e heless, he e alua ion me ics be ween models ha
used da aAP and da aALL o ain a e e y simila , bo h models co ec ly p edic ed he ou come class
o app oxima ely 60% o he es ing da a. None heless, he AUC o 0.536 om he ROC cu e o he
model ha used da aALL also sugges s he beha iou o a andom classi ie . On he con a y, he AUC
om he ROC cu e o he model ha used da aAP o 0.628 sugges s a highe disc imina o y powe
and be e abili y o dis inguish be ween he gi en ins ances.
To sum i up, he bes classi ica ion model o e all is he logis ic eg ession model ained wi h
an h opome ic da a om da aAP.
Machine lea ning models o obese pa ien s s a i ica ion
49
Resul s 2: PREDICTIONS
Fo he discussion o he esul s, each Neu al Ne wo k model c ea ed, h ee in o al, ained wi h
da a om da aAP, da aPHY and da aALL, will be p o ided wi h hei espec i e e alua ion me ics.
NN model ained wi h an h opome ic da a, om da aAP da a ame
Figu e 5.2. K-c oss alida ion a e age me ics o he NN
modelled wi h da aAP ea u es. (Sou ce: own
elabo a ion)
Figu e 5.1. Sca e plo compa ing he ue alues wi h
he p edic ed alues om he model ained wi h da aAP.
(Sou ce: own elabo a ion)
NN model ained wi h biochemical and clinical da a, om da aPHY da a ame
Figu e 5.4. K-c oss alida ion a e age me ics o he NN
modelled wi h da aPHY ea u es. (Sou ce: own
elabo a ion)
Figu e 5.3. Sca e plo compa ing he ue alues wi h
he p edic ed alues om he model ained wi h
da aPHY. (Sou ce: own elabo a ion)
Annexos
50
NN model ained wi h all ypes o da a, om da aALL da a ame
Figu e 5.6. K-c oss alida ion a e age me ics o he NN
modelled wi h da aALL ea u es. (Sou ce: own
elabo a ion)
Figu e 5.5. Sca e plo compa ing he ue alues wi h
he p edic ed alues om he model ained wi h
da aALL. (Sou ce: own elabo a ion)
Discussion 2
As seen in he igu es 5.1 o 5.6, om he h ee NN, he wo s esul s a e undoub edly om he NN
model ained wi h an h opome ic ea u es om he da aAP da abase, as i is obse able in igu e
5.2 he R-squa ed alue o he es ing da ase is 0.34, which sugges s a mode a e deg ee o
explana o y powe , indica ing ha he an h opome ic a iables ha e some deg ee o in luence on
he a ia ion in VAT. None heless, he e is s ill a signi ican amoun o unexplained a iabili y.
On he o he hand, he NN models ained wi h da a om da aPHY and da aALL ha e oughly
iden ical pe o mance. Thei es ing R-squa ed (Fig 5.4 and 5.6) is almos 0.8, which indica es a high
deg ee o explana o y powe , sugges ing ha he ea u es con ained in bo h da a ames ha e a
s ong in luence on he a ia ion o VAT.
I is impo an o conside hen, ha he pe o mance o he NN de ined wi h mos ly biochemical
da a om blood es s (Da aPHY) is he same as he one con aining he same in o ma ion plus
an h opome ic da a (Da aALL). This sugges s ha he in luence o an h opome ic da a in he NN
ained wi h da aALL is e y low o null. The e o e, he model wi h he bes esul and cos -
e ec i eness, compu a ionally speaking, is he NN ained wi h he da aPHY da ase .
Machine lea ning models o obese pa ien s s a i ica ion
51
6. En i onmen al impac analysis
This p ojec has had a minimal en i onmen al impac , as o he ealiza ion o his p ojec only a
lap op has been used (hp pa ilion x360 con e ible 14-dw1098n ). These kinds o lap ops do no ha e
a conside able elec ici y consump ion, ough hey s ill lea e a ca bon oo p in . Conside ing he
usage ime o he lap op o he comple ion o he p ojec o be 600h, he a e age consump ion o
ene gy o he lap op is app oxima ely 40W/h, and he emission ac o o he elec ici y g id in
Ca alonia is 259gCO2eq/kWh [47], he o al ca bon oo p in is app oxima ely o 6,216 kg o CO2.
Howe e , o he ac o s can as well be conside ed, such as he ca bon oo p in ha unning code in
Google Colab and s o ing da a in he cloud can ha e. When compu a ion asks a e pe o med on
Google Colab and da a is s o ed in se e s, he unde lying in as uc u e and se e s consume
elec ici y, which also gene a es ca bon emissions.
Annexos
52
Conclusions and u u e p ojec s
A e he p e-p ocessing, classi ica ion and p edic ion s eps o his p ojec , aluable insigh s can be
ob ained om he bes pe o ming models.
Fi s ly, conside ing ha he classi ica ion model ha po ayed be e esul s is he one ained wi h
he da aAP da ase , we can ex ac he somewha linea o di ec ela ion be ween VAT and
an h opome ic da a, due o he in e p e abili y o logis ic eg ession models in compa ison wi h NN
models. Logis ic eg ession esul s di ec ly ep esen he ela ionship be ween inpu da a ( ea u es)
and he ou pu (VAT), allowing o a clea unde s anding o he impac o he a iables chosen.
Con e sely, NN encompass complex compu a ions ac oss mul iple laye s, complica ing he
in e p e a ion o he con ibu ion o speci ic inpu a iables. Howe e , NN can cap u e nonlinea and
complex pa e ns and in e ac ions in he da a, which esul s in mo e lexible app oaches o
p edic ion modelling. The e o e, om he esul s o he NN p edic ion ha pe o med he bes , we
can ex ac he signi ican in luence o biochemical da a and clinical da a in VAT assessmen .
Mo eo e , he da a used eassu es he ou comes o se e al s udies [12] [16] whe e VAT has been
shown o be linked wi h he p e alence o some o he condi ions ha da aPHY ea u es a e
associa ed o. (See Table 4.1.)
The esul s o he p edic ions a e o signi ican impo ance, because he a iables used o he
aining (da aPHY) a e o ela i ely easy acquisi ion h ough blood es analysis and medical eco ds.
This opens he doo , wi h he help o u he in es iga ion, o he possibili y o c ea ing a cos -
e ec i e ool o an ini ial app oxima ion o VAT, and consequen ly o obesi y- ela ed isks, in
si ua ions whe e he common ools o s udy a dis ibu ion, such as DEXA and MRI, a e no easily
accessible. The e o e enabling heal hca e p o essionals o iden i y high- isk obese indi iduals.
Limi a ions
The de elopmen o his p ojec has been limi ed by he ac ha only da a om emale pa ien s has
been used due o he sca ci y o male pa ien da a. Conside ing he di e ence in VAT dis ibu ion
be ween men and women (see sec ion 2.2.1. Dis ibu ion and unc ionali y), he c ea ed models
migh no be able o gene alize well o his segmen o he popula ion. I will mos likely p ope ly
wo k o p edic emale VAT quan i ies, and consequen ly allowing solely o s a i y emale obese
pa ien s.
Ano he limi a ion o he p ojec has been he o e all low numbe o pa ien s in he da ase (156
pa ien s whose da a has been used). Gene ally, in ML, i is p e e able o ha e a la ge numbe o
pa ien s o he models o lea n om a b oade ange o pa e ns and a ia ions in he da a. This
helps o make he models mo e obus , educing hei sensi i i y o small a ia ions in da a.
Fu u e imp o emen s
Following he p e ious s a emen , a u u e imp o emen would be he addi ion o mo e pa ien s in
he da ase , as well as ha ing he same p opo ion o males and emales o p ope ly assess each
segmen o he obese popula ion. Wi h an inc eased dimension o he da a, ML aining can be
imp o ed, and he models ob ained can be u he alida ed wi h ex e nal da ase s ha ha e no
been used o he aining. In addi ion, i he da a se we e la ge enough, dimensionali y educ ion
Machine lea ning models o obese pa ien s s a i ica ion
53
echniques, such as P incipal Componen Analysis (PCA), could be applied o enhance he
pe o mance and e iciency o he ML models.
Ano he c ucial imp o emen would be he alida ion o he ML models wi h clinicians and domain
expe s o e alua e he clinical applica ions o he models h ough hei expe ise and domain
knowledge.
Las ly, ano he u u e addi ion o he p ojec would be he ex ension o he p ojec i sel by adding
image da a ob ained h ough DEXA imaging and applying ML echniques, such as con olu ional
neu al ne wo ks (CNN), o segmen he images o di ec ly measu e VAT om he segmen a ions.
Annexos
54
Economic analysis
The main ca ego ies o be conside ed o he economic analysis o his p ojec a e human esou ces,
ha dwa e, so wa e, and se ices.
Fo he ealiza ion o his p ojec , Google Colabo a o y has been used, which is a cloud-hos ed
e sion o Jupi e -no ebook ha allows easy access o Py hon lib a ies, his p og amming
en i onmen is ee o cha ge and he e o e he cos o So wa e in his p ojec is null.
Human esou ces
Desc ip ion
Hou s
Cos (€/h)
TOTAL
Enginee ing s uden
600h
8€/h
4800€
Tu o
50h
30€/h
1500€
Co- u o
15h
30€/h
450€
TOTAL:
6750€
This p ojec has been mainly c ea ed wi h he pa icipa ion o h ee indi iduals; an enginee ing
s uden , a u o and a co- u o . Fo he simpli ica ion o cos s, he au ho will be conside ed o ha e
he minimum equi ed sala y o an in e n om he Uni e si a Poli ècnica de Ca alunya.
Ha dwa e
Desc ip ion
Quan i y
Cos
Lap op (hp pa ilion x360
con e ible 14-dw1098n )
1
999€
TOTAL:
999€
Se ices
By es ima ion, he cos o he elec ici y used by a lap op in 600h o usage is oughly 6€, he e o e i
will be neglec ed om he o al cos s.
TOTAL COST = 7.749€
Machine lea ning models o obese pa ien s s a i ica ion
55
Bibliog aphy
[1] Shus e , A., Pa las, M., Pin hus, J. H., & Mou zakis, M. (2012). The clinical impo ance o
isce al adiposi y: a c i ical e iew o me hods o isce al adipose issue analysis. The B i ish
Jou nal o Radiology, 85(1009), 1. h ps://doi.o g/10.1259/BJR/38447238
[2] Iacobellis, G. (2005). Imaging o isce al adipose issue: An eme ging diagnos ic ool and
he apeu ic a ge . Cu en D ug Ta ge s. Ca dio ascula & Haema ological Diso de s, 5(4), 345–
353. h ps://doi.o g/10.2174/1568006054553408
[3] Visce al Fa Vs. Subcu aneous Fa (n.d.). Re ie ed May 12, 2023, om
h ps://eli ebodysculp u e.com/ai sculp -daily/ isce al- a - s-subcu aneous- a -will-lipo-help-
ei he /
[4] La ie, C. J., de Schu e , A., Pa o, P., Jahangi , E., Kokkinos, P., O ega, F. B., A ena, R., &
Milani, R. . (2016). Obesi y and P e alence o Ca dio ascula Diseases and P ognosis—The
Obesi y Pa adox Upda ed. P og ess in Ca dio ascula Diseases, 58(5), 537–547.
h ps://doi.o g/10.1016/J.PCAD.2016.01.008
[5] Wo ld Hea Fede a ion. “Obesi y”. Re ie ed May 10, 2023, om h ps://wo ld-hea -
ede a ion.o g/wha -we-do/obesi y/
[6] Wo ld Heal h O ganiza ion. “Obesi y.” Who.in . Accessed May 11, 2023.
h ps://www.who.in /heal h- opics/obesi y.
[7] Ins i u o Nacional de Es adís ica. “4.6 De e minan es de salud (sob epeso, consumo de u a y
e du a, ipo de lac ancia, ac i idad ísica)” Accessed May 11, 2023.
h ps://www.ine.es/ss/Sa elli e?L=es_ES&c=INESeccion_C&cid=1259926457058&p=%5C&pagename
=P oduc osYSe icios%2FPYSLayou ¶m1=PYSDe alle¶m3=1259924822888.
[8] He náez, Á., Zomeño, M. D., Dégano, I. R., Pé ez-Fe nández, S., Goday, A., Vila, J., Ci ei a, F.,
Mou e, R., & Ma uga , J. (2019). Excess Weigh in Spain: Cu en Si ua ion, P ojec ions o 2030,
and Es ima ed Di ec Ex a Cos o he Spanish Heal h Sys em. Re is a Española de Ca diología
(English Edi ion), 72(11), 916–924. h ps://doi.o g/10.1016/J.REC.2018.10.010
[9] Obesi y in Spain: 80% o men and 55% o women in Spain will be o e weigh by 2030: s udy |
Spain | EL PAÍS English. (n.d.). Re ie ed May 30, 2023, om
h ps://english.elpais.com/elpais/2019/01/10/inenglish/1547131751_501777.h ml
[10] F ank, A. P., de Souza San os, R., Palme , B. F., & Clegg, D. J. (2019). De e minan s o body a
dis ibu ion in humans may p o ide insigh abou obesi y- ela ed heal h isks. Jou nal o Lipid
Resea ch, 60(10), 1710–1719. h ps://doi.o g/10.1194/JLR.R086975
[11] Blühe , M. (2019). Obesi y: global epidemiology and pa hogenesis. In Na u e Re iews
Endoc inology (Vol. 15, Issue 5, pp. 288–298). Na u e Publishing G oup.
h ps://doi.o g/10.1038/s41574-019-0176-8
[12] Ag awal, S., Kla q is , M. D. R., Diaman , N., S anley, T. L., Ellino , P. T., Meh a, N. N.,
Philippakis, A., Ng, K., Claussni ze , M., G inspoon, S. K., Ba a, P., & Khe a, A. . (2023). BMI-
Annexos
56
adjus ed adipose issue olumes exhibi depo -speci ic and di e gen associa ions wi h
ca diome abolic diseases. Na u e Communica ions 2023 14:1, 14(1), 1–10.
h ps://doi.o g/10.1038/s41467-022-35704-5
[13] Na ional Heal h Se ice “Weigh loss su ge y”. Re ie ed May 22, 2023, om
h ps://www.nhs.uk/condi ions/weigh -loss-su ge y/
[14] Pi-Sunye , X. (2009). “The Medical Risks o Obesi y.” Pos g adua e Medicine 121 (6): 21–33.
h ps://doi.o g/10.3810/pgm.2009.11.2074.
[15] Lumish, H. S., O’Reilly, M., & Reilly, M. P. (2020). Sex Di e ences in Genomic D i e s o
Adipose Dis ibu ion and Rela ed Ca diome abolic Diso de s. A e ioscle osis, Th ombosis, and
Vascula Biology, 40(1), 45–60. h ps://doi.o g/10.1161/ATVBAHA.119.313154
[16] Desp és, J. P., Lemieux, I., & P ud’homme, D. (2001). T ea men o obesi y: need o ocus on
high isk abdominally obese pa ien s. BMJ : B i ish Medical Jou nal, 322(7288), 716.
h ps://doi.o g/10.1136/BMJ.322.7288.716
[17] A mao, D., Guyon, J. P., Fi a , Z., B own, M. A., & Semelka, R. C. (2006). Accu a e
quan i ica ion o isce al adipose issue (VAT) using wa e -sa u a ion MRI and compu e
segmen a ion: P elimina y esul s. Jou nal o Magne ic Resonance Imaging, 23(5), 736–741.
h ps://doi.o g/10.1002/JMRI.20551
[18] Hu, H. H., Chen, J., & Shen, W. (2016). Segmen a ion and quan i ica ion o adipose issue by
magne ic esonance imaging. Magma (New Yo k, N.Y.), 29(2), 259.
h ps://doi.o g/10.1007/S10334-015-0498-Z
[19] C ab ee, C. D., La oun ain, R. A., Hyde, P. N., Chen, C., Pan, Y., Lamba, N., Sappe , T. N.,
Sho , J. A., Kackley, M. L., Buga, A., Mille , V. J., Scandling, D., Ande sson, I., Ba ke , S., Hu, H. H.,
Volek, J. S., & Simone i, O. P. (2019). Quan i ica ion o Human Cen al Adipose Tissue Depo s: An
Ana omically Ma ched Compa ison Be ween DXA and MRI. Tomog aphy (Ann A bo , Mich.), 5(4),
358–366. h ps://doi.o g/10.18383/J.TOM.2019.00018
[20] IBM “Wha is Machine Lea ning?” Re ie ed May 20, 2023, om h ps://www.ibm.com
/ opics/machine-lea ning
[21] Conjun os de en enamien o y p ueba: Di isión de da os | Machine Lea ning | Google o
De elope s. (n.d.). Re ie ed May 29, 2023, om h ps://de elope s.google.com/machine-
lea ning/c ash-cou se/ aining-and- es -se s/spli ing-da a?hl=es-419
[22] Mo gen hale , S. (2009). Explo a o y da a analysis. Wiley In e disciplina y Re iews:
Compu a ional S a is ics, 1(1), 33–44. h ps://doi.o g/10.1002/WICS.2
[23] Song, Q., & Sheppe d, M. (2007). Missing da a impu a ion echniques. In e na ional Jou nal o
Business In elligence and Da a Mining, 2(3), 261–291. h ps://doi.o g/10.1504/IJBIDM.
2007.015485
[24] Cousineau, D., & Cha ie , S. (2010). ISSN imp esa (p in ed) 2011-2084 ISSN elec ónica
(elec onic). In In e na ional Jou nal o Psychological Resea ch (Vol. 3, Issue 1).
Machine lea ning models o obese pa ien s s a i ica ion
57
[25] Kuhn, M., Ra on, K. J. B., Bu che , B., & Smi h, B. J. (2020). Fea u e Enginee ing and Selec ion:
A P ac ical App oach o P edic i e Models 124 74(3), 308–309. h ps://doi.o g/10.1080/0003130
5.2020.1790217
[26] C amé ’s V - IBM Documen a ion. (n.d.). Re ie ed June 1, 2023, om
h ps://www.ibm.com/docs/en/cognos-analy ics/11.1.0? opic= e ms-c am s-
[27] Li, Jundong, Kewei Cheng, Suhang Wang, F ed Mo s a e , Robe P. T e ino, Jiliang Tang, and
Huan Liu. (2018). “Fea u e Selec ion: A Da a Pe spec i e.” ACM Compu ing Su eys 50 (6): 1–45.
h ps://doi.o g/10.1145/3136625.
[28] Rani, A., Kuma , N., Kuma , J., & Sinha, N. K. (2022). Machine lea ning o soil mois u e
assessmen . Deep Lea ning o Sus ainable Ag icul u e, 143–168. h ps://doi.o g/10.1016/B978-0-
323-85214-2.00001-X
[29] Shmilo ici, A. (2005). Suppo Vec o Machines. Da a Mining and Knowledge Disco e y
Handbook, 257–276. h ps://doi.o g/10.1007/0-387-25465-X_12
[30] Soo i, A. A., & Awan, A. (2017). Classi ica ion Techniques in Machine Lea ning: Applica ions
and Issues. Jou nal o Basic & Applied Sciences, 13, 459–465.
[31] In oduc ion o Decision T ees: Why Should You Use Them? | 365 Da a Science. (n.d.).
Re ie ed June 1, 2023, om h ps://365da ascience.com/ u o ials/machine-lea ning-
u o ials/decision- ees/
[32] Wha is a Decision T ee | IBM. (n.d.). Re ie ed June 12, 2023, om
h ps://www.ibm.com/ opics/decision- ees
[33] Scha e , C., & Edu, S. A. H. C. (1993). Selec ing a classi ica ion me hod by c oss- alida ion.
Machine Lea ning 1993 13:1, 13(1), 135–143. h ps://doi.o g/10.1007/BF00993106
[34] Kulka ni, A., Chong, D., & Ba a seh, F. A. (2020). Founda ions o da a imbalance and solu ions
o a da a democ acy. Da a Democ acy: A he Nexus o A i icial In elligence, So wa e
De elopmen , and Knowledge Enginee ing, 83–106. h ps://doi.o g/10.1016/B978-0-12-818366-
3.00005-8
[35] Mand eka , J. N. (2010). Recei e Ope a ing Cha ac e is ic Cu e in Diagnos ic Tes
Assessmen . Jou nal o Tho acic Oncology, 5(9), 1315–1316. h ps://doi.o g/10.1097/JTO
.0B013E3181EC173D
[36] Zhang, C., Zhao, J., Zhu, Z., Li, Y., Li, K., Wang, Y., & Zheng, Y. (2022). Applica ions o A i icial
In elligence in Myopia: Cu en and Fu u e Di ec ions. In F on ie s in Medicine (Vol. 9). F on ie s
Media S.A. h ps://doi.o g/10.3389/ med.2022.840498
[37] Kulka ni, A., Chong, D., & Ba a seh, F. A. (2020). Founda ions o da a imbalance and solu ions
o a da a democ acy. Da a Democ acy: A he Nexus o A i icial In elligence, So wa e
De elopmen , and Knowledge Enginee ing, 83–106. h ps://doi.o g/10.1016/B978-0-12-818366-
3.00005-8