scieee Science in your language
[en] (orig)

Time series forecasting applied to an energy management system ‐ A comparison between Deep Learning Models and other Machine Learning Models

Abstract

A large amount of energy used by the world comes from buildings’ energy consumption. HVAC (Heat, Ventilation, and Air Conditioning) systems are the biggest offenders when it comes to buildings’ energy consumption. It is important to provide environmental comfort in buildings but indoor wellbeing is directly related to an increase in energy consumption. This dilemma creates a huge opportunity for a solution that balances occupant comfort and energy consumption. Within this context, the Ambiosensing project was launched to develop a complete energy management system that differentiates itself from other existing commercial solutions by being an inexpensive and intelligent system. The Ambiosensing project focused on the topic of Time Series Forecasting to achieve the goal of creating predictive models to help the energy management system to anticipate indoor environmental scenarios. A good approach for Time Series Forecasting problems is to apply Machine Learning, more specifically Deep Learning. This work project intends to investigate and develop Deep Learning and other Machine Learning models that can deal with multivariate Time Series Forecasting, to assess how well can a Deep Learning approach perform on a Time Series Forecasting problem, especially, LSTM (Long Short-Term Memory) Recurrent Neural Networks (RNN) and to establish a comparison between Deep Learning and other Machine Learning models like Linear Regression, Decision Trees, Random Forest, Gradient Boosting Machines and others within this context.

Read accessible full text

Time series forecasting applied to an energy management system ‐ A comparison between Deep Learning Models and other Machine Learning Models

Author: Arienti, João Henrique Leal
Year: 2020
Source: https://run.unl.pt/bitstream/10362/108172/1/TAA0068.pdf
i
Time Se ies Fo ecas ing Applied o an Ene gy
Managemen Sys em
João Hen ique Leal A ien i
A Compa ison Be ween Deep Lea ning Models and
O he Machine Lea ning Models
P ojec Wo k p esen ed as he pa ial equi emen o
ob aining a Mas e ’s deg ee in Da a Science and Ad anced
Analy ics
ii
NOVA In o ma ion Managemen School
Ins i u o Supe io de Es a ís ica e Ges ão de In o mação
Uni e sidade No a de Lisboa
TIME SERIES FORECASTING APPLIED TO AN ENERGY MANAGEMENT SYSTEM
A Compa ison Be ween Deep Lea ning Models and O he Machine Lea ning Models
João Hen ique Leal A ien i
P ojec Wo k p esen ed as he pa ial equi emen o ob aining a Mas e ’s deg ee in Da a
Science and Ad anced Analy ics
Ad iso : Mau o Cas elli, Ph.D.
Augus 2020
iii
DEDICATION
I would like o dedica e his hesis o my amily. To my a he and mo he , bo h o me uni e si y
p o esso s, o always encou aging me and suppo ing me in all my academic yea s. To my wi e who
made i possible o me o wo k, o s udy, and o ake ca e o ou wonde ul daugh e s, one o hem
being bo n in he middle o he mas e p og am. To my sis e who was doing a mas e hesis in he
medical ield a he same ime as me and ga e me impo an ips and also mo i a ed me. Fo all o
you, my mos since e g a i ude.
i
ACKNOWLEDGEMENTS
I would like o deeply hank my hesis ad iso , D . Mau o Cas elli. Thank you o being a ailable o
ad ising me and o doing his inc edibly as . I always had a p omp answe which helped a lo in
de eloping he hesis on he igh pa h om he beginning.
I would like o hank my iend and mas e ’s colleague Biazi Baye o helping me ind an inspi ing
heme and p ojec o suppo my hesis. And o always mo i a ing me and being a ailable o help.
I would also like o hank my colleagues om he Ambiosensing p ojec o hei collabo a ion and
eamwo k.
ABSTRACT
A la ge amoun o ene gy used by he wo ld comes om buildings’ ene gy consump ion. HVAC (Hea ,
Ven ila ion, and Ai Condi ioning) sys ems a e he bigges o ende s when i comes o buildings’
ene gy consump ion. I is impo an o p o ide en i onmen al com o in buildings bu indoo well-
being is di ec ly ela ed o an inc ease in ene gy consump ion. This dilemma c ea es a huge
oppo uni y o a solu ion ha balances occupan com o and ene gy consump ion. Wi hin his
con ex , he Ambiosensing p ojec was launched o de elop a comple e ene gy managemen sys em
ha di e en ia es i sel om o he exis ing comme cial solu ions by being an inexpensi e and
in elligen sys em. The Ambiosensing p ojec ocused on he opic o Time Se ies Fo ecas ing o
achie e he goal o c ea ing p edic i e models o help he ene gy managemen sys em o an icipa e
indoo en i onmen al scena ios. A good app oach o Time Se ies Fo ecas ing p oblems is o apply
Machine Lea ning, mo e speci ically Deep Lea ning. This wo k p ojec in ends o in es iga e and
de elop Deep Lea ning and o he Machine Lea ning models ha can deal wi h mul i a ia e Time
Se ies Fo ecas ing, o assess how well can a Deep Lea ning app oach pe o m on a Time Se ies
Fo ecas ing p oblem, especially, LSTM (Long Sho -Te m Memo y) Recu en Neu al Ne wo ks (RNN)
and o es ablish a compa ison be ween Deep Lea ning and o he Machine Lea ning models like
Linea Reg ession, Decision T ees, Random Fo es , G adien Boos ing Machines and o he s wi hin
his con ex .
KEYWORDS
A i icial In elligence; Big Da a; Da a Science; Deep Lea ning; Ene gy Managemen Sys em; Hea ,
Ven ila ion, and Ai Condi ioning; In e ne o Things; Long Sho -Te m Memo y; Machine Lea ning;
Neu al Ne wo k; Recu en Neu al Ne wo ks; Time Se ies Fo ecas ing

i
INDEX
1. In oduc ion ............................................................................................................. 1
1.1. Mo i a ion ......................................................................................................... 1
1.2. Objec i es .......................................................................................................... 1
2. Theo e ical Backg ound ............................................................................................ 3
2.1. Wha is Time Se ies Fo ecas ing? ....................................................................... 3
2.2. Da a P epa a ion ............................................................................................... 3
2.2.1. S anda diza ion ........................................................................................... 4
2.2.2. No maliza ion ............................................................................................. 4
2.3. Model E alua ion ............................................................................................... 5
2.3.1. T ain-Tes Spli ............................................................................................ 5
2.3.2. K- old C oss-Valida ion ................................................................................ 6
2.3.3. Mul iple T ain-Tes Spli s (applied o Time Se ies) ...................................... 7
2.4. Pe o mance Me ics ......................................................................................... 8
2.4.1. Mean Absolu e E o (MAE) ........................................................................ 8
2.4.2. Mean Squa ed E o (MSE) ......................................................................... 9
2.4.3. Roo Mean Squa ed E o (RMSE) ............................................................... 9
2.5. Machine Lea ning Models ................................................................................ 10
2.5.1. Linea Algo i hms ...................................................................................... 10
2.5.2. Nonlinea Algo i hms ................................................................................ 11
2.5.3. Ensemble Algo i hms ................................................................................ 12
2.6. Deep Lea ning ................................................................................................. 12
2.6.1. Neu al Ne wo ks ....................................................................................... 12
2.6.2. Recu en Neu al Ne wo ks ...................................................................... 14
3. Concep ual Model .................................................................................................. 17
3.1. Con ex ualiza ion............................................................................................. 17
3.2. In e ne o Things ............................................................................................ 17
3.3. Big Da a ........................................................................................................... 18
3.4. Da a Science .................................................................................................... 18
3.5. Ma ke Analysis and Big Playe s Ini ia i es....................................................... 19
3.6. Ambiosensing Concep ual A chi ec u e ........................................................... 20
3.6.1. Base Pla o m ........................................................................................... 21
3.6.2. Supe ision Se ices.................................................................................. 23
3.6.3. Ad anced Se ices .................................................................................... 24
ii
3.6.4. Ambiosensing Applica ions ....................................................................... 26
3.7. Da a Collec ion and Ambiosensing O e iew ................................................... 27
4. Expe imen al Se ings ............................................................................................. 31
4.1. De ice and Senso s .......................................................................................... 31
4.2. Da a Acquisi ion Mechanism ........................................................................... 32
4.3. Expe imen al F amewo k ................................................................................. 34
4.3.1. Da a Loading ............................................................................................. 34
4.3.2. Da a Checking and Da a Cleansing ............................................................ 36
4.3.3. Missing Values T ea men ......................................................................... 36
4.3.4. Ou lie s T ea men ................................................................................... 41
4.3.5. Desc ip i e S a is ics ................................................................................. 43
4.3.6. Da a Visualiza ion ..................................................................................... 43
4.3.7. Fea u e Enginee ing .................................................................................. 46
4.3.8. Fea u e Selec ion ...................................................................................... 49
4.3.9. Deep Lea ning Models .............................................................................. 64
4.3.10. Machine Lea ning Models ................................................................ 76
5. Resul s .................................................................................................................... 82
6. Conclusions ............................................................................................................ 84
7. P ac ical Applica ions and Recommenda ions o Fu u e Wo k .............................. 86
8. Bibliog aphy ........................................................................................................... 87
iii
LIST OF FIGURES
Figu e 2-1 - T ain and es spli s in blue and o ange espec i ely. ........................................... 5
Figu e 2-2 – Spli and old scheme o a 5- old c oss- alida ion example. ................................ 6
Figu e 2-3 - Mul iple T ain-Tes Spli s c ea ed by TimeSe iesSpli con igu ed o 5 spli s. ....... 7
Figu e 2-4 - Example o 5 spli s c ea ed by TimeSe iesSpli . ................................................... 8
Figu e 2-5 – An example o a Pe cep on.............................................................................. 13
Figu e 2-6 - An example o a Neu al Ne wo k wi h a simple opology................................... 14
Figu e 2-7 - An example o a Recu en Neu al Ne wo k (RNN) wi h cyclical and sideways
connec ions. ................................................................................................................. 15
Figu e 2-8 - LSTM memo y block schema. ............................................................................ 16
Figu e 3-1 Ambiosensing Concep ual A chi ec u e ............................................................... 21
Figu e 3-2 - Base Pla o m Laye ........................................................................................... 21
Figu e 3-3 - Supe ision Se ices Laye ................................................................................. 23
Figu e 3-4 - Ad anced Se ices Laye .................................................................................... 25
Figu e 3-5 - Ambiosensing De ice ......................................................................................... 28
Figu e 3-6 - Ambiosensing Cen al Uni ................................................................................ 29
Figu e 3-7 - Ambiosensing O e iew .................................................................................... 30
Figu e 4-1 - Ambiosensing de ice p oo o concep . ............................................................. 31
Figu e 4-2 - Da a Collec o P og am Diag am. ...................................................................... 33
Figu e 4-3 - O iginal da ase . ................................................................................................ 35
Figu e 4-4 - Da ase a e ini ial da a p epa a ion................................................................. 35
Figu e 4-5 - Da a cap u ed om he senso s. ....................................................................... 37
Figu e 4-6 - Da a gene a ed o da a impu a ion. ................................................................. 37
Figu e 4-7 - Da ase wi h o iginal columns and null columns. Fi e ows ou o he 10.000
ans o med. ................................................................................................................ 37
Figu e 4-8 - Da ase wi h o iginal columns and eplica ed columns unal e ed. Fi e ows ou
o he 40.000 no ans o med. .................................................................................... 38
Figu e 4-9- Sample da ase o Celsius ea u e be o e da a impu a ion. ................................ 39
Figu e 4-10 - Sample da ase o Celsius ea u e a e da a impu a ion. ................................ 39
Figu e 4-11- Whole da ase o Celsius ea u e be o e da a impu a ion................................. 40
Figu e 4-12 - Whole da ase o Celsius ea u e a e da a impu a ion. ................................. 41
Figu e 4-13- Time-se ies ea u es summa y s a is ics. .......................................................... 43
Figu e 4-14 - Fea u e Celsius line plo ................................................................................... 44
Figu e 4-15 - Fea u e Celsius his og am................................................................................ 44
Figu e 4-16 - Fea u e Celsius box and whiske plo . .............................................................. 45
ix
Figu e 4-17 - Fea u e Celsius lag sca e plo . ....................................................................... 45
Figu e 4-18 - Fea u e Celsius au oco ela ion plo . ............................................................... 45
Figu e 4-19 - Da ase wi h new da e- ime ea u es. ............................................................. 46
Figu e 4-20 - Da ase wi h new Da e_Pe iod ea u e. ........................................................... 46
Figu e 4-21 - Da ase wi h new Holiday_Flag ea u e when i is a holiday. ........................... 47
Figu e 4-22 - Da ase wi h new ea u e Holiday_Flag when i is no a holiday. ..................... 47
Figu e 4-23 – Celsius lag ea u es. ........................................................................................ 48
Figu e 4-24 - Da ase wi h new clima e ea u es. ................................................................. 48
Figu e 4-25- Ex e nal empe a u e ea u e o he whole da ase pe iod. ............................ 49
Figu e 4-26 - P ecipi a ion ea u e o he whole da ase pe iod. ......................................... 49
Figu e 4-27 - Va iables om he beginning o he da ase . ................................................... 50
Figu e 4-28 - Va iables om he end o he da ase . ............................................................ 50
Figu e 4-29- Da ase a e da a ans o ma ions o ea u e selec ion. Va iables om he
beginning o he da ase . .............................................................................................. 51
Figu e 4-30- Da ase a e da a ans o ma ions o ea u e selec ion. Va iables om he end
o he da ase . .............................................................................................................. 51
Figu e 4-31- Fea u es x Fea u e Impo ance Sco es. ............................................................. 53
Figu e 4-32 - Fea u es x Fea u e Impo ance Sco es (wi hou op wo ea u es). ................. 53
Figu e 4-33- Lis o selec ed ea u es by he RFE algo i hm. ................................................. 54
Figu e 4-34 - Fea u es x Fea u e Ranks by RFE algo i hm (lowe is be e ). .......................... 54
Figu e 4-35 - His og am o selec ed ea u es. ....................................................................... 55
Figu e 4-36 - Co ela ion ma ix. .......................................................................................... 56
Figu e 4-37 - Final da ase o Deep Lea ning models. .......................................................... 57
Figu e 4-38 - Celsius ea u e se ies. ...................................................................................... 57
Figu e 4-39- Celsius ea u es se ies a e end emo al. ...................................................... 58
Figu e 4-40 - Au oco ela ion plo o he 200 i s da a poin s o he Celsius ea u e. ......... 59
Figu e 4-41 - Celsius se ies wi h he oldes lag ea u es. ...................................................... 59
Figu e 4-42 - Celsius se ies wi h he mos ecen lag ea u es. ............................................. 60
Figu e 4-43 - Fea u es x Fea u e Impo ance Sco es. ............................................................ 62
Figu e 4-44 - Fea u es x Fea u es Impo ance Sco es (wi hou op ea u e -6). ................... 62
Figu e 4-45 - Lis o selec ed ea u es by he RFE algo i hm. ................................................ 63
Figu e 4-46 - Fea u es x Fea u e Ranks by RFE algo i hm (lowe is be e ). .......................... 63
Figu e 4-47 - Final da ase o Machine Lea ning models. .................................................... 63
Figu e 4-48 - Final da ase o DL models. Celsius ea u e highligh ed o he uni a ia e
model. .......................................................................................................................... 64
3
2. THEORETICAL BACKGROUND
2.1. WHAT IS TIME SERIES FORECASTING?
Time Se ies Fo ecas ing is he Machine Lea ning a ea esponsible o p edic ion p oblems ha
in ol e a ime componen . I is impo an o dis inguish Time Se ies Analysis om Time Se ies
Fo ecas ing since hey ha e di e en goals. Time Se ies Analysis is ela ed o desc ibing, o
unde s anding he da ase . Meanwhile, Time Se ies Fo ecas ing is associa ed wi h p edic ing, wi h
o ecas ing he u u e (B ownlee, 2018c, p. 9;10).
Times Se ies Analysis can be de ined as he sys ema ic app oach o answe ing he ma hema ical and
s a is ical ques ions posed by he ime co ela ion in oduced by he sampling o adjacen poin s in
ime. I is he analysis o expe imen al da a ha ha e been obse ed a di e en poin s in ime
(Shumway & S o e , 2017, p. 1). Time Se ies Analysis usually in ol es he s udy o he o m o he
da a and o he componen s o a ime se ies (B ownlee, 2018c, p. 11).
Time Se ies Fo ecas ing can be de ined as he p ocess o aking his o ical da a o a ime se ies,
some imes wi h addi ional in o ma ion, and i ing models o o ecas u u e alues. Unlike Time
Se ies Analysis ha can be done in e ospec and use “ u u e” in o ma ion, o ecas ing models don’
ha e “ u u e” in o ma ion a ailable. E e y hing mus be done based only on wha has al eady
happened. A p edic i e model is e alua ed by i s p edic i e accu acy. Meanwhile, a desc ip i e
model is assessed by i s capabili y o p o iding co ec causal explana ions (Shmueli & Lich endahl,
2016, p. 19).
2.2. DATA PREPARATION
In many cases, he da ase will equi e di e en ypes o da a p epa a ion. Whene e ea u es
p esen hemsel es in dissimila scales, i is he case o conside s anda diza ion o no maliza ion.
Bo h echniques in end o make ea u es compa able o one ano he . Fo example, inpu a iables
p essu e and empe a u e could be e y di e en in scale. P essu e could be measu ed in hPa
(hec opascal), which a Mean Sea-Le el (MSL) is 1013,25 hPa (o 1 a m) by he In e na ional
O ganiza ion o S anda diza ion (ISO) (“In e na ional O ganiza ion o S anda diza ion,” 1975). S ill,
empe a u e could be measu ed in Celsius deg ees, which is usually be ween -40 and 40 deg ees in
i s ex emes. So, one a iable has alues in he ange o he ens and he o he in he housands.
Some Machine Lea ning models will pe o m be e i he da ase has consis en scales. Tha is he
case o algo i hms like Reg ession, and K-Nea es Neighbo s. These algo i hms ake ad an age o
escaled da ase s o di e en easons. Reg ession because i weigh s inpu a iables and K-Nea es
Neighbo s because i uses dis ance measu es (B ownlee, 2019, p. 48).

4
2.2.1. S anda diza ion
S anda diza ion (o z-sco e no maliza ion) is he echnique ha escales he da a by ans o ming he
mean o he dis ibu ion o ze o and i s s anda d de ia ion o one like a s anda d no mal dis ibu ion
(o s anda d Gaussian dis ibu ion) (Bu ko , 2019, p. 39).
I is ep esen ed by he ollowing o mula:
y = (x – mean) / s anda d de ia ion
Whe e mean is calcula ed as:
mean = sum(x) / coun (x)
And he s anda d de ia ion is calcula ed as:
s anda d de ia ion = sq ( sum( (x – mean)ˆ2 ) / coun (x) )
I is possible o s anda dize a da ase by using he class S anda dScale om Py hon’s lib a y sciki -
lea n (“sklea n.p ep ocessing.S anda dScale — sciki -lea n 0.23.2 documen a ion,” n.d.).
2.2.2. No maliza ion
No maliza ion (o min-max no maliza ion) is he echnique ha escales he da a by con e ing he
ac ual ange o alues o a s anda d ange o alues. Usually, i is done in he in e al be ween 0 and
1 o -1 and 1 (Bu ko , 2019, p. 39).
I is ep esen ed by he ollowing o mula:
y = (x – min) / (max - min)
Whe e min and max s and o he minimum and he maximum alues o x in he da ase .
5
I is possible o no malize a da ase by using he class MinMaxScale om Py hon’s lib a y sciki -lea n
(“sklea n.p ep ocessing.MinMaxScale — sciki -lea n 0.23.2 documen a ion,” n.d.).
2.3. MODEL EVALUATION
Model e alua ion is an es ima e o how well he model will pe o m in p ac ice. Usually, o pe o m a
model e alua ion, he da ase is spli be ween aining and es se s. Model e alua ion canno be
done using he same da a as in aining. O he wise, any es ima e o pe o mance would be
op imis ic. I aining da a is used on e alua ion, he algo i hm is likely o sco e pe ec ly. Howe e ,
he e is a e y good chance ha he p edic ions will be w ong (B ownlee, 2019, p. 57).
The e o e, he model e alua ion mus be done based on he es se . Tha is why he es ing se is
held back and i is an unseen da a o he model. The algo i hm ne e had con ac wi h he es ing se
be o e model e alua ion (B ownlee, 2018c, p. 145).
Some imes, he da ase is spli in o h ee pa s: aining, alida ion, and es se s. In his case,
aining da a is used by he model o lea n, alida ion da a is u ilized o selec he bes model, and o
selec pa ame e s om es ima es o pe o mance and es da a is employed, exclusi ely, o assess
pe o mance a he end o he p ocess (Igual & Seguí, 2017, p. 82).
2.3.1. T ain-Tes Spli
T ain- es spli is he simples me hod o model e alua ion. And, i he da ase is la ge enough, bo h
ain and es spli s could inco po a e di e en pa e ns ep esen ing well he p oblem and he
esul ing es ima e o pe o mance could be consis en . Ano he posi i e aspec o he ain- es spli
is ha i is a as me hod.
T ain- es spli consis s o spli ing he da ase in o wo pa s: aining and es se s. One o aining
he algo i hm and he o he o make p edic ions and compa e hem o he al eady known alues.
Tha way, i is possible o calcula e a pe o mance me ic and o assess he accu acy o he model.
Figu e 2-1 - T ain and es spli s in blue and o ange espec i ely.
The nega i e aspec o he ain- es spli is ha di e ences in aining and es se s could end up in
dissimila i ies in he es ima e o pe o mance (B ownlee, 2019, p. 58).
I is possible o c ea e a ain- es spli o he da ase by using he unc ion ain_ es _spli om
Py hon’s lib a y sciki -lea n (“sklea n.model_selec ion. ain_ es _spli — sciki -lea n 0.23.2
documen a ion,” n.d.).
6
2.3.2. K- old C oss-Valida ion
K- old C oss-Valida ion is a mo e obus me hod o model e alua ion han T ain-Tes Spli . Tha is
because ins ead o a single ain- es spli , in c oss- alida ion, he model is ained and e alua ed
mul iple imes on di e en da a (B ownlee, 2019, p. 59).
In K- old C oss-Valida ion, he da ase is spli in o K-pa s o equal size. These pa s a e known as
olds. Then, he model is ained K imes. Each ime, he model is e alua ed based on only one old
and i is ained using he emaining olds. This p ocess is epea ed in such a way ha , by he end,
e e y old has pe o med he hole o alida ion da a once. In he end, he K- old C oss-Valida ion
me hod p o ides K di e en accu acy alues, ha can be summa ized using mean and s anda d
de ia ion (Mülle & Guido, 2016, p. 252).
Spli 1
Spli 2
T aining Da a
Spli 3
Spli 4
Tes Da a
Spli 5
Fold 1
Fold 2
Fold 3
Fold 4
Fold 5
Figu e 2-2 – Spli and old scheme o a 5- old c oss- alida ion example.
One o he posi i e aspec s o K- old C oss-Valida ion is ha di e ences in he aining and es se s
a e no as ha m ul as in T ain-Tes Spli . Fo example, suppose ha Fold 1 om Spli 1 has da a wi h a
e y dis inc pa e n when compa ed o Folds 2 o 5 also om Spli 1. This would a ec Spli 1
pe o mance sco e. Bu , by he ime he model is ained o he second ime wi h Spli 2, he
di e ences in Fold 1 a e inco po a ed in he aining da a and ep esen a mino pa o he aining
da a. Tha is some hing ha epea s h ough all he emaining spli s un il he end. The e o e, he
impac o di e ences in aining and es se s is minimized, esul ing in a much mo e s able
pe o mance sco e. The main nega i e aspec o K- old C oss-Valida ion is he compu a ional cos
since he model is ained K- imes ins ead o once (Mülle & Guido, 2016, p. 254).
I is possible o apply K- old c oss- alida ion by using he class KFold and he unc ion c oss_ al_sco e
om Py hon’s lib a y sciki -lea n (“sklea n.model_selec ion.KFold — sciki -lea n 0.23.2
documen a ion,” n.d.) (“sklea n.model_selec ion.c oss_ al_sco e — sciki -lea n 0.23.2
documen a ion,” n.d.).
7
2.3.3. Mul iple T ain-Tes Spli s (applied o Time Se ies)
K- old C oss-Valida ion is no eally sui ed o model e alua ion o ime se ies because i is a me hod
ha igno es he empo al componen s inhe en o he p oblem (B ownlee, 2018c, p. 145). T ain-Tes
Spli , on he o he hand, has he downside o high a iance when aining and es se s ha e
di e ences in da a (B ownlee, 2019, p. 58). So, o a Time Se ies Fo ecas ing p oblem, a mo e
app op ia e me hod o model e alua ion would be Mul iple T ain-Tes Spli s.
Mul iple T ain-Tes Spli s consis s o epea ing he p ocess o spli ing he da ase in o aining and
es se s se e al imes. In each i e a ion, he aining se ge s la ge and he es se emains he
same o he sake o compa abili y among he pe o mance sco es ob ained (B ownlee, 2018c, pp.
148, 149).
Figu e 2-3 - Mul iple T ain-Tes Spli s c ea ed by TimeSe iesSpli con igu ed o 5 spli s.
I is possible o c ea e mul iple spli s o a imes se ies by using he class TimeSe iesSpli om
Py hon’s lib a y sciki -lea n. The aining se size is calcula ed by he ollowing o mula
(“sklea n.model_selec ion.TimeSe iesSpli — sciki -lea n 0.23.2 documen a ion,” n.d.):
aining se size = (i * (samples / (spli s + 1))) + samples mod (spli s + 1)
Whe e i is he spli i e a ion, samples is he numbe o samples, and spli s is he numbe o spli s
desi ed. The pa samples mod (spli s + 1) is he emainde o he di ision o he numbe o samples
by he numbe o spli s plus one.
Meanwhile, he es se size is calcula ed as ollows (“sklea n.model_selec ion.TimeSe iesSpli —
sciki -lea n 0.23.2 documen a ion,” n.d.):
8
es index = samples / (spli s + 1)
Whe e samples is he numbe o samples and spli s is he numbe o spli s wan ed.
Below, an example o Mul iple T ain-Tes Spli s se o c ea e 5 spli s ou o a da ase wi h 988
obse a ions:
Figu e 2-4 - Example o 5 spli s c ea ed by TimeSe iesSpli .
2.4. PERFORMANCE METRICS
A Time Se ies Fo ecas ing p oblem is a eg ession p oblem. And a eg ession p oblem is ocused on
he p edic ion o eal alues. A di ec way o e alua e ime se ies o ecas s is based on he di e ence
be ween he p edic ed alues and he expec ed alues.
Th ee common pe o mance me ics o Time Se ies Fo ecas ing p oblems a e: Mean Absolu e E o ,
Mean Squa ed E o , and Roo Mean Squa ed E o .
2.4.1. Mean Absolu e E o (MAE)
The Mean Absolu e E o (MAE) is a pe o mance me ic calcula ed as he a e age o he absolu e
di e ences be ween he p edic ed alues and he expec ed alues. This measu e has as a posi i e
aspec he ac ha is simple and ha i indica es he magni ude o he e o . Howe e , i has as i s
nega i e aspec he ac ha i does no in o m he di ec ion o he e o , because he di e ences
a e being o ced as posi i e alues (B ownlee, 2019, p. 67) (Skiena, 2017, p. 221).

9
The Mean Absolu e E o is ep esen ed by he ollowing o mula:
mae = mean( abs( expec ed alues – p edic ed alues ) )
The Mean Absolu e E o can be calcula ed by he unc ion mean_absolu e_e o om Py hon’s
lib a y sciki -lea n (“sklea n.me ics.mean_absolu e_e o — sciki -lea n 0.23.2 documen a ion,”
n.d.).
2.4.2. Mean Squa ed E o (MSE)
The Mean Squa ed E o (MSE) is a pe o mance me ic calcula ed as he a e age o he squa ed
di e ences be ween p edic ed alues and he expec ed alues. As in MAE, he di e ences a e being
o ced o become posi i e alues bu , his ime, by squa ing and no by making hem absolu e.
Squa ing has he po en ial side e ec o ou lie s domina ing he e o s a is ics. The MSE me ic has
he bene i o la ge e o alues con ibu ing mo e o wo sening he pe o mance sco e. The e o e, i
is an in o ma i e measu e, especially, o noisy ins ances (B ownlee, 2019, p. 68) (Skiena, 2017, p.
222).
The Mean Squa ed E o is ep esen ed by he ollowing o mula:
mse = mean( (expec ed alues – p edic ed alues)ˆ2 )
The Mean Squa ed E o can be calcula ed by he unc ion mean_squa ed_e o om Py hon’s
lib a y sciki -lea n (“sklea n.me ics.mean_squa ed_e o — sciki -lea n 0.23.2 documen a ion,”
n.d.).
2.4.3. Roo Mean Squa ed E o (RMSE)
The Roo Mean Squa ed E o (RMSE) is a pe o mance me ic ha is simply he squa e oo o he
Mean Squa ed E o . The posi i e aspec o he RMSE is ha i is on he same scale as he o iginal
alues and, he e o e, i s magni ude is much mo e in e p e able (Skiena, 2017, p. 223).
The Roo Mean Squa ed E o is ep esen ed by he ollowing o mula:
mse = sq ( mean( (expec ed alues – p edic ed alues)ˆ2 ) )
10
The Roo Mean Squa ed E o can be calcula ed by he unc ion mean_squa ed_e o om Py hon’s
lib a y sciki -lea n. In ecen e sions o he sciki -lea n lib a y, in 0.23.1 o su e, unc ion
mean_squa ed_e o has a pa ame e called squa ed ha , when se o False, e u ns RMSE alue.
The de aul alue is T ue, hough. (“sklea n.me ics.mean_squa ed_e o — sciki -lea n 0.23.2
documen a ion,” n.d.).
2.5. MACHINE LEARNING MODELS
2.5.1. Linea Algo i hms
2.5.1.1. Linea Reg ession
The Linea Reg ession algo i hm uses a linea unc ion o he inpu a iables o make p edic ions.
Linea Reg ession is also known as O dina y Leas Squa es. In Linea Reg ession, he p edic ed alue
is hough as he weigh ed sum o he inpu a iables. Linea Reg ession can ep esen p edic ions as
a line o a single ea u e, as a plane o wo ea u es o as a hype -plane o mo e ea u es (Mülle &
Guido, 2016, pp. 45–47). The objec i e in Linea Reg ession is o ind he plane ha minimizes he
Sum o Squa ed E o s (SSE) be ween p edic ions and ue alues (Kuhn & Johnson, 2013, p. 105).
Linea eg ession has as posi i e aspec s he ac ha is easy o compu e and ha he coe icien s,
he weigh s in he sum o he inpu a iables, a e di ec ly in e p e able. Linea Reg ession has a
couple o es ic ions, hough. An inpu a iable canno be de e mined om a combina ion o one o
mo e o he o he inpu a iables (collinea i y). And he numbe o obse a ions mus be g ea e
han he numbe o inpu a iables. O he wise, i is impossible o each a unique linea combina ion
o he ea u es o ep esen he a ge (Kuhn & Johnson, 2013, p. 108). Since Linea Reg ession has
no pa ame e s, i has no way o con ol model complexi y (Mülle & Guido, 2016, p. 47).
2.5.1.2. LASSO Reg ession
LASSO (Leas Absolu e Sh inkage and Selec ion Ope a o ) Reg ession is ano he linea model o
eg ession. The p edic ion is also hough o as he weigh ed sum o he inpu a iables like in Linea
Reg ession. Howe e , he weigh s, which a e he coe icien s, a e no only chosen o p edic well on
aining da a bu also o espec a cons ain . The idea o ha ing a cons ain o con ol model
complexi y and o a oid o e i ing is known as egula iza ion (Mülle & Guido, 2016, p. 53).
In LASSO eg ession he cons ain es ic s he magni ude o he coe icien s o be close o equal o
ze o. This ype o egula iza ion, whe e he sum o he absolu e alues o he eg ession coe icien s
is penalized, is known as L1 egula iza ion. When he L1 egula iza ion o ces coe icien s o be ze o,
in p ac ice, he LASSO eg ession algo i hm is pe o ming a ea u e selec ion. Hence, he Selec ion
Ope a o in he name o he me hod. LASSO eg ession achie es bo h imp o ing he model quali y
and conduc ing a iable selec ion by applying L1 egula iza ion (Dino , 2018, p. 579).
11
2.5.2. Nonlinea Algo i hms
2.5.2.1. K-Nea es Neighbo s
The K-Nea es Neighbo s algo i hm can be applied o a classi ica ion (K-Neighbo s Classi ica ion) o a
eg ession (K-Neighbo s Reg ession) p oblem. I is a s aigh o wa d algo i hm, easy o in e p e , and
he main logic is he same o bo h cases. The aining phase consis s only o s o ing he da a poin s.
La e , o p edic , he algo i hm jus inds he k-closes da a poin s in he aining da a, which a e
conside ed he nea es neighbo s. In he simples e sion o he K-Neighbo s Reg ession, whe e K is
de ined as one, he p edic ion is jus he a ge alue o he nea es neighbo . When K is la ge han
one, he p edic ion is he mean o he K-nea es neighbo s (Mülle & Guido, 2016, pp. 35, 40, 41).
K-Nea es Neighbo s algo i hm can be applied h ough he KNeighbo sReg esso class o Py hon’s
sciki -lea n lib a y. The dis ance me ic used as de aul is he Minkowski dis ance, which is a
gene aliza ion o he Euclidean dis ance and he Manha an dis ance (B ownlee, 2019, p. 80). Since
he powe pa ame e o he Minkowski dis ance is se as 2 by de aul , he Euclidean dis ance is
applied i no o he wise con igu ed. When he powe pa ame e is se as 1, Manha an dis ance is
employed (“sklea n.neighbo s.KNeighbo sReg esso — sciki -lea n 0.23.2 documen a ion,” n.d.).
The posi i e aspec s o he K-Nea es Neighbo s algo i hm a e ha i is easy o unde s and and ha i
achie es easonable pe o mance sco es wi hou many adjus men s. These cha ac e is ics make i a
good baseline me hod. The downside o he K-Nea es Neighbo s algo i hm is ha i is no as when
he aining da ase is e y la ge, e en mo e, because i is an algo i hm ha equi es p e-p ocessing.
O he han ha , i is an algo i hm ha doesn’ deal well wi h a da ase whe e mos alues a e ze os
ei he (Mülle & Guido, 2016, p. 44).
2.5.2.2. Classi ica ion and Reg ession T ees
Decision T ees o Classi ica ion and Reg ession T ees (CART) is ano he algo i hm ha also can be
used o classi y o o p edic . Classi ica ion o nume ic p edic ion ees a e buil based on he same
logic. Mul iple i -else logical decisions a e used o pa i ion he da a ia a di ide-and-conque
s a egy based on ea u es (Dino , 2018, p. 373).
The Decision T ees algo i hm builds a ee h ough he ecu si e p ocess o sea ching o e all
possible spli s wi hin he da ase he one ha is mos in o ma i e abou he a ge a iable. The
ecu si e pa i ioning o he da a esul s in a ee o decisions ha has nodes and lea es. In
Reg ession T ees, nodes con ain es s like “is ea u e a la ge han alue b?”. Lea es a e e minal
nodes ha con ain answe s. In Reg ession T ess, o ins ance, a eg ession alue (Mülle & Guido,
2016, pp. 71–73).
The Decision T ees algo i hm has he upside o being easy o implemen and highly in e p e able.
Besides, decision ees can handle many di e en ypes o inpu a iables wi hou p e-p ocessing.
Decision ees can also handle missing alues and, because o he logic o build he ees, can
pe o m ea u e selec ion ei he . Howe e , decision ees do ha e nega i e aspec s. One o hem is
model ins abili y because mino changes in he da a can a ec he ee s uc u e, comp omising
in e p e abili y. Ano he one is p edic i e pe o mance. Decision ees will ha e la ge p edic ion
e o s i he ela ionship be ween inpu a iables and a ge a iables canno be ep esen ed as
ec angula subspaces o he inpu a iables (Kuhn & Johnson, 2013, p. 174).
12
2.5.3. Ensemble Algo i hms
2.5.3.1. Random Fo es
Random Fo es is an Ensemble me hod o he ype Bagging. A Bagging o a Boo s ap Agg ega ion
algo i hm ains he model mul iple imes based on subse s o he da ase . By he end, he p edic ion
is ob ained by a e aging all he esul s collec ed om he mul iple ained models. Th ough his
app oach, Bagging ies o educe he a iance o he p edic ion (B ownlee, 2019, p. 92).
The Random Fo es algo i hm is a gene aliza ion o he Bagging me hod applied o Decision T ees. In
Random Fo es , andomness is inse ed in he p ocess o building he decision ee. Ins ead o
choosing he bes spli poin om he en i e da ase , only a andom sample om he o iginal da a,
wi h eplacemen , is conside ed. The main idea is o use andom decision ees and, by doing so,
p o ide less co ela ion among di e en ensemble componen s (Agga wal, 2015, p. 380).
2.5.3.2. G adien Boos ing Machines
G adien Boos ing Machines a e an Ensemble me hod o he ype Boos ing. A Boos ing algo i hm
c ea es a sequence o models. The main idea is ha each subsequen model ies o co ec he
mis akes om he p e ious model (B ownlee, 2019, p. 94).
The basic p inciple o G adien Boos ing Machines is based on wo hings: a loss unc ion and a weak
lea ne . A loss unc ion is a measu e ha indica es how good a combina ion o he coe icien s i s
he da a (Mülle & Guido, 2016, p. 56). Fo ins ance, squa ed e o o eg ession. A weak lea ne is a
model ha can only p o ide good p edic ions on pa o he da a (Mülle & Guido, 2016, p. 89). Fo
ins ance, a shallow ee. The main goal o he algo i hm is o sea ch o an addi i e model ou o he
weak lea ne s ha can minimize he loss unc ion (Kuhn & Johnson, 2013, pp. 204–206).
G adien Boos ing Machines a e also e e ed o as S ochas ic G adien Boos ing bu , ac ually,
S ochas ic G adien Boos ing b ings a mino weak. I bo ows he idea o andom sampling he
aining da a om Bagging o educe p edic ion a iance (Kuhn & Johnson, 2013, pp. 204–206).
2.6. DEEP LEARNING
2.6.1. Neu al Ne wo ks
A i icial Neu al Ne wo ks o jus Neu al Ne wo ks a e a amily o Machine Lea ning algo i hms ha
encompasses di e en me hods like Mul ilaye Pe cep ons (MLP), Con olu ional Neu al Ne wo ks
(CNN), and Recu en Neu al Ne wo ks (RNN). Deep Lea ning and Neu al Ne wo ks a e conside ed o
be he same ield. Deep Lea ning is a kind o lea ning based on deep neu al ne wo ks, ne wo ks ha
ha e se e al s acked laye s o imp o e hei p edic i e capabili y (Skansi, 2018, p. p e ace V).
19
analyzing, no jus he algo i hmic and s a is ical aspec s. Da a Science co e s da a in eg a ion, da a
enginee ing, da a isualiza ion, Da a Mining, Business In elligence, e c. (G an ille, 2017). A success ul
da a scien is is compelled o see a business p oblem om a da a pe spec i e.
Al hough Da a Science is a comp ehensi e ield, mos o he a en ion o he scien i ic communi y
and o ganiza ions a e ocused on Machine Lea ning, pa icula ly on p edic i e analy ics. Machine
Lea ning is a kind o A i icial In elligence ha uses algo i hms o ex ac pa e ns ou o he da a.
These algo i hms can lea n om da a as hey a e being ained. In his p ocess o lea ning, hey can
imp o e hei pe o mance based on expe ience. In he end, a e ined model is achie ed ha can be
used o p edic ou comes om unseen da a based on he p e ious lea ning (Ki k, 2014, p. 2) (Bell,
2015, p. 2).
The e a e many use cases o Machine Lea ning in he ene gy and en i onmen sec o s, like using
p edic i e analy ics o pick he bes loca ion o wind a ms (Ha des y, 2015) o o analyze pollu ion
da a and make p edic ions abou ai quali y (IBM Resea ch Edi o ial S a , 2016). In eali y, he
con e gence o Machine Lea ning and he In e ne o Things leads o possibili ies ha bo h
echnologies alone could ne e achie e. Fo ins ance, Machine Lea ning allows IoT o p o ide AI-
powe ed analy ics pla o ms capable o con inuous analy ics, besides p edic i e and p esc ip i e
analy ics (Ruzicka, Law ence, Chaudh i, Jacque , & Smi h, 2018).
Since Da a Science popula i y is a ecen ac , some conce ns a e su ounding he ma e . The mos
common issue is ha some companies ha en’ ye ealized he bene i s o Da a Science. The e a e a
couple o easons o ha , like he lack o da a quali y, da a sca e ed in silos, ailu e o de ine a
p oblem o sol e, and insu icien skilled p o essionals (Ruzicka e al., 2018). In ac , he e is a
sho age o alen because good p o essionals mus be skilled in ma h, s a is ics, p og amming,
da abase, and business knowledge.
3.5. MARKET ANALYSIS AND BIG PLAYERS INITIATIVES
Al hough an ad anced ene gy managemen sys em is based on compu a ional in elligence om new
echnology, his is a om being he only eason why he ma ke does no p esen many op ions.
One o he eason migh be he di e ence in in es men s be ween Da a Science p ojec s o ien ed o
HVAC sys ems and indus ial sys ems. The e a e al eady applica ions in di e en indus y sec o s,
such as u bine con ol, p e en i e main enance, o o he p oduc ion p ocesses. Howe e , in he
case o HVAC sys ems, besides ele an expec a ions, mo i a ion, and scien i ic de elopmen on how
o apply Machine Lea ning echniques (Smi h & Lasch, 2016), he e a e no signi ican p oduc s
a ailable in he ma ke .
The eason why Da a Science p ojec s o indus ial sys ems a e p e e ed when i comes o
in es men s elies on he ac ha much o he esea ch is concen a ed in in ensi e applica ions o
capi al and ene gy, like manu ac u ing and ene gy p oduc ion. When HVAC sys ems a e compa ed
wi h his kind o applica ion, i does no p esen he same amoun o consuming no he same
po en ial e u n on in es men . On he o he side, he gene al dissemina ion o HVAC sys ems is
much g ea e , which means ha he sum o consump ion o all HVAC sys ems eaches ep esen a i e

20
ma ks. This makes alid any imp o emen in his ield and is s a ing o ca ch he a en ion o big
playe s om IT (In o ma ion Technology) and enginee ing.
Some companies a e al eady awa e o he bene i s o applying compu a ional in elligence o ene gy
managemen sys ems h ough IoT, Big Da a, and Da a Science ini ia i es. One good example is
Google ha h ough an a i icial in elligence esea ch p ojec called DeepMind uses an ensemble o
deep Neu al Ne wo ks o educe he ene gy bill o i s da a cen e s (E ans & Gao, 2016). Ano he
example comes om a pa ne ship be ween IBM (In e ne Business Machines) and in e na ional
esea che s o de elop a solu ion o ope a e HVAC sys ems in h ee majo comme cial buildings
loca ed in Hong Kong h ough Machine Lea ning echniques (Vishwana h, 2018).
3.6. AMBIOSENSING CONCEPTUAL ARCHITECTURE
Since he ma ke is absen in e ms o ene gy managemen sys ems o buildings ha in eg a e
compu a ional in elligence a compe i i e cos eady o wo k wi h HVAC o o he sys ems, he
Ambiosesing sys em is being de eloped o ill his gap.
Ambiosensing concep ual a chi ec u e is an ini ial e e ence o show he main componen s and
unc ionali ies o he sys em ega dless o any echnological speci ica ion. The p oposed a chi ec u e
is di ided in o laye s o be e designa e esponsibili ies and iden i y dependencies. Each laye has a
speci ic pu pose and uppe laye s can use lowe -laye se ices, bu no he o he way a ound.
21
Figu e 3-1 Ambiosensing Concep ual A chi ec u e
3.6.1. Base Pla o m
Figu e 3-2 - Base Pla o m Laye
3.6.1.1. IoT Connec i i y
The IoT Connec i i y componen allows de ices o connec o he Ambiosensing sys em ia In e ne
h ough IoT's mos common communica ion p o ocols, like HTTP (Hype ex T ans e P o ocol),
22
MQTT (Message Queuing Teleme y T anspo ) and CoAP (Cons ained Applica ion P o ocol). These
de ices could be senso s, ac ua o s, mic ocon olle s, o single-boa d compu e s like Raspbe y Pis.
3.6.1.2. S o age and Da a Managemen
The S o age and Da a Managemen module is no only esponsible o suppo da a s o age, bu also
o en o ce sui able access igh s and p ope p i acy le els. I has o keep eco ds o all eleme y da a
om en i onmen al a iables and all a ibu e da a om ene gy p o iles, cus ome s, asse s, de ices,
e c.
3.6.1.3. Da a Access Managemen
The Da a Access Managemen componen p o ides con ol o e use and da a se ices accesses.
Th ough he con igu a ion o access policies, i g an s co ec use igh s o he da abase.
3.6.1.4. En i onmen al Da a Acquisi ion Managemen
The En i onmen al Da a Acquisi ion Managemen module is esponsible o con igu ing da a
collec ion o en i onmen a iables. Each en i onmen a iable eading can ha e a di e en
equi emen in e ms o pe iodici y o measu ing uni .
3.6.1.5. En i onmen al Va iables Con ol
The En i onmen al Va iables Con ol componen is esponsible o main aining he ela ionship
be ween inpu s (en i onmen a iables) and de ices. A de ice can ha e di e en ypes o senso s
a ached o i and e en mo e han one senso a a ime. So, a single de ice can be able o egis e
di e en en i onmen a iables.
3.6.1.6. Ene gy Equipmen Managemen
The Ene gy Equipmen Managemen uni is accoun able o acili a ing equipmen con igu a ion and
adminis a ion. I p o ides an equipmen ca alog o egis e and o ganize all connec ed de ices. I is
impo an o no ice ha some de ices, such as senso s and Raspbe y Pi’s, can be pu oge he and
can ha e an abs ac ed ep esen a ion as a single de ice o he Ambiosensing sys em. The capabili y
o manage all hese kinds o equipmen ela ionships is he esponsibili y o he Ene gy Equipmen
Managemen componen .
23
3.6.1.7. So wa e Se ices Managemen
The Ambiosensing sys em p o ides a ca alog o web se ices o make unc ionali ies suppo ed by
lowe -laye componen s a ailable o uppe laye modules. These web se ices also g an o
Ambiosensing he abili y o ex e nalize unc ionali ies o o he sys ems. The So wa e Se ices
Managemen module p o ides no only adminis a ion capabili ies o e hese web se ices bu also
documen a ion like web se ices speci ica ion ( eques syn ax and pa ame e s, esponse messages,
e c.).
3.6.2. Supe ision Se ices
Figu e 3-3 - Supe ision Se ices Laye
3.6.2.1. Use Regis a ion and Managemen
The Use Regis a ion and Managemen componen is esponsible o use adminis a ion. I
p o ides he Ambiosensing sys em wi h he capabili y o manage use p o iles and p e e ences and
also o g oup use s acco dingly wi h common aspec s.
3.6.2.2. Basic P o iles Managemen
The Basic P o iles Managemen module allows adminis a ion o e ope a ing p o iles o spaces.
These p o iles a e c ea ed by an adminis a o use and can be based on speci ics such as ype o use
24
(e.g. o ice, s o e, wa ehouse, e c.), numbe o occupan s, schedules, and o he impo an
in o ma ion ha migh help o adjus he con olled en i onmen al a iables.
3.6.2.3. Analysis and Decision Suppo
The Analysis and Decision Suppo uni p o ides he needed mechanisms so he use can analyze he
ope a ion o a space and, in his way, can be able o make wise decisions ha con ibu e o less
ene gy consump ion. All his is achie ed h ough c oss- e e encing en i onmen al a iable measu es
and da a o equipmen in ope a ion. The Analysis and Decision Suppo module also allows he use
o keep ack o he ene gy-sa ing p o ided by he sys em h oughou i s ope a ion.
3.6.2.4. His o ical Da a Managemen
The His o ical Da a Managemen componen is esponsible o he adminis a ion o eleme y da a
collec ed and s o ed in he sys em. This ime-se ies da a can be om en i onmen al a iables
eadings o e en s ha occu ed in he sys em. No ma e wha sou ce, his o ical da a ends o be a
la ge amoun o da a wi h ime and needs o be managed acco dingly o a li ecycle. This means ha ,
when his o ical da a ge s huge, he sys em can “ e i e” he da a by one o he wo ollowing
s a egies: da a agg ega ion (e.g. old da a s o ed by he minu e is agg ega ed by he hou ) o
changing da a s o age ype (e.g. wi hd aw da a om da abase and s o e i on iles).
3.6.2.5. Basic In elligen Supe ision
The Basic In elligen Supe ision uni is composed o h ee modules: Planning, Moni o ing, and
Failu e De ec ion and Reco e y. The Planning componen allows he se ing o an ope a ional plan
based on sys em pa ame e iza ions done by an adminis a o use . This plan mus be pu in place
and ha e di ec in e ac ion wi h en i onmen al a iables, bo h in acquisi ion and in e en ion. The
Moni o ing module enables ope a ional plan moni o ing based on ini ially de ined pa ame e s,
making i possible o de ec de ia ions om he co ec ope a ion. The Failu e De ec ion and
Reco e y componen is esponsible no only o de ec ing ope a ions beyond a p e-de ined
accep ance h eshold by also o p o iding eco e y capabili ies. Failu e eco e ies could be achie ed
by ollowing a eco e y plan ini ially se on he sys em along wi h he ope a ional plan o by he
in e en ion o a human ope a o wi h he app op ia e use igh s o do so.
3.6.3. Ad anced Se ices

25
Figu e 3-4 - Ad anced Se ices Laye
3.6.3.1. Ad anced P o iles Managemen
The Ad anced P o iles Managemen module p o ides sugges ions o he bes ope a ing p o ile o
spaces conside ing he cu en condi ion in which he Ambiosensing sys em is wo king. The
Ad anced P o iles Managemen di e en ia es i sel om Basic P o iles Managemen om
Supe ision Se ices in he sense ha i s sugges ions a e gene a ed au oma ically by he sys em
aking in o conside a ion se e al pa ame e s ha may in e e e wi h con olled en i onmen al
a iables. In Basic P o iles Managemen i is up o an adminis a o use o c ea e he ope a ing
p o ile o spaces. The Ad anced P o iles Managemen can be se o un au oma ically o by use
con i ma ion.
3.6.3.2. Ala ms and Recommenda ion Sys em
The Ad anced and Recommenda ion Sys em componen is esponsible o de ec ing si ua ions ha
migh aise an ala m based on da a analysis om eleme y and e en da a. The Moni o ing module
om he Basic In elligen Supe ision uni wo ks closely wi h he Ala ms and Recommenda ion
Sys em componen . E e y imp ope ope a ion is lagged and an ala m is sen o he mos sui able
use in o ming wha happened and he ecommended measu es.
3.6.3.3. Simula ion o Scena ios
The Simula ion o Scena ios module p o ides he Ambiosensing sys em wi h he capaci y o doing
simula ions on possible u iliza ion scena ios o a space. This way i is possible o an icipa e and
elabo a e ope a ing s a egies ha a e mos sui able o he desi ed condi ions. The Simula ion o
26
Scena ios allows o assay he use o exis ing and desi ed equipmen along wi h di e se ope a ion
condi ions.
3.6.3.4. Audi and Repo ing
The Audi and Repo ing componen allows adminis a o use s o ollow sys em ope a ions and o
ack ac ions and con igu a ions done by use s in he sys em. Th ough he use o dashboa ds, i is
possible o analyze he sys em's ope a ional s a us. And, using epo ing, i is possible o e iew he
oo p in s ha each use has le in he sys em, g an ing audi capabili ies o Ambiosensing sys em.
This audi ing compe ence o he Ambiosensing sys em is con igu able acco dingly o he local legal
egula ions om whe e he sys em is being implan ed.
3.6.3.5. Sel -Adap i e Ene gy and Pe o mance Managemen
The Sel -Adap i e Ene gy and Pe o mance Managemen module allows he sys em o iden i y
speci ic ci cums ances in which i s ope a ion in no longe he mos sui able one and i is s ill possible
o adap i s ope a ional p o ile o op imize pe o mance. I is only possible o iden i y hese
si ua ions h ough he use o in elligen se ices moni o ing con inuously cu en eleme y da a. The
sys em also uses his o ical eleme y da a o de ine a pe o mance baseline and o e alua e whe he
an ope a ional p o ile adap a ion will ha e a eal ad an age o no . In cases whe e a change in he
ope a ional p o ile is bene icial, i may occu au oma ically o by he consen o a p ope ly g an ed
use .
3.6.3.6. Ene gy Pe o mance Pa e n Analysis
The Ene gy Pe o mance Pa e n Analysis componen is esponsible o analyzing sys em ope a ion
and de ec ope a ion pa e ns di ec ly co ela ed wi h ene gy pe o mance. To be able o do so, he
Ambiosensing sys em e alua es en i onmen al a iables, equipmen se ups, spaces a ibu es, and
o he impo an a iables ha may in e e e in he balance o occupan well-being and ene gy
consump ion. Based on his assessmen , he sys em iden i ies and classi ies ene gy pe o mance
pa e ns and co esponding ope a ional p o iles.
3.6.4. Ambiosensing Applica ions
The op laye in Ambiosensing Concep ual A chi ec u e is Ambiosensing Applica ions. This
componen is composed o in e ac ion applica ions designed o end-use s ha allow execu ion o
Ambiosensing sys em use cases such as:
§ Se up en i onmen al a iables;
§ Se up senso s;
§ Se up ac ua o s;
§ Se up building plan s (spaces);
27
§ C ea e ene gy p o iles;
§ Manage ene gy p o iles;
§ Moni o en i onmen al a iables;
§ Moni o senso s;
§ Moni o ac ua o s;
§ Analyze ene gy beha io ;
§ Visualize ala ms;
§ Que y his o ical da a;
§ Simula e scena ios;
§ P edic scena ios;
§ Gene a e audi epo s;
§ Gene a e ene gy consump ion dashboa ds;
§ Regis e use p e e ences;
§ Manage use s.
3.7. DATA COLLECTION AND AMBIOSENSING OVERVIEW
One o he g ea es challenges o he Ambiosensing p ojec is da a collec ion. Hope ully, ecen
echnological de elopmen s in IoT and Big Da a con ibu ed o ad ances in mul iple compu a ional
asks needed o de ice communica ion and coo dina ion and da a p ocessing and s o age. De ini ely,
he eme gence o IoT pla o ms and Big Da a amewo ks o dealing wi h massi e amoun s o da a
and compu a ion a e among hese ecen echnological b eak h oughs.
The Ambiosesing sys em consis s, basically, o wo ypes o ha dwa e: he Ambiosensing de ices and
he Ambiosensing cen al uni . Ambiosensing de ices a e sca e ed a ound he en i onmen in which
hey a e ope a ing and can ha e up o wo oles: senso and ac ua o . Ambiosensing cen al uni is a
componen o he g ea es impo ance. As he name implies, i is a undamen al module whe e all
eleme y da a is consolida ed o s o age, p ocessing, and analysis.
Ambiosensing de ices ha e as hei main goal he cap u ing o elec ic signals om senso s a ached
o i and he con e sion o hese signals o digi al alues acco dingly o p e-de ined measu emen
uni s. Fo ins ance, in case o empe a u e o Celsius deg ee, in case o ela i e humidi y o
pe cen age and in case o luminosi y o lux (lux is he uni om he In e na ional Sys em o Uni s o
measu e luminous lux pe uni a ea) (“IEC 60050 - In e na ional Elec o echnical Vocabula y - De ails
o IEV numbe 845-01-52: ‘lux,’” n.d.). Ambiosensing de ices ha e some da a agg ega ion and
s o age capaci y especially use ul in case o ne wo k ailu e. Howe e , i s p ocessing powe is no
sui able o he amoun o da a o be handled and, as such, i is expec ed ha Ambiosensing de ices
send eleme y da a o Ambiosensing cen al uni . Figu e 3-5 shows a schema o an Ambiosensing
de ice wi h h ee senso s a ached o i : luminosi y, humidi y, and empe a u e senso s. An
Ambiosensing de ice is composed also o a con olle elemen , which is, usually, a Raspbe y Pi
single-boa d compu e .
28
Figu e 3-5 - Ambiosensing De ice
Ambiosensing cen al uni is no only esponsible o collec ing eleme y da a om all de ices ha
a e p esen in a moni o ed space. Ambiosensing cen al uni is also in cha ge o dispa ching
commands o con ol equipmen ha a ec s he con olled en i onmen , such as HVAC sys ems.
Since Ambiosensing cen al uni mus pe o m many IoT unc ions, such as collec and s o e
eleme y da a and p o ision, moni o and con ol IoT de ices, i makes sense ha pa o he
Ambiosensing cen al uni is composed o an IoT pla o m. Howe e , as he Ambiosensing cen al
uni has goals ha exceed he IoT pla o m's capabili ies, i canno be comple ely based on an IoT
pla o m. An IoT pla o m may co e all modules om he Base Pla o m laye o he Concep ual
A chi ec u e and e en a couple o componen s om Supe ision Se ices and Ad anced Se ices
laye s, such as Use Regis a ion and Managemen and Audi and Repo ing, espec i ely. Figu e 3-6
p esen s Ambiosensing cen al uni and Base Pla o m se ices and some op laye s se ices as pa
o an IoT Pla o m.
35
lib a y Numpy (“NumPy Manual,” n.d.) was applied o do calcula ions on he da ase and Py hon’s
lib a y sciki -lea n (“Sciki -lea n Documen a ion,” n.d.) p o ided mos o he Machine Lea ning
algo i hms.
O iginally, he aw da a we e p esen ed as he ollowing da ase :
Figu e 4-3 - O iginal da ase .
The ollowing da a ans o ma ions we e done in da a loading as an ini ial da a p epa a ion:
§ Da e con e ed om Linux imes amp o da e;
§ Key and Value columns we e pi o ed o deno malize he da ase .
A e ini ial da a ans o ma ions, he da ase was p esen ed as ollows:
Figu e 4-4 - Da ase a e ini ial da a p epa a ion.
Below, a b ie explana ion o each da ase a iable:
§ C2H5OH – E hanol gas measu e in ppm;
§ C3H8 – P opane gas measu e in ppm;
§ C4H10 – Iso-bu ane gas measu e in ppm;
§ CH4 – Me hane gas measu e in ppm;
§ CO – Ca bon Monoxide gas measu e in ppm;
§ CO2 – Ca bon Dioxide gas measu e in ppm;
§ Celsius – Tempe a u e in Celsius deg ee;
§ Fah enhei – Tempe a u e in Fah enhei deg ee;
§ H2 – Hyd ogen gas measu e in ppm;
§ Humidi y – Rela i e humidi y in % (pe cen age);
§ NH3 – Ammonia gas measu e in ppm;
§ NO2 – Ni ogen Dioxide gas measu e in ppm;
§ P essu e – A mosphe ic p essu e in he equi alen uni s hPa (hec opascal) o mba (milliba ).

36
The da ase has da a om July 23 d o 2019 o Jan 23 d o 2020, esul ing in a o al o 228.307
obse a ions.
4.3.2. Da a Checking and Da a Cleansing
The Da a Checking and Da a Cleansing s ep has he objec i e o inspec he da ase and emo e da a
collec ed inaccu a ely.
By simply checking he a e age and he coun by day o some ea u es, like o ins ance Celsius, ha
ep esen s indoo ambien empe a u e, i was possible o ind some possible gaps in da a collec ion.
In he i s mon hs o he Ambiosensing p ojec , he collec o p og am de eloped in Py hon ha goes
inside he de ices wi h all he logic o collec ing and sending da a o he IoT pla o m Thingsboa d
lacked local s o ing capabili y and, because o ha , i didn’ ha e a aul - ole an mechanism
implemen ed. La e in he p ojec , i was co ec ed, bu , by hen, he da ase al eady had wo gaps o
da a o some days ha had o be ea ed in he Missing Values T ea men s ep o he Da a Science
amewo k.
The e we e wo gaps in he da ase . One o se en days om Augus 16 h o Augus 23 d o 2019 and
ano he one o se en een days om Decembe 29 h o 2019 o Janua y 15 h o 2020.
Ano he issue also con ibu ed o inaccu a e da a collec ion. The G o e Mul ichannel Gas senso
om he Ambiosensing De ice has a unique cha ac e is ic. I needs some ime o wa m up. Un il
hen, eadings a e e y e a ic. Because o ha ini ial eadings o he da ase and eadings igh a e
he wo da a gaps we e inspec ed ca e ully. July 23 d, he ini ial da e o da a collec ion, had e y ew
obse a ions since he de ice was u ned on la e a nigh . July 24 h had a lo o disc epancies because
he senso was s ill wa ming up. Because o ha , da a om July 23 d and 24 h we e emo ed om he
da ase . Since da a cap u e was esumed om da a gaps on Augus 23 d o he i s one and on
Janua y 15 h o he second one, hose days we e also emo ed om he da ase o a oid comple ely
inaccu a e da a.
4.3.3. Missing Values T ea men
The Missing Values T ea men s ep aims o handle missing alues by illing hem wi h da a. Because
o he unexpec ed wo da a collec ion in e up ions explained in he Da a Checking and Da a
Cleansing s ep, he da ase equi ed a consis en da a impu a ion. The Missing Values T ea men
s ep was di ided in o h ee pa s: da ase p epa a ion, a s udy o he mos app op ia e da a
impu a ion me hod o each ea u e, and da a impu a ion i sel .
Fi s , he da ase needed o be p epa ed o da a impu a ion. New eco ds we e c ea ed o he wo
missing ime ames wi h null alues by he minu e, almos as i should be i da a we e cap u ed
co ec ly. Besides ha , all o he a iables, like he da e- ime ea u es u he explained in he
Fea u e Enginee ing s ep, we e also c ea ed. In he end, he obse a ions gene a ed we e jus like
he ones cap u ed om senso s, wi h he same da a ypes, in he igh o de , bu wi h null alues.
37
Figu e 4-5 - Da a cap u ed om he senso s.
Figu e 4-6 - Da a gene a ed o da a impu a ion.
A e da ase p epa a ion, some da a impu a ion me hods o ime se ies we e es ed. A sec ion o
he da ase wi hou missing alues was ex ac ed and ans o med o pe o m he es s. The idea
behind his e alua ion is o hide he known alues, execu e he da a impu a ion me hods on ake
missing alues, and hen compa e he esul s o he di e en me hods wi h he o iginal non-null
alues. In he end, he mos e ec i e me hod o da a impu a ion in ime se ies should be
de e mined o each ea u e.
S eps aken o es di e en da a impu a ion me hods:
1. The da ase was il e ed. Only a sample o he da ase was selec ed o be es ed. A sample o
50.000 ows was aken;
2. The da ase sample was spli in o h ee pa s o c ea e he missing alues obse a ions in he
middle one (ou o he 50.000 ows, he i s and he las 20.000 we e no ans o med, only
he 10.000 in be ween we e ans o med o null alues in e e y ea u e);
Figu e 4-7 - Da ase wi h o iginal columns and null columns. Fi e ows ou o he 10.000 ans o med.
38
Figu e 4-8 - Da ase wi h o iginal columns and eplica ed columns unal e ed. Fi e ows ou o he
40.000 no ans o med.
3. The da ase sample was joined back oge he o c ea e he whole es sample;
By his poin , o e e y ea u e, he e we e wo columns: one wi h he o iginal alue and a
eplica “_ es ” column wi h missing alue i p e iously ans o med o wi h he o iginal alue
i no .
4. Fo e e y ea u e, he o iginal column was aken as e e ence and he eplica “_ es ” column
was se as he a ge ;
5. Da a illed using mean and median;
6. Da a impu ed using he olling a e age;
7. Da a impu ed using he olling median;
8. Da a impu ed using in e pola ion wi h di e en me hods: linea , ime, quad a ic, cubic,
slinea , akima, polynomial o o de 5 and 7, spline o o de 3, 4 and 5;
9. The esul s we e sco ed using sciki -lea n me ic R2 sco e and a able was c ea ed wi h he
op esul by ea u e.
Below, an example o a ea u e be o e and a e da a impu a ion (sample da ase ):
39
Figu e 4-9- Sample da ase o Celsius ea u e be o e da a impu a ion.
Figu e 4-10 - Sample da ase o Celsius ea u e a e da a impu a ion.
In he las pa o he Missing Values T ea men s ep, da a impu a ion was applied o he whole
da ase ollowing he able c ea ed wi h he me hod wi h he highes sco e by ea u e.
40
Table 1 - The bes me hod o each ea u e by R2 sco e.
Below, an example o a ea u e be o e and a e da a impu a ion (whole da ase ):
Figu e 4-11- Whole da ase o Celsius ea u e be o e da a impu a ion.

41
Figu e 4-12 - Whole da ase o Celsius ea u e a e da a impu a ion.
A e he emo al o ini ial eadings and o he i s eadings igh a e he iden i ied da a gaps, he
da ase was educed. A e he i s pa o da a impu a ion, he da ase p epa a ion o ecei e
impu ed alues, he da ase was inc emen ed. O iginally wi h 228.307 ows, a e hese wo s eps,
he da ase had 263.357 obse a ions. Ou o hese 263.357 eco ds, 37.440 had missing alues. So,
he missing alues accoun ed o 14,22% o he da ase . The Missing Values T ea men s ep
elimina ed all null alues om he da ase .
4.3.4. Ou lie s T ea men
The Ou lie s T ea men s ep has he objec i e o de ec and eplace da a poin s ha di e
signi ican ly om o he obse a ions. The Ou lie s T ea men s ep was di ided in o h ee pa s:
ou lie s iden i ica ion, ou lie s emo al, and da a impu a ion pos ou lie s ea men . The main idea
behind dealing wi h ou lie s is o pinpoin ou lie s h ough he applica ion o a s a is ic me hod
called IQR (In e qua ile Range). A e ha , o dele e ou lie s, hey we e simply eplaced wi h null
alues. As he las s ep in he p ocess o ea ing ou lie s, null alues we e eplaced h ough da a
impu a ion ollowing he same op ecommended me hod o each ea u e as iden i ied in he
Missing Values T ea men s ep.
S eps aken o de ec and eplace ou lie s:
1. Since he Da a Science p ocess was conduc ed using Py hon, he da ase was con e ed om
a Pandas da a ame o h ee Numpy a ays. The i s and las Numpy a ays con ained
a iables wi hou he possibili y o ha ing ou lie s;
2. A unc ion o iden i y ou lie s and eplace hem wi h null alues was de eloped;
a. The IQR was calcula ed as he di e ence om pe cen ile 75 h and 25 h;
IQR = Q75 – Q25
42
b. The ou lie cu o was calcula ed as he mul iplica ion o IQR by a ac o K and he
lowe and uppe bounda ies we e es ablished like pe cen ile 25 h minus he cu o
and pe cen ile 75 h plus he cu o , espec i ely;
cu o = IQR * k
lowe = Q25 – cu o
uppe = Q75 + cu o
Obs.: Usually, he K ac o is se as 1.5 o ou lie s and 3 o ex eme ou lie s (Tukey,
1977, p. 44). In his case, a K ac o o 3 was used.
c. Values lesse han he lowe cu o o la ge han he uppe bounda y we e iden i ied
as ou lie s and eplace by null alues.
3. Va iables likely o ha e ou lie s om he Numpy a ay in he middle we e i e a ed and he
unc ion was applied;
4. A e de ec ing and emo ing he ou lie s, he Numpy a ays we e conca ena ed back
oge he ;
5. The esul ing Numpy a ay was con e ed back o a Pandas da a ame.
6. As a inal s ep, da a and da a ypes we e double-checked o make su e ha he inal da ase
was equi alen o he ini ial one, bu wi hou ou lie s.
The las pa o Ou lie s T ea men s ep is o impu e da a whe e once we e he ou lie s and now
missing alues can be ound. By applying, o each ea u e, he op- ecommended me hod o da a
impu a ion, almos all missing alues c ea ed by ou lie s emo ing ha e been eplaced by a
consis en alue. An in e es ing ac mus be highligh ed. Because h ee ea u es, C3H8, C4H10, and
CH4 gases’ eadings p esen ed ou lie s in he ini ial o he da ase , he null alues ha eplaced he
ou lie s a he beginning o he da ase we e no changed by he op- ecommended me hod o da a
impu a ion. Tha occu ed because he op me hod in all h ee cases was he slinea me hod, a kind
o in e pola ion. And in e pola ion me hods c ea e a b idge be ween he wo edges da a poin s in
he da a gap. Wi hou he i s edge da a poin om he da a gap, i is no easible o use
in e pola ion. Fo ha eason and because ou lie s we e no in place anymo e, o ill he null alues
om he beginning o he da ase o ea u es C3H8, C4H10, and CH4, he median o each se ies was
applied as a da a impu a ion me hod.
43
Table 2 - Fea u es and he numbe o null alues a e da a impu a ion i s and second i e a ions.
4.3.5. Desc ip i e S a is ics
The Desc ip i e S a is ics s ep has he objec i e o p esen a s a is ical summa y o each ime-se ies
ea u e. Eigh s a is ical p ope ies a e showed: coun , mean, s anda d de ia ion, minimum alue,
25 h pe cen ile, median, 75 h pe cen ile, maximum alue.
Figu e 4-13- Time-se ies ea u es summa y s a is ics.
4.3.6. Da a Visualiza ion
The Da a Visualiza ion s ep has as objec i e o be e unde s and he da ase by analyzing g aphically
one ea u e a a ime and o iden i y empo al s uc u es like ends, cycles, and seasonali y.
44
Fi e di e en ypes o plo s we e employed: line plo , his og am, box and whiske plo (by mon h),
lag sca e plo , and au oco ela ion plo . Line plo s we e used o analyze all he obse a ions o each
ea u e by ime o de ec end and seasonali y. His og ams we e u ilized o e alua e, wi hou he
empo al o de ing, he dis ibu ion o obse a ions o each inpu a iable. On he o he hand, box
and whiske plo s we e applied o examine he dis ibu ion o alues by ime in e al. In his case, by
mon h. Lag sca e plo s we e used o explo e he ela ionship be ween each obse a ion and i sel
om a p e ious imes ep. Finally, au oco ela ion plo s we e employed o quan i y he s eng h and
ype o ela ionship be ween obse a ions and hei lags (B ownlee, 2018c, p. 50).
As an example, below all i e plo s om ea u e Celsius:
Figu e 4-14 - Fea u e Celsius line plo .
Figu e 4-15 - Fea u e Celsius his og am.
51
Figu e 4-29- Da ase a e da a ans o ma ions o ea u e selec ion. Va iables om he beginning o
he da ase .
Figu e 4-30- Da ase a e da a ans o ma ions o ea u e selec ion. Va iables om he end o he
da ase .
4.3.8.1. Fea u e Selec ion o All Va iables
A e ge ing he da ase eady, all a iables we e ed o he Random Fo es model and he ea u e
impo ance sco es we e ob ained.
Below, a able wi h all he ea u es and hei espec i e ea u e impo ance sco es.

52
Table 3 - Fea u es and ea u e impo ance sco es.
Nex , wo plo s wi h ea u e impo ance sco es, he i s one wi h all he ea u es and he second one
wi h he op wo ea u es by impo ance aken ou o a clea pe spec i e o o he a iables.
53
Figu e 4-31- Fea u es x Fea u e Impo ance Sco es.
Figu e 4-32 - Fea u es x Fea u e Impo ance Sco es (wi hou op wo ea u es).
A e ea u e impo ance analyzes, ea u e selec ion was pe o med. An RFE (Recu si e Fea u e
Selec ion) algo i hm om Py hon’s lib a y sciki -lea n was used. RFE algo i hm demands a p edic i e
model and again a Random Fo es model was employed (B ownlee, 2019, p. 53).
54
Below, he lis o selec ed ea u es and a plo wi h hei anks.
Figu e 4-33- Lis o selec ed ea u es by he RFE algo i hm.
Figu e 4-34 - Fea u es x Fea u e Ranks by RFE algo i hm (lowe is be e ).
By he na u e o some selec ed ea u es, hey seem o be highly co ela ed. So, be o e he inal se o
ea u es, a co ela ion analysis was ca ied ou . Since Pea son’s co ela ion coe icien assumes a
no mal dis ibu ion o he a ibu es (B ownlee, 2019, p. 35) and since he selec ed ea u es didn’
p esen his cha ac e is ic, as can be seen in he his og ams below, Kendall’s co ela ion coe icien
was applied (Dalgaa d, n.d., p. 124).
55
Figu e 4-35 - His og am o selec ed ea u es.
Below, he co ela ion ma ix c ea ed using Kendall’s co ela ion coe icien .
56
Figu e 4-36 - Co ela ion ma ix.
A e analyzing he co ela ion ma ix, some insigh s we e ex ac ed:
1. Da e is highly co ela ed o Da e_Pe iod and i should be emo ed om he selec ed
ea u es;
2. C2H5OH is highly co ela ed o CO and CO has a bigge impo ance sco e. So, C2H5OH should
also be emo ed om he selec ed ea u es;
3. C4H10 is highly co ela ed o C3H8 and C3H8 has a bigge impo ance sco e. So, C4H10
should be emo ed oo om he selec ed ea u es;
4. Las ly, H2 is highly co ela ed o CO and CO has a bigge impo ance sco e. So, H2 should be
emo ed as well om he selec ed ea u es.
A e inishing he Fea u e Selec ion o All Va iables pa , he da ase was p esen ed as ollows:

57
Figu e 4-37 - Final da ase o Deep Lea ning models.
In he end, he inal da ase had 1.098 obse a ions, en ea u es, and he a ge a iable. This
da ase was la e used wi h he Deep Lea ning models.
4.3.8.2. Complemen a y Fea u e Selec ion o Lag Fea u es
The complemen a y ea u e selec ion was ocused only on he lag ea u es o he Machine Lea ning
models o he han Deep Lea ning. As explained in mo e de ail in he Fea u e Enginee ing s ep, hese
models ha e o ha es empo al con ex ou o lag ea u es. The complemen a y ea u e selec ion
objec i e is o de ine which lag ea u e should be added o he p e iously selec ed ea u es.
Di e en ly om he ea u e selec ion conduc ed p e iously o all a iables, ea u e impo ance
sco es, and ea u e selec ion anks we e no calcula ed immedia ely. Since he complemen a y
ea u e selec ion is abou lag ea u es, i s , lag a iables we e e alua ed wi h he help o an
au oco ela ion plo . Also, be o e explo ing lag ea u es h ough an au oco ela ion plo , ime-se ies
componen s like end o seasonali y we e emo ed i p esen (B ownlee, 2018c, p. 131).
Below, a plo o he comple e se ies o he a ge a iable Celsius.
Figu e 4-38 - Celsius ea u e se ies.
58
As can be seen om he plo , he Celsius se ies p esen s a dec easing end. Because o ha , o
emo e he end om he Celsius se ies he di e encing me hod was applied (B ownlee, 2018c, p.
114).
A e emo ing he end componen , he Celsius se ies was p esen ed as ollows:
Figu e 4-39- Celsius ea u es se ies a e end emo al.
Once he Celsius se ies didn’ p esen a end anymo e, i was possible o c ea e he au oco ela ion
plo .
Nex , he au oco ela ion plo s o he wo hund ed i s da a poin s o he Celsius se ies.
59
Figu e 4-40 - Au oco ela ion plo o he 200 i s da a poin s o he Celsius ea u e.
Since he do s below o abo e he blue a ea indica e s a is ical signi icance, he co ela ed da a poin
ha las s he longes is da a poin 36. I ep esen s a posi i e co ela ion. As each six da a poin s
ep esen one day, his means ha he empe a u e om 6 days be o e s ill has some deg ee o
co ela ion. A e his impo an conclusion, he Celsius se ies was ans o med in o he da ase
showed below wi h imes eps -36, -35,… , -2, -1, and . This da ase was used o pe o m bo h
ea u e impo ance sco ing and ea u e selec ion anking a e wa d.
Figu e 4-41 - Celsius se ies wi h he oldes lag ea u es.
60
Figu e 4-42 - Celsius se ies wi h he mos ecen lag ea u es.
A e ge ing he da ase eady, he whole p ocess o calcula e ea u e impo ance sco es and
ea u e selec ion anks was epea ed jus like i has been done in he ea u e selec ion o all
a iables.
Below, a able wi h all he ea u es and hei espec i e ea u e impo ance sco es.
67
Spli 2
T aining
(332, 7)
Valida ion
(164, 7)
Spli 3
T aining
(496, 7)
Valida ion
(164, 7)
Spli 4
T aining
(660, 7)
Valida ion
(164, 7)
Spli 5
T aining
(824, 7)
Valida ion
(164, 7)
Table 7 - Shapes o mul i a ia e mul iple pa allel se ies LSTM da ase s.
The inpu se s we e all in he shape (n, 7). The ou pu se s we e also in he same o ma . In his case,
he e a e mul iple inpu se ies and mul iple ou pu se ies. So, he ou pu se s had no only he
ea u e Celsius bu all ime se ies a iables.
4.3.9.2. Model E alua ion
La gely used on di e en ypes o p oblems, k- old c oss- alida ion is no eally sui ed o ime se ies
o ecas ing. Tha is because i igno es he empo al componen . Fo ins ance, by he ime a old om
he middle o he da ase is aken as he alida ion da ase , he aining da ase emains wi h a
conside able da a gap. So, o e alua e ime se ies o ecas ing models consis en ly, a TimeSe iesSpli
objec om Py hon’s lib a y sciki -lea n was used o c ea e mul iple ain- es spli s.
The TimeSe iesSpli objec was applied o c ea e i e spli s ha di e in he numbe o obse a ions
used o ain he model. Each ollowing spli has a la ge aining da ase o wo k wi h as can be seen
in he ollowing pic u e. The alida ion da ase emains wi h he same amoun o da a on e e y spli :

68
Figu e 4-51 - Fi e spli s o he da ase o a uni a ia e LSTM NN.
As an example, below, he i e spli s om he uni a ia e LSTM neu al ne wo ks:
Figu e 4-52 - Plo s o i e spli s o he da ase o a uni a ia e LSTM NN. Each ollowing spli wi h a
li le mo e da a o aining han he p e ious.
Be o e TimeSe iesSpli objec be used o c ea ed mul iple aining and alida ion se s, a es se was
spli ou o he da ase as a holdou . The idea is o u ilize aining and alida ion se s as a kind o
ime-se ies c oss- alida ion and o ha e he es se as a o ally impa ial se o unseen da a o do a
inal model e alua ion. So, he da ase was i s spli in o 90% o aining/ alida ion se and 10% o
69
es se and, la e , among he 90% o he da ase designa ed o aining and alida ion, i e spli s
we e c ea ed using TimeSe iesSpli .
4.3.9.3. Da a T ans o ma ion
The Da a T ans o ma ion s ep objec i e is o apply some ans o ma ions o he da ase ha can
maximize he capaci y o he model o ex ac knowledge om he da ase . Since he da ase has
a iables wi h e y di e en scales, mainly, he P essu e ea u e, a no maliza ion objec called
MinMaxScale om Py hon’s lib a y sciki -lea n was used o escale consis en ly he ime se ies.
Below, a line plo o all he inpu a iables om he mul i a ia e LSTM neu al ne wo k. Fea u e
P essu e, in he ange o housands, is clea ly on a di e en scale han all o he a iables.
Figu e 4-53 - Line plo o all he inpu a iables wi h ea u e P essu e on a di e en scale.
When applying a no maliza ion echnique o a da ase , i has o be done ca e ully. O he wise, he
p ocess could ha e da a leakage. Da a leakage occu s when da a om ou side he aining da a is
used o ain he model esul ing in o e i ing and an op imis ic e alua ion o he model (B ownlee,
2016). I he en i e da ase is no malized a once and hen spli s o aining and alida ion a e
c ea ed, scale ac o s, like min and max alues o he se ies, will be om he whole da ase .
The e o e, in o ma ion om he alida ion se will be used in he aining phase and ice- e sa,
esul ing in da a leakage. To a oid his si ua ion, no maliza ion was done wi hin each spli sepa a ely
o aining and alida ion se s. The same app oach was done, la e , wi h he es se .
4.3.9.4. Da a P epa a ion
The goal o he Da a P epa a ion s ep is o ge he da ase eady o be used o aining an LSTM
neu al ne wo k. To do so, he da a mus be p esen ed in a h ee-dimensional a ay wi h he
ollowing componen s: samples, ime s eps, and ea u es (B ownlee, 2018a, p. 46). Samples a e he
obse a ions, he ows in he da ase . Fea u es a e he inpu and ou pu a iables, he columns in
he da ase . A ime s ep is one poin o obse a ion in he sample.
70
Below, an example o he da a p epa ed o a uni a ia e LSTM neu al ne wo k as a h ee-dimension
a ay [samples, ime s eps, ea u es]. In his case, he aining se has 684 samples, 18 ime s eps,
and only one ea u e, since i is a uni a ia e p oblem. Fo 684 imes, only one ea u e (one column) is
p esen ed wi h i s 18 lag ea u es.
Figu e 4-54 – Da a p epa ed o a uni a ia e LSTM NN. Highligh ed he i s o 684 samples wi h i s 18
ime s eps and one ea u e.
To pu in pe spec i e, below, ano he example, bu o a mul i a ia e LSTM neu al ne wo k. This
ime, he aining se has 685 samples, 18 ime s eps, and 7 ea u es, since i is a mul i a ia e
p oblem. Fo 685 imes, 7 ea u es (columns) a e p esen ed wi h i s 18 lag ea u es.
71
Figu e 4-55 - Da a p epa ed o a mul i a ia e LSTM NN. Highligh ed he i s o 685 samples wi h i s
18 ime s eps and se en ea u es.
4.3.9.5. De ine, Compile, Fi , E alua ion and P edic
A e se ing a ime se ies c oss- alida ion like e alua ion p ocess, ans o ming he da ase h ough
no maliza ion, and p epa ing he da ase o eed an LSTM neu al ne wo k, he deep lea ning models
we e ained. Bu i s , he numbe o s eps was se o 18, ollowing he indica ion om he Fea u e
Selec ion s ep ha lag ea u es un il he 18 h ime s ep s ill a ec he a ge a iable conside ably.
The p ocess o aining he Deep Lea ning models was di ided in o i e s eps: de ine he neu al
ne wo k a chi ec u e, compile he neu al ne wo k, i he aining da a, e alua e wi h he alida ion
da a, and p edic .
To de ine he neu al ne wo ks di e en a chi ec u es we e used. Below, a b ie explana ion o each
one o hem:
§ Baseline
§ 1 hidden laye wi h 12 neu ons.
§ Wide NN (Neu al Ne wo k)
72
§ 1 hidden laye wi h 25 neu ons.
§ Wide 2x NN
§ 1 hidden laye wi h 50 neu ons.
§ Deepe NN
§ 2 hidden laye s wi h 25 neu ons.
§ Deepe 2x NN
§ 4 hidden laye s;
§ Fi s and las hidden laye s wi h 25 neu ons;
§ Second and hi d hidden laye s wi h 35 neu ons.
§ Deepe 4x NN
§ 8 hidden laye s;
§ Fi s and las hidden laye s wi h 25 neu ons;
§ All he in-be ween laye s wi h 35 neu ons.
§ Deepe 4x NN wi h D opou Regula iza ion
§ 8 hidden laye s;
§ Fi s and las hidden laye s wi h 25 neu ons;
§ All he in-be ween laye s wi h 35 neu ons;
§ 20% o d opou be ween e e y hidden laye .
The s eps o compiling he neu al ne wo k, i ing he aining da a, e alua ing wi h he alida ion
da a, and p edic ing we e epea ed in he same way o all di e en neu al ne wo k opologies.
Below, as an example om he uni a ia e LSTM NN, he ini ial ou pu o he model aining:

73
Figu e 4-56 - Ini ial ou pu o a uni a ia e LSTM NN aining.
Nex , also as an example om he uni a ia e LSTM NN aining, cha s o model loss om model
aining o he i e spli s ( aining and alida ion losses by epoch):
74
Figu e 4-57 - Model Losses (Spli #1 o #5).
4.3.9.6. Pe o mance Me ic
A e aining and e alua ion o he Deep Lea ning models, p edic ions we e made using he aining
and he alida ion da ase s. The objec i e o his is o calcula e he pe o mance me ic o each
da ase by compa ing he espec i e p edic ions o he al eady known alues o he a ge a iables.
The pe o mance me ic used o ha was he Roo Mean Squa ed E o .
Be o e calcula ing he RMSE, a mino ans o ma ion s ep was equi ed. Since he aining and he
alida ion da ase s we e no malized by he MinMax echnique, he p edic ions needed o be
ans o med back o he scale o he o iginal alues. Thus, and as RMSE was being used as a
pe o mance me ic, i would be mo e no iceable i he e o was o 1 Celsius deg ee, mo e o e en
less. By using he in e se_ ans o m unc ion o he MinMaxScale objec om Py hon’s lib a y sciki -
lea n, i was ela i ely easy o in e he p edic ions. The only excep ion was in he case o he
mul i a ia e mul iple inpu se ies LSTMs. Because inpu and ou pu da ase shapes we e di e en in
75
his case, inpu da ase shapes we e (n, 8) and ou pu da ase shapes we e (n, 1), he
in e se_ ans o m unc ion demanded some da a ans o ma ion be o e be applied.
Below, as an example om he uni a ia e LSTM NN, he aining and he alida ion sco e calcula ed
om he i e spli s:
Figu e 4-58 - T aining and Valida ion Sco es.
4.3.9.7. P edic ion on Tes Da ase
As he las s ep, o be su e o he gene aliza ion capabili y o he model, p edic ions we e made ou
o he es se (holdou ). The en i e p ocess was epea ed, bu wi h some small changes.
In his case, he aining da ase was composed o wha be o e was he aining and he alida ion
da ase . The new aining da ase needed o ha e i s da a ans o med and p epa ed jus like be o e.
The da ase was no malized and con e ed o he h ee-dimensional a ay o samples, ime s eps,
and ea u es ha an LSTM expec s. A e ha , he Deep Lea ning model was ained again, bu , his
ime, wi h much mo e da a.
The es da ase was also ans o med and p epa ed. The es da ase was used o make p edic ions
based on he ecen ly ained model. P edic ions we e in e ed ollowing he same logic as be o e
and he RMSE was calcula ed o ob ain a es sco e.
The image below shows he esul s achie ed, as an example wi h he uni a ia e NN, wi h he da ase
in blue, he p edic ions om he new aining da ase in o ange and he p edic ions om he es
da ase in g een:
76
Figu e 4-59 - Comple e da ase o e laid wi h p edic ions.
In e es ing o no ice ha he e a e no p edic ions o he i s eigh een obse a ions in he cha
abo e. Tha is due o he eigh een ime s eps con igu ed in he LSTMs.
4.3.10. Machine Lea ning Models
Di e en models we e used in an a emp o ge he bes Machine Lea ning model possible o
compa e wi h Deep Lea ning models. Linea Reg ession, Decision T ees, and ensemble models like
G adien Boos ing we e among hem. The idea was o es i Deep Lea ning models, mo e
speci ically, LSTM neu al ne wo ks, ha e a g ea ad an age o no o ime se ies o ecas ing
p oblems. Because o ha , all he same c i e ia used wi h Deep Lea ning models we e applied o
Machine Lea ning models o ha e a ai compa ison. I is impo an o emind ha Machine Lea ning
models didn’ ecei e any special ea men o deal wi h a imes se ies o ecas ing case, hough.
Below, a able wi h all Machine Lea ning models ha ha e been employed:
Model
Ac onyms
Model Type
Model Name
LR
S anda d
Linea Reg ession
LASSO
LASSO Linea Reg ession
KNN
K-Nea es Neighbo s
CART
Classi ica ion and Reg ession T ees
GBM
Ensemble
G adien Boos ing Machines (o S ochas ic G adien Boos ing)
83
Below, he able p esen ing he inal esul s:
Figu e 5-1 - Bes esul s o Deep Lea ning and o he Machine Lea ning models.
As can be no iced by compa ing RMSE pe o mance me ics, Deep Lea ning models indeed ha e a
be e pe o mance when i comes o ime se ies o ecas ing p oblems. Howe e , i is impo an o
ema k ha o he Deep Lea ning models like he uni a ia e and he mul i a ia e mul iple pa allel
se ies a ia ions besides achie ing o e all be e pe o mance han o he Machine Lea ning models
did no accomplish ha by such la ge ma gin as was he case o mul i a ia e mul iple inpu se ies
models.

84
6. CONCLUSIONS
Se e al algo i hms om di e en a eas o Machine Lea ning we e es ed in an a emp o ind he
bes possible model o sol e he p oblem o ime se ies o ecas ing o he Ambiosensing sys em.
A e many expe imen s, i became clea ha he mul i a ia e LSTM ne wo ks in a con igu a ion o
mul iple a iables as inpu and one a iable as he a ge would be he bes choice o he
ope a ional use case p oblem o he Ambiosensing sys em. By applying mul i a ia e LSTM ne wo ks
wi h a single hidden laye wi h 50 nodes he Ambiosensing sys em would p edic wi h e y high
p ecision (RMSE o 0,028 Celsius deg ees) he a e age empe a u e o he nex ou hou s allowing
he sys em o se i s con igu a ions adequa ely.
Taking in o conside a ion only Deep Lea ning models, i was shown ha , by a la ge ma gin, mul iple
inpu se ies models ou pe o med uni a ia e and mul i a ia e pa allel se ies models (RMSE o 0,028
e sus RMSE o 0,375 and 0,486 espec i ely). The eason o make be e p edic ions han he
uni a ia e a ia ions is, p obably, due o he ex a ea u es ha he mul iple inpu se ies models ake
in o conside a ion. Wi h mo e in o ma ion a ailable, he model can lea n mo e and, hence, make
be e p edic ions. S ill, mul iple pa allel se ies models ha e he same ea u es a ailable as mul iple
inpu se ies models, bu he ac ha hese models in end o p edic no only one bu se e al ime
se ies make i unde pe o m when compa ed o mul iple inpu se ies models ha ha e only one
a ge o p edic .
I is impo an o ema k, s ill conce ning only Deep Lea ning models, ha models ha achie ed he
bes pe o mances we e shallow ne wo ks wi h a single hidden laye . Deepe ne wo ks did no make
as asse i e p edic ions e en when hey we e combined wi h egula iza ion echniques o a oid
o e i ing like d opou . This is an indica ion ha , p obably, he p oblem o p edic ing indoo
empe a u e o he Ambiosensing sys em is no as complex as ini ially hough . A leas , as long as
he igh ea u es a e a ailable wi h a consis en da a quali y o ain he models.
Conce ning o he Machine Lea ning models o he han Deep Lea ning, e en wi h a se o ea u es
ha mixed lag ea u es among he selec ed ea u es, hey did no pe o m as good as mul i a ia e
LSTM ne wo ks (RMSE o 0,569 e sus RMSE o 0,028 espec i ely). The lag ea u es did b ing ime
con ex o he Machine Lea ning models, bu hese models did no ea hem as he same a iable in
di e en ime s eps like he LSTM ne wo ks. The Machine Lea ning models ea ed he lag ea u es
as comple ely di e en inpu a iables. This is an impo an ad an age o LSTM ne wo ks when
compa ed o o he Machine Lea ning models ha a e no as sui ed as LSTM ne wo ks o deal wi h
la ge sequences o da a. Ensemble me hods did imp o e he pe o mance be ween Machine
Lea ning models, bu no enough o bea LSTM ne wo ks in any con igu a ion. Bu , he di e ence
be ween he bes Ensemble me hod, he G adien Boos ing Machines (RMSE o 0,569), and he
second-bes LSTM ne wo ks con igu a ion, he uni a ia e LSTM ne wo k wi h a single hidden laye
wi h 25 nodes (RMSE o 0,375), was no ha big.
I only he bes esul o each es ed algo i hm is conside ed, e en he wo s model s ill would be
sa is ac o y o be applied in he use case o p edic ing indoo empe a u e o he Ambiosensing
sys em. A 0,5 Celsius deg ee e o would s ill be accep able and would no a ec d as ically he
abili y o he Ambiosensing sys em o se i s con igu a ions au onomously.
85
An impo an inal ema k is ha in an a emp o imp o e he pe o mance o he Deep Lea ning
models wi h LSTM ne wo ks, he da ase was ans o med h ough di e encing in o a s a iona y
ime se ies. By analyzing he comple e da ase line plo , i is possible o obse e a dec easing end in
indoo empe a u e om July o Janua y, co esponding wi h he wea he changes om summe o
win e in he no he n hemisphe e. Howe e , emo ing he end om he ime se ies did no esul
as expec ed. The esul s we e wo se han he ones wi h he o iginal da ase . A possible explana ion is
ha he Neu al Ne wo k lea ned he end by he con ex p o ided in he inpu sequence elimina ing
he need o emo e i om he ime se ies.
86
7. PRACTICAL APPLICATIONS AND RECOMMENDATIONS FOR FUTURE WORK
The use case chosen o es and compa e di e en models was he ope a ional scena io o p edic ing
he indoo empe a u e om his o ical da a o suppo he Ambiosensing sys em o au oma ically
se he bes possible base con igu a ion o p e en high ene gy consump ion om d as ic changes.
Howe e , he esul s showed ha Deep Lea ning models like LSTM ne wo ks can be used o much
mo e complex p oblems using he same da ase and he con ex o he Ambiosensing sys em.
Ano he possible applica ion ha can ake ad an age o he se e al inpu ea u es ela ed o gas
concen a ions and also om he unique ea u e o LSTM ne wo ks o handling well la ge sequences
o da a is o apply he model p edic i e capabili y o anomaly de ec ion. A mo e speci ic a ia ion o
his use case could be a i e o explosion o dange ale module in he Ambiosensing sys em based
on he dange ous concen a ion o ce ain gases like he lammable Me hane o he oxic Ca bon
Monoxide.
As u u e wo k, al hough LSTM ne wo ks did achie e g ea esul s, i is possible o in es in some
echniques o imp o e i e en mo e. One o hem would be li ing he pe o mance by adap ing he
lea ning a e. Dec easing he lea ning a e o e ime du ing aining could inc ease he pe o mance
and also educe he aining ime. In he expe imen s, he Adam (Adap i e Momen Es ima ion)
op imiza ion algo i hm was used. The Adam op imiza ion algo i hm in i s de aul Ke as con igu a ion
p o ides lea ning a e adap a ion au oma ically. Howe e , i would be in e es ing o explo e u he
he pa ame e lea ning a e o he Adam op imiza ion algo i hm and also o he op imiza ion
algo i hms like he classic S ochas ic G adien Descen o he RMSP op (Roo Mean Squa e
P opaga ion) wi h di e en lea ning a e con igu a ions.
Ano he possible u u e wo k also in he con ex o imp o ing LSTM ne wo ks would be o
expe imen wi h di e en ypes o LSTM ne wo ks. Fo ins ance, bidi ec ional LSTMs o e en
combina ions o LSTM and CNN ne wo ks. Bidi ec ional LSTM ne wo ks lea n bo h om o wa d and
backwa d passes. And LSTM and CNN ne wo ks can wo k oge he in a hyb id model joining he
s eng hs o each algo i hm. In a speci ic LSTM-CNN con igu a ion, a CNN model could ex ac and
lea n ea u es om he sequence o da a and an LSTM model could wo k as a backend ha would
ecei e he da a ini ially p ocessed by he CNN model.
Deep Lea ning is a as ield wi h lo s o possible p ac ical applica ions. Because o he way ha
Neu al Ne wo ks lea n, wi h enough compu a ional esou ces a ailable, hey should ou pe o m
classical linea o ecas ing me hods in gene al. Mos ly, due o i s capabili y o mapping complex
ela ionships be ween inpu s and ou pu s. This cha ac e is ic oge he wi h he suppo o inpu
sequences in RNN wi h s able g adien s in LSTM ne wo ks g an ed e iciency in lea ning empo al
dependencies om he inpu o he ou pu . All hese aspec s oge he make LSTM ne wo ks a good
i o imes se ies o ecas ing.
87
8. BIBLIOGRAPHY
Ada ui Sensi ion SHT31-D (Tempe a u e and Humidi y Senso ). (n.d.). Re ie ed Augus 6, 2020,
om Ada ui Indus ies websi e: h ps://www.ada ui .com/p oduc /2857
Agga wal, C. (2015). Da a Mining: The Tex book. Sp inge .
Ambios e a. (n.d.). Re ie ed June 8, 2019, om Ambios e a - Ene gia e Ambien e websi e:
h p://www.ambios e a.p /
Ba ooah, P., Sub amany, R., & Sidda h, G. (2018). Pa en No. US 10,047,968 B2. Uni ed S a es o
Ame ica: Uni ed S a es Pa en .
Bell, J. (2015). Machine Lea ning: Hands-On o De elope s and Technical P o essionals. John Wiley &
Sons, Inc.
Be na do, J. (2015). Es a égia pa a a E iciência Ene gé ica nos Edi ícios Públicos. In Wo kshop:
RePublic_ZEB. Re ie ed om h p://www.lneg.p /download/10887/DGEG_REPublic_ZEB
11dez2015.pd
Boné , J., Chala, A., Ruzicka, W., Benne , L., Kappal, S., & Smi h, T. (2018). Big Da a: S eam
P ocessing, S a is ics, and Scalabili y. DZone De ada Media, 40. Re ie ed om
h ps://dzone.com/guides/big-da a-s eam-p ocessing-s a is ics-and-scalabil
B ownlee, J. (2016). Da a Leakage in Machine Lea ning. Re ie ed Augus 7, 2020, om
h ps://machinelea ningmas e y.com/da a-leakage-machine-lea ning/
B ownlee, J. (2018a). Deep Lea ning o Time Se ies Fo ecas ing P edic he Fu u e wi h MLPs, CNNs
and LSTMs in Py hon ( 1.4).
B ownlee, J. (2018b). Deep Lea ning wi h Py hon De elop Deep Lea ning Models on Theano and
Tenso Flow Using Ke as ( 1.15).
B ownlee, J. (2018c). Time Se ies Fo ecas ing wi h Py hon How o P epa e Da a and De elop Models
o P edic he Fu u e ( 1.6).
B ownlee, J. (2019). Machine Lea ning Mas e y wi h Py hon Unde s and You Da a, C ea e Accu a e
Models and Wo k P ojec s End- o-End ( 1.14).
Bu ko , A. (2019). The Hund ed-Page Machine Lea ning Book.
Chala, A., Polak, A., Lai d, C., Lamb, C., S ichbu y, J., Babu, S., & Smi h, T. (2019). Big Da a: Volume,
Va ie y, and Veloci y. DZone De ada Media, 38. Re ie ed om h ps://dzone.com/guides/big-
da a- olume- a ie y-and- eloci y
Dalgaa d, P. (n.d.). In oduc o y S a is ics wi h R (Second Edi ion). Sp inge .
Dino , I. (2018). Da a Science and P edic i e Analy ics Biomedical and Heal h Applica ions using R.
Sp inge Na u e.
88
Di ecção Ge al de Ene gia e Geologia. (2017). Balanços Ene gé ico Sin é ico 2016. Re ie ed om
h p://www.dgeg.go .p /wwwbase/wwwinclude/ ichei o.aspx?access=1&id=15901
E ans, R., & Gao, J. (2016). DeepMind AI Reduces Google Da a Cen e Cooling Bill by 40%. Re ie ed
Augus 6, 2020, om h ps://deepmind.com/blog/deepmind-ai- educes-google-da a-cen e-
cooling-bill-40/
Google Cloud Public Da ase s. (n.d.). Re ie ed Augus 7, 2020, om Google Cloud websi e:
h ps://cloud.google.com/public-da ase s
G an ille, V. (2017). Di e ence be ween Machine Lea ning, Da a Science, AI, Deep Lea ning, and
S a is ics. Re ie ed Augus 6, 2020, om Da a Science Cen al websi e:
h ps://www.da asciencecen al.com/p o iles/blogs/di e ence-be ween-machine-lea ning-
da a-science-ai-deep-lea ning
G a es, A. (2012). Supe ised Sequence Labelling wi h Recu en Neu al Ne wo ks. Sp inge .
G o h, P. (2017). 5 easons da a is a key ing edien o AI applica ions. Re ie ed Augus 6, 2020, om
Else ie websi e: h ps://www.else ie .com/connec /5- easons-da a-is-a-key-ing edien - o -ai-
applica ions
Hale y, A., No ig, P., & Pe ei a, F. (2009). The Un easonable E ec i eness o Da a. Re ie ed om
www.compu e .o g/in elligen
Ha des y, L. (2015). Si ing wind a ms mo e quickly, cheaply. Re ie ed Augus 6, 2020, om MIT
News O ice websi e: h p://news.mi .edu/2015/si ing-wind- a ms-quickly-cheaply-0717
Holidays Lib a y Documen a ion. (n.d.). Re ie ed Augus 6, 2020, om
h ps://pypi.o g/p ojec /holidays/
Humidi y Senso BME280. (n.d.). Re ie ed Augus 6, 2020, om Bosch Senso ec websi e:
h ps://www.bosch-senso ec.com/p oduc s/en i onmen al-senso s/humidi y-senso s-
bme280/
IBM Resea ch Edi o ial S a . (2016). Fo ecas ing he Fu u e: Ai Quali y in Sou h A ica wi h he IoT.
Re ie ed Augus 6, 2020, om IBM Resea ch Blog websi e:
h ps://www.ibm.com/blogs/ esea ch/2016/10/ o ecas ing-ai -quali y-sou h-a ica-io /
IEC 60050 - In e na ional Elec o echnical Vocabula y - De ails o IEV numbe 845-01-52: “lux.”
(n.d.). Re ie ed Augus 7, 2020, om In e na ional Elec o echnical Commission websi e:
h p://www.elec opedia.o g/ie /ie .ns /display?open o m&ie e =845-01-52
Igual, L., & Seguí, S. (2017). In oduc ion o Da a Science A Py hon App oach o Concep s, Techniques
and Applica ions. Re ie ed om h p://www.sp inge .com/se ies/7592
In e na ional O ganiza ion o S anda diza ion. (1975). Re ie ed Augus 6, 2020, om S anda d
A mosphe e (ISO S anda d No 2533:1975) websi e: h ps://www.iso.o g/s anda d/7472.h ml
Ki k, M. (2014). Though ul Machine Lea ning: A Tes -D i en App oach (Fi s Edi ion). O’Reilly Media,
Inc.

89
Kuhn, M., & Johnson, K. (2013). Applied P edic i e Modeling (5 h ed.). Sp inge Na u e.
Menne, M. J., Du e, I., Ko zeniewski, B., McNeal, S., Thomas, K., Yin, X., … Hous on, T. G. (2012).
Global His o ical Clima ology Ne wo k - Daily (GHCN-Daily), Ve sion 3.26.
h ps://doi.o g/h p://doi.o g/10.7289/V5D21VHZ
Mülle , A., & Guido, S. (2016). In oduc ion o Machine Lea ning wi h Py hon A Guide o Da a
Scien is s (Fi s Edi ion). O’Reilly Media Inc.
NumPy Manual. (n.d.). Re ie ed Augus 6, 2020, om h ps://numpy.o g/doc/s able/
Oldewu el, F., Pa isio, A., Jones, C. N., Gyalis as, D., Gwe de , M., S auch, V., … Mo a i, M. (2012).
Use o model p edic i e con ol and wea he o ecas s o ene gy e icien building clima e
con ol. Ene gy and Buildings, 45, 15–27. h ps://doi.o g/10.1016/j.enbuild.2011.09.022
Pandas Documen a ion. (n.d.). Re ie ed Augus 6, 2020, om h ps://pandas.pyda a.o g/docs/
Pisello, A. L., Bobke , M., & Co ana, F. (2012). A Building Ene gy E iciency Op imiza ion Me hod by
E alua ing he E ec i e The mal Zones Occupancy. Ene gies, 5(12), 5257–5278.
h ps://doi.o g/10.3390/en5125257
Ruzicka, W., Law ence, C., Chaudh i, A., Jacque , F., & Smi h, T. (2018). A i icial In elligence:
Au oma ing Decision-Making. DZone De ada Media, 29.
Sciki -lea n Documen a ion. (n.d.). Re ie ed Augus 6, 2020, om h ps://sciki -
lea n.o g/s able/use _guide.h ml
Shaikh, P. H., No , N. B. M. ., Nallagownden, P., Elam azu hi, I., & Ib ahim, T. (2013). Robus
S ochas ic Con ol Model o Ene gy and Com o Managemen o Buildings. Aus alian Jou nal
o Basic and Applied Sciences, 7(10), 137–144.
Shmueli, G., & Lich endahl, K. (2016). P ac ical Time Se ies Fo ecas ing wi h R: A Hands-on Guide
(Second Edi ion). Axel od Schnall Publishe s.
Shumway, R., & S o e , D. (2017). Time Se ies Analysis and I s Applica ions wi h R Examples (4 h ed.).
Re ie ed om h p://www.sp inge .com/se ies/417
Skansi, S. (2018). In oduc ion o Deep Lea ning F om Logical Calculus o A i icial In elligence.
h ps://doi.o g/10.1007/978-3-319-73004-2
Skiena, S. (2017). The Da a Science Design Manual. Re ie ed om
h p://www.sp inge .com/se ies/3191
sklea n.ensemble.RandomFo es Reg esso — sciki -lea n 0.23.2 documen a ion. (n.d.). Re ie ed
Augus 7, 2020, om h ps://sciki -
lea n.o g/s able/modules/gene a ed/sklea n.ensemble.RandomFo es Reg esso .h ml
sklea n.me ics.mean_absolu e_e o — sciki -lea n 0.23.2 documen a ion. (n.d.). Re ie ed Augus
6, 2020, om h ps://sciki -
lea n.o g/s able/modules/gene a ed/sklea n.me ics.mean_absolu e_e o .h ml
90
sklea n.me ics.mean_squa ed_e o — sciki -lea n 0.23.2 documen a ion. (n.d.). Re ie ed Augus
6, 2020, om h ps://sciki -
lea n.o g/s able/modules/gene a ed/sklea n.me ics.mean_squa ed_e o .h ml
sklea n.model_selec ion.c oss_ al_sco e — sciki -lea n 0.23.2 documen a ion. (n.d.). Re ie ed
Augus 6, 2020, om h ps://sciki -
lea n.o g/s able/modules/gene a ed/sklea n.model_selec ion.c oss_ al_sco e.h ml
sklea n.model_selec ion.KFold — sciki -lea n 0.23.2 documen a ion. (n.d.). Re ie ed Augus 6, 2020,
om h ps://sciki -lea n.o g/s able/modules/gene a ed/sklea n.model_selec ion.KFold.h ml
sklea n.model_selec ion.TimeSe iesSpli — sciki -lea n 0.23.2 documen a ion. (n.d.). Re ie ed
Augus 6, 2020, om h ps://sciki -
lea n.o g/s able/modules/gene a ed/sklea n.model_selec ion.TimeSe iesSpli .h ml
sklea n.model_selec ion. ain_ es _spli — sciki -lea n 0.23.2 documen a ion. (n.d.). Re ie ed
Augus 6, 2020, om h ps://sciki -
lea n.o g/s able/modules/gene a ed/sklea n.model_selec ion. ain_ es _spli .h ml
sklea n.neighbo s.KNeighbo sReg esso — sciki -lea n 0.23.2 documen a ion. (n.d.). Re ie ed
Augus 6, 2020, om h ps://sciki -
lea n.o g/s able/modules/gene a ed/sklea n.neighbo s.KNeighbo sReg esso .h ml
sklea n.p ep ocessing.MinMaxScale — sciki -lea n 0.23.2 documen a ion. (n.d.). Re ie ed Augus 6,
2020, om h ps://sciki -
lea n.o g/s able/modules/gene a ed/sklea n.p ep ocessing.MinMaxScale .h ml
sklea n.p ep ocessing.S anda dScale — sciki -lea n 0.23.2 documen a ion. (n.d.). Re ie ed Augus
6, 2020, om h ps://sciki -
lea n.o g/s able/modules/gene a ed/sklea n.p ep ocessing.S anda dScale .h ml
Smi h, S. I., & Lasch, C. (2016). Machine Lea ning In eg a ion o Adap i e Building En elopes.
Pos human F on ie s, 98–105. Re ie ed om
h p://pape s.cumincad.o g/da a/wo ks/a /acadia16_98.pd
Spann, T., Deschamps-Sonsino, A., Law ence, C., Chu ilo, C., & Azzola, F. (2019). The In e ne o
Things: Connec ing De ices and Da a. DZone De ada Media, 36. Re ie ed om
h ps://dzone.com/guides/in e ne -o - hings-connec ing-de ices-and-da a
Spann, T., Law ence, C., Azzola, F., Simmons, D., S yge , E., & Smi h, T. (2018). In e ne o Things:
Ha nessing De ice Da a. DZone De ada Media, V, 44. Re ie ed om
h ps://dzone.com/guides/io -ha nessing-de ice-da a
Tukey, J. (1977). Explo a o y Da a Analysis. Addison-Wesley.
Vishwana h, A. (2018). IoT and Machine Lea ning o Reduce Ene gy Use in Cooling Sys ems. IBM
Resea ch-Aus alia, In e ne o Things. Re ie ed om
h ps://www.ibm.com/blogs/ esea ch/2018/07/ educe-ene gy-cooling/
Zhang, A., Lip on, Z., Li, M., & Smola, A. (2020). Di e in o Deep Lea ning (Release 0.7.1). Re ie ed
91
om h ps://d2l.ai/index.h ml
Page | i