# Application of Machine Learning Techniques to Predict a Patient's No-Show in the Healthcare Sector
## 2 Materials and Methods
### Descriptive Analysis  
The descriptive analysis process begins with the observation of the distribution of the target variable within the dataset. This step was conducted by relating each feature to the target variable \"attended\". In this section, we analyzed only the five most important characteristics. Figure 6 shows the relationship between the patient's gender attribute and the fact that he (or she) attends the scheduled appointment. It should be noted that the proportion of consultations by women is much lower than that of men, 1333 and 3676 consultations for women and men, respectively. However, the amount of abstentions by women exceeds that of men, with female patients being responsible for 13.13% of abstentions against 10.45% for males. Concerning the age of patients, we extracted two age categories for analysis: patients under 18 years old were labelled as \"Minor Age\" and the others as \"Adult\". It is observed in Figure 7 that there is an imbalance about these categories, with appointments for younger people being much more prevalent. Adults represent only 19% of consultations carried out at the specialized centre. We also note that most of the data collected are from patients under 18 years old. It may reveal some characteristics of the behaviour of these patients that are not exclusively  
Figure 5: Correlation heatmap. related to the patient who will receive care. In many cases, underage patients need someone close to accompany them in medical care. This fact implies a behavioural analysis of the patient and their companion. In this study, we did not collect data related to this issue. We extracted the \"appointment month\" attribute from the existing column labelled \"appointment date\". Figure 8 shows that the month with the highest number of scheduled appointments is the month of September, followed by the months of October and August. In addition, the month with the fewest medical appointments is November. However, May, July and April are responsible for the highest abstentions from scheduled appointments. In May alone, the number of patients who scheduled medical appointments at the specialized centre and did not show up totalled more than 16% of the number of medical appointments. Figure 6: Analysis by gender. Figure 7: Analysis by age group. As presented in Section 2.2, we included climate data in the original dataset. Figure 9 shows a way to visualize the relationship between weather conditions and the probability of the patient not attending the scheduled medical care. From Figure 9, we observe that in autumn and winter, temperatures tend to be lower in the city of Itajai, region of the medical centre. In July, the number of patients who did not attend the scheduled appointment reached more than 15%. This fact may be related to the average temperature this month being the lowest in the year. However, based on Figure 10, it is not possible to establish a direct relationship between the patient's behaviour and their abstention from rain strength on the appointment day. Figure 8: Analysis by appointment month. Figure 10: Analysis by rainfall. Figure 9: Analysis by day temperature. We extracted the appointment shifts based on the appointment time and divided them into \"morning\" and \"afternoon\" shifts. The morning shift refers to the period until midnight and the afternoon shift from this time on. Scheduled appointment times at the health centre range from 7 a.m. to 6:20 p.m. In the analyzed data, there are 35 different scheduled times; the time of 8:40 a.m. had the highest number of medical appointments. The no-show proportion is similar for both shifts, in which 12.24% for the morning shift and 10.34% for the afternoon shift. Figures 11 and 12 show that the absolute number of abstentions based on appointment times has low variability. When the highest frequency of scheduled medical appointments, the number of no-shows drops to around 9%, about 3% lower than the total number of abstentions for the morning.