# Prediction of Diabetes Using Statistical and Machine Learning Modelling Techniques
## 4 Experimental Methodology
### Dataset Preparation  
After collecting the required data, it was necessary to process them to prepare for the training stage using the proposed models. Data collection was conducted using published national surveys that utilise credible, standardised, and validated measuring tools. However, the results of these studies were presented in different formats. For example, the age variable of the participants varied in terms of the overall age range and the specific age group bands used. Due to deficiencies and differences in data from the KSA, it was necessary to make reasonable assumptions and apply a method to impute missing data to ensure the dataset was ready for the modelling process. To address differences between the age groups used in the developed model and those used in the studies, certain assumptions were required. For instance, in some studies [35], it was assumed that the prevalence rate for the 25-34 age group was the average of the prevalence rates for the study's 14-29 and 30-44 age groups. Similar assumptions were applied to data extracted from other studies [36; 37]. Another essential step was addressing missing values, which is a crucial aspect of data modelling. Since there is no fixed standard method for handling missing values, researchers often use different approaches, such as ignoring missing values, eliminating attributes with missing data, or removing entire records that contain missing values [38; 39]. However, when the percentage of missing data is high, a careful imputation approach should be applied [40]. Data imputation involves estimating missing values and replacing them with calculated estimates to generate a complete dataset [41]. Various statistical and machine learning-based methods have been used to address this issue. In this study, an ANFIS structure with two inputs and one output was constructed to estimate missing data. For instance, collected data on diabetes or smoking, along with their available years, were used as inputs, while missing values that needed to be predicted for specific years were taken as outputs. To train the ANFIS model, two Gaussian membership functions were used for the input variable, while a linear membership function was used for the output variable. Additionally, a hybrid training method was applied, with the errortolerance set to 0 and the number of epochs set to 100. After imputing missing values in the training set, the full dataset was retrained using the same imputation method to predict missing values in the testing set. This step was applied only to smoking, obesity, and inactivity data, while the expected percentage of diabetes was treated as the target variable when applying the proposed models. Finally, the complete dataset for smoking, obesity, and inactivity was divided into two parts: training data (from 1999 to 2013) and testing data (from 2014 to 2025), which were used for building and evaluating the models, respectively. The dataset consists of 1272 entries, representing men and women aged 25 and above with five attributes: age, gender, smoking, obesity, and inactivity. Of these, 840 entries (66%) were used for training and 432 entries (34%) for testing. The behavioural predictor variables (smoking, obesity, and inactivity) were collected based on demographic attributes (age and gender) and categorised into six ten-year age groups (25-34, 35-44, 36-44, \(\ldots\), 75+ years) for both men and women. Diabetes morbidity data were used as the response variable. A preliminary correlation analysis (Table 1) revealed that both demographic and behavioural risk factors significantly contributed to the increased prevalence of diabetes (\(p<0.05\)). Among the behavioural factors, smoking, obesity, and physical inactivity were identified as the most significant predictors of diabetes risk. All analyses and computations in this paper were performed using MATLAB (version R2018a). This software was selected because it is a proprietary, high-level programming language and one of the most widely used tools for scientific and numerical computing. 3.