# PISIoT: A Machine Learning and IoT-Based Smart Health Platform for Overweight and Obesity Control
## 4 Results and Discussion
### Monitoring Analysis  
The data obtained from the elderly people were analyzed to identify critical variables according to the values of the biomedical variables (heart rate, sleep, calories burned, weight, and minutes of physical activity) and other variables (steps, floors, calories consumed, distance traveled, water consumed, and exercise) collected by the wearable device and smart scale. In addition, the information was analyzed to gain an insight into the eating patterns and physical activity of the elderly people. For this reason, three periods were established for patient monitoring. In the first period (August-September 2018), only the smart device (wearable device and smart scale) providers' platform was used to understand the data collection process and the variables collected by each device, as well as to identify food intake, the amount of water ingested by the elderly people, and the values generated for each variable. An exploratory analysis of the data collected identified some disadvantages or limitations in the providers' devices and platforms. For example, when the wearable device battery is empty, data collection is lost during power charging and due to device inactivity; this is reported as sleep time. The same happens when the patient takes a shower and the device is not water-resistant, as it must be removed. In addition, the device providers' platforms only show the data obtained and do not generate any kind of medical recommendation. At the beginning of this first period, 100% of the elderly people had a high weight and a BMI between 30 and 35, and unfortunately, at the end of the period, none of the elderly people presented a weight decrease. Figure 8 shows the weekly average for each variable for each of the 40 elders monitored in the last week of the first period. In the second period (October 2018-January 2019), PISIoT was introduced to monitor the elderly people. In the first instance, PISIoT requested, through the REST services developed, the data collected by the smart devices from each provider for the first period for each patient (August-September 2018). Based on this, PISIoT obtained the elders' BMI, which was between 30 and 35, classifying them at obesity level 1, and the second monitoring period began. Figure 9a shows the biomedical and other variables monitored by the smart devices in PISIoT during one week for a 76-year-old obese elder  
Figure 8: Elderly people monitored in the first period. with a height of 1.66 m, weight of 91 kg, and a BMI of 33.1, in which high values were observed in calorie consumption and daily average resting heart rate. Additionally, low values were identified for physical activity, daily steps, floors, calories burned, sleep, and water consumption. Based on the recommendation rule tree for obesity 1 presented in Figure 7, PISIoT provided the recommendations according to the critical variables identified each day. When the daily recommendations made for certain variables were not fulfilled for three days, PISIoT generated a greater medical recommendation. Figure 9b shows the weight-related recommendations for the 76-year-old obese elder. Additionally, in the case of the 76-year-old obese elder, PISIoT recommended requesting clinical analysis and nutritionist services. The IoT-based medical services are automatically suggested by PISIoT to allow elders to select the service they prefer based on time availability, location, cost, and confidence. Likewise, PISIoT notifies the doctor associated with the patient. The clinical analysis results were high due to poor diet and poor mobility. For this reason, the elder received his new diet plan in the first week of the second period of monitoring, with the purpose of reducing his weight, BMI, and the likelihood of a myocardial infarction. Subsequently, following the new nutritional plan and PISIoT recommendations, the monitoring process was continued. By the end of the second period, the 76-year-old elder managed to lose 5 kg, achieving a weight of 86 kg and a BMI of 31.2.