## 3 Materials and Methods
### Feature Engineering  
Of the 16 features mentioned in Table 1, we had to apply techniques to modify some features to make them suitable for ML algorithms for improved classification. We proceeded as follows. The date of birth was replaced by the age feature. All the features containing diagnosis information (primary, secondary, and their full names) were removed as the diagnosis of patients included multiple diagnoses, most importantly T1D and T2D, and was removed to avoid leaking the classification information into the machine learning model. Finally, the region and diagnosis start date features were also removed.  
After the initial feature selection, the dataset obtained consisted of 10 features: Age, height, weight, gender, Hypertension (HTN), Physical Activity Level (PAL), lab tests of Lipoprotein levels (HDL and LDL), Fasting Plasma Glucose (FPG) and Hemoglobin A1c (HbA1c). We would like to mention that age, height, weight, HDL, LDL, FPG, and HbA1c were all numerical features, while gender (M or F), HTN (Yes or No), and PAL (L, M, or H) were categorical features containing text or literals. As our implementation is done in the scikit-learn library ([[http://scikit-learn.org/](http://scikit-learn.org/)]([http://scikit-learn.org/](http://scikit-learn.org/))), whose methods require numerical data for efficient processing, we converted the categories to numerical values. Instead of replacing text with numbers (e.g., L:0, M:1, H:2), we used one-hot encoding to prevent the implicit ordering caused by the numeric values.  
\begin{table}
\begin{tabular}{l l l l} \hline \hline
**No.** & **Feature Name** & **Feature Type** & **Feature Description** \\ \hline
1 & Date of birth & Date & Values in date format \\
2 & Gender & Binominal & F: Female, M: Male \\
3 & Height & Numerical & Values in Centimeter (cm) \\
4 & Weight & Numerical & Values in Kilograms (kg) \\
5 & Hypertension (HTN) & Binominal & Values as Yes, No \\
6 & Fasting Plasma Glucose (FPG) & Numerical & Lab test results measured in mmol/L \\
7 & Hemoglobin A1c (HbA1c) & Numerical & Lab test results measured in percentage (\%). \\
8 & High-density lipoprotein (HDL) & Numerical & Lab test results in mmol/L \\
9 & High-density lipoprotein (LDL) & Numerical & Lab test results in mmol/L \\
10 & Physical Activity Level & Categorical & Values in L: Low, M: Medium, H: High \\
11 & Diagnosis start date & Date & Values in date format \\
12 & Primary diagnosis & Categorical & Values available in ICD10 code format. \\
13 & Secondary diagnosis & Categorical & Values available in ICD10 code format. \\
14 & Primary diagnosis full name & Categorical & Values indicate diagnosis full name \\
15 & Secondary diagnosis full name & Categorical & Values indicate diagnosis full name \\
16 & Region & Categorical & Values indicate the region of the patient whether in central, western or eastern region. \\ \hline \hline \end{tabular}
\end{table}
Table 1: The set of features selected in our dataset for classification of diabetic and prediabetic patients.  
At this stage, our data processing steps were finished. Before starting the analysis, it was imperative to identify each record as representing data for a diabetic or non-diabetic patient. In other words, each record was to be labeled with an appropriate class.