A Data Analytics Suite for Exploratory Predictive, and Visual Analysis of Type 2 Diabetes

Long-term management of chronic disorders such as Type 2 Diabetes (T2D) requires personalised care for patients due to variation in patient characteristics and their response to a specific line of treatment. The availability of large volumes of electronic records of T2D patient data provides opportunities for application of big data analysis to gain insights into the disease manifestation and its impact on patients. Data science in healthcare has the potential to identify hidden knowledge from the database, re- confirm existing knowledge, and aid in personalising treatment. In this paper, we present a suite of data analytics for T2D disease management that allows clinicians and researchers to identify associations between different patient biological markers and T2D related complications. The analytics suite consists of exploratory, predictive, and visual analytics with capabilities including multi-tier classification of T2D patient profiles that associate them to specific conditions, T2D related complication risk prediction, and prediction of patient response to a particular line of treatment. The analytics presented in this paper explore advanced data analysis techniques, which are potential tools for clinicians in decision-making that can contribute to better management of T2D.


I. INTRODUCTION
The rapid technological advancements in cloud technologies, big data infrastructure, and artificial intelligence have generated significant excitement in developing data-driven solutions for various domains including the healthcare sector. Development of big data infrastructure, including data analytics for healthcare applications requires careful design and planning supported by close collaboration between healthcare experts and relevant stakeholders due to the sensitive nature of the healthcare data involved and the impact it may have on patients' well-being.
The project AEGLE, commissioned by European Union (EU), developed a big data framework aimed at providing big data services for healthcare, including electronic healthcare The associate editor coordinating the review of this manuscript and approving it for publication was Juan Lara . record data storage, data analytics, cloud services for accelerated training of complex analytics, and real-time processing of large data volumes. Figure 1 provides an overview of the AEGLE ecosystem. Further details of the AEGLE system can be found at [1]. Under the AEGLE project a host of data analytics was developed including analytics for Type 2 Diabetes (T2D) amongst others.
T2D is a chronic condition with increasing prevalence across the globe. T2D is one of the common causes of morbidity and mortality, leading to significant consumption of healthcare resources. In 2015, Public health England (PHE) reported that 3.8 million people in England aged over 16 had diabetes [2], and it is estimated to have increased to 4.7 million people in 2019 [3]. World Health Organization (WHO) estimates T2D to be the seventh leading cause of death globally [4]. The impact of diabetes on economic costs is significant and was estimated to be $327 billion in the USA alone [5]. Therefore, early intervention and effective treatment strategies are necessary to reduce T2D impact on patient quality of life and economic costs. The increase in electronic recording of patient data over the last few decades provide data analysts opportunities for exploring healthcare databases to identify previously unknown patterns and associations that are potentially useful for a better understanding of disease and their management. Historical data of the patient cohort enables analysts to develop analytics to predict patient disease progression and personalise treatment strategy accordingly [6].
Data analytics for T2D is a well explored topic and substantial amount of research papers can be found in the literature. One of the most widely explored topic in T2D is complication risk prediction. Various models exist ranging from the classical Cox's models and its variations [7]- [9] [10] to the more recent machine learning based models based on methods including support vector machine (SVM) [11], naives bayes [12], nearest neighbor [13], random forest [14], logistic regression [15], genetic algorithm [16] and deep learning [17]- [19].
The progress in development of data analytics for T2D provides a potential for development of a tool that empowers healthcare professionals in data analysis and decision making. In this paper, we present our work on data analysis of T2D data designed for finding associations between different patient markers, risk predictions for various complications, and prediction of patient response to medications. The individual analytics developed are presented as a first step towards a T2D analytics suite with a goal that the suite enables clinicians and researchers to gain insights into T2D disease and its management.
The intention of the analytics suite proposition is to emphasise the potential of using a host of data analytics as a toolbox by healthcare stakeholders for patient data analysis and decision making. An initial assessment of the feasibility of the presented analytics suite was performed as part of the AEGLE project's cloud based big data platform for healthcare data analysis [1], [20]. Initial assessments on the T2D analytics suite were performed by clinicians and received positive feedback.
The analytics presented in this paper are not limited in terms of novelty and clinical significance. The analytics suite represents initial steps towards developing a framework for data analytics suite for clinical practice that will provide a novel and much needed diagnostic tool. Clinicians treating T2D do not always have sufficient information from presenting signs or symptoms to know definitively which medication or course of treatment will work. The vast variability in T2D patients and their characteristic features that can influence the course of the disease and the response to treatment makes it difficult to know which type of treatment may be best for which patient without testing certain medications to gauge response. A tool that will cohort patients with similar risk factors for T2D will provide greatly improved indicators for what course of treatment is best, minimising side-effects and optimising treatment outcomes with a personalised approach. The data analytics platform described in this paper has the potential to offer such a tool to clinicians.
To the best of our knowledge, our paper is one of the earliest attempts towards the development of framework for a data analytics suite for T2D.
The rest of the paper is organised as follows. In Section II an introduction to the T2D analytics suite is given. Section III describes the patient profile classifier analytic workflow. The risk prediction analytics is described in Section IV, followed by description of response prediction analytics in Section V. Section VI discusses the challenges in healthcare data analysis and Section VII concludes the paper.

II. ANALYTICS SUITE FOR T2D DATA ANALYSIS
The data analytics developed for T2D is presented in this section. Figure 2 illustrates the methodology followed for the development of the proposed analytics. The methodology shown is a typical approach followed in data analytics development, however, close collaboration with clinicians at all stages and specifically at the requirements gathering, analytic approach, data collection, modelling and feedback stages is crucial in healthcare related data analysis process.
The T2D analytics suite aims to develop exploratory, predictive, and visual analytics. The exploratory analytics focus on exploring the diabetes dataset for performing operations such as raw data pre-processing, classification, and associations between different patient markers and diabetes-related complications, and hypothesis generation. The predictive analytics are concerned with identifying the risk carried by diabetes patients for a complication based on the patient biological markers and the probability of the patient developing a complication over time in future. The analytics also focuses on predicting the response of diabetes patients to a particular line and combination of treatments. The visual analytics include custom visualisations developed for T2D data analysis that allows clinicians to gain a perceptible insight into the disease and impact on patients.  T2D patient data were mainly obtained from two data sources: Croydon/Prowellness database and Diamond database. A summary of the two datasets is given in Table 1. From the two databases, patient biological markers that are risk indicators of diabetes related complications capable of providing insights into patient response to treatments were identified. After extensive consultations with healthcare experts and with the aid of big data analysis techniques, several analytics were developed.
The principle approach followed for the T2D data analysis was to cluster the patients according to their demographics and biological markers and investigate their associations with known T2D related complications followed by the development of predictive analytics to model the associations between different patient markers. This approach helped to gain insight into hypothesis building. For instance, the example heatmap in Figure 3 obtained on a synthetic dataset illustrates how associations between different variables in a dataset can be explored.
The exploratory part of the heatmap analytic identifies associations between the chosen variables within the T2D database and utilises multiple statistical analysis, including correlation analysis and chi-squared analysis. The findings are then visualised on a heatmap wherein the associations between the variables are represented by means of dendrograms.
In Figure 3 heatmap, the correlation between patient biological markers listed on the y-axis and three risk conditions: visual impairments, renal replacement therapy, and death is presented. In the heatmap, light shades of blue corresponds to strong correlation between the marker variables and the complication risk and darker shades correspond to weak correlations.
The clinicians and researchers can use this analytic to understand better associations between variables or confirm already known strong and weak associations between different variables and thus generate hypotheses for further research and analytic development.
Three T2D analytics workflows were developed, namely: patient profile classifier, complication risk predictor, and patient treatment response predictor. Each T2D analytics workflow further includes multiple analytics. Details on the three analytics workflows, including its development, implementation, and findings are provided in the next three sections respectively.

III. APATIENT PROFILE CLASSIFIER
The patient profile classifier workflow includes both exploratory and visual analytics. Figure 4 illustrates the components of the workflow. The classifier aims to classify patients according to a preferred demographic category (e.g., age or gender) and a biological marker class (e.g., HbA1c levels) and associate the classes to a complication (e.g., blindness). This multi-tier classification is achieved by means of a population pyramid analytic that helps to understand the composition of the population according to chosen criteria [21]. Further, a custom visualisation analytic is built based on the population pyramid analysis.

A. POPULATION PYRAMID ANALYTIC
In Figure 4, the exploratory part of the analytic performs a multi-step classification of the diabetes population starting with age categories. Next, in each age category, the patient profile is further classified according to patient biological marker levels such as HbA1c, Lipids, etc., and the count of patients for each age category and marker class is obtained. The threshold for the marker levels can be set to a chosen value by the user. Further, under each patient marker class, the count of patients associated with complications such as amputation, visual impairments, etc., is fetched.  The data obtained from the exploratory analytic provides a two-tiered population pyramid distribution of the T2D patients, i.e., based on a chosen demographic category and biological marker. To visualise the two-tier population pyramid, an interactive, custom visualisation analytic was developed that plots the findings of the exploratory analytic as a stacked bar-population pyramid graph. The exploratory and visualisation analytic was implemented in R programming language and using the rCharts [22] and HighCharts [23] visualisation packages. Figure 5 shows the stacked-bar population pyramid chart where the T2D patient data is categorized into age categories, low and high HbA1c levels and then associated with patients suffering from visual impairment complications. The visualisation helps clinicians to get an overview of the prevalence of a T2D related complication in a patient subgroup from a database.

IV. T2D PATIENT COMPLICATION RISK PREDICTOR
T2D patients are associated with increased risk for complications such as visual impairment, coronary heart disease, amputations, renal impairment, or stroke [24]. Risk prediction models are beneficial for clinicians and patients to understand their likeliness of developing a complication based on their current T2D condition. Risk calculators such as QRISK2 are recommended for identifying cardiovascular risk among T2D patients [25]. Risk estimation for a complication is done by determining the factors that are likely to cause a complication risk. Identification of potential risk factors and timely intervention for control and management of the risk factors can reduce the patient's risk for T2D related complications [26]. A complication risk prediction model based on the Cox's proportional hazards model is presented in this section.

A. PPREDICTION ANALYTICS DEVELOPMENT
Risk prediction models for several complications including visual impairment, toe amputation, stroke, cardiovascular risk, and renal impairments, were developed. A cohort study of the patient data from the Croydon/Prowellness database was conducted. Through consultation with clinicians and VOLUME 10, 2022 literature research, several predictor variables with established risk factors for T2D related complications were identified and included the variables: age, HbA1c values, blood pressure, BMI, and lipids [7].
The dataset consisted missing values in all of the variables. To addressing missing values, multiple imputations based on Rubin's rules [27] and available in the R MICE [28] package was applied. The imputation over ten iterations were applied on the database to estimate values for missing values in the database and for better complete case analysis [29]. Data standardisation was performed by conversion of metric units (e.g.,mg/dL to mmol/L) and merging of similar data columns.
For risk prediction of a complication, the widely popular Cox's proportional hazards model (CPH) [30] was utilized to estimate the risk factors for each predictor variable. A censoring indicator is used to censor patients at the date of diagnosis of complications. Hence, the censoring indicator is considered to be either a complication or no complication. The survival time of the patients is computed for the patients from the time of diabetes diagnosis to the occurrence of the complication.

B. PREDICTION ANALYTIC RESULTS AND VALIDATION
Based on the pre-processed predictor variables, the CPH model computes the hazard ratios for the various predictor variables. The hazard ratios or the risk ratios indicate the extent of the risk carried by different predictor variables for a complication. Table 2 shows the hazard ratios of five predictor variables obtained for vision impairment and toe amputation risks from CPH models. The hazard ratios (HR) for a predictor variable are interpreted as follows: • HR = 1: No effect on the complication • HR > 1: Increases risk for complication • HR < 1: Reduces risk for complication The risk prediction models are validated using the 10-fold cross-Validation method. The Croydon database was segregated to ten folds of training and test dataset. The risk models for each complication were validated separately using metrics such as sensitivity, specificity, and accuracy. The risk prediction model and the 10-fold cross-validation study was implemented in R programming environment. The sensitivity and specificity analysis for each fold of training and test dataset were analysed and the mean of the metrics across the ten folds was calculated. The sensitivity and specificity analysis follows the True Positive Rate and False Positive Rate estimation described in [31] for risk prediction survival models. The analysis is performed over a 15-year timeline and uses the survAUC R package [32]. The sensitivity and specificity values are used to compute the prediction accuracy of the model via Accuracy = (sensitivity)(prevalence)+ (specificity) (1 -prevalence), where the prevalence is the number of positive conditions over the total population. The outcomes of the results are presented in Table 3.

C. VISUAL ANALYTIC FOR SURVIVAL PROBABILITY ANALYSIS
The CPH model allows the clinicians to obtain hazard scores for the predictor variables and get a global view on their impact on the risk for a complication. It would be beneficial for clinicians and patients to obtain a risk score for individual patients based on their biological markers. A survival analysis based visualisation analytic is designed using the CPH model developed for complication risk predictions. Two sets of survival analysis curves are presented where (1) provides a global view of a predictor variable impact on a complication risk, and (2) provides a survival probability curve for individual patients based on their conditions. In Figure 6, various survival probability curves for each complication obtained from the visual analytic are shown. Each probability curve for a complication demonstrates the increase in risk for the complication over time for all the patients considered in the Croydon/Prowellness database. These survival curves enable clinicians and researchers to analyse complication risks for a cohort group of T2D patients from a dataset or geographical region and frame interventions and policies to reduce the risks of the complication. More insightful survival curves are obtained by demonstrating the impact of specific patient markers on the survival probability.
In Figure 7, the impact of four patient markers; HbA1c levels, body mass index (BMI), blood pressure, and ighdensity lipoprotein (HDL) lipids levels; on the risk for visual impairment is demonstrated. Each patient marker is categorized into low, medium, and high levels along with its impact on the survival probability is shown in each individual sub-figure. For instance, in Figure 7c, the survival probability curve (in red) is higher for low BMI and the probability of survival decreases for medium BMI (green curve), and further decreases for high BMI (blue curve). Conversely, in Figure 7d for HDL lipids where high level (in mmol/L) is considered healthy, the survival probability curves progressively increases for low, medium, and high HDL lipid levels.
In terms of an individual T2D patient, understanding their current risk for a complication can be an important information for the treatment and management of diabetes for clinician and the patient. Based on the CPH complication risk models, a survival analysis user interface was designed and developed for potential use by clinicians and patients. Figure 8 shows the user interface for a complication risk  analysis for patients. The user interface allows a clinician or patient to input their biological marker levels such as BMI, HbA1C, blood pressure, and other entries and obtain a survival probability curve for their current condition to understand their risk levels. This information can help clinicians and patients to formulate a strategy for the patients' diabetes management, for instance, lowering BMI or blood pressure control.

V. PATIENT TREATMENT RESPONSE PREDICTION
T2D is a complicated disorder and often correlates with several microvascular complications such as renal damage, retinopathy, and neuropathy along with other major complications such as stroke and heart disease [33]. Eleven distinct mechanisms are currently thought to cause diabetes, and over a hundred genetic points are associated with T2D. Based on various observed characteristics, different subgroups of diabetes patients are known [34].
T2D patients belonging to different subgroups tend to respond differently to different classes of medications. For instance, a combination of sodium-glucose transporter 2 inhibitors (SGLT2is) with glucagon-like peptide-1 (GLP-1) mimetics are common treatment drugs for T2D patients. However, people with type 2 diabetes who are insulinopaenic and therefore at risk of ketoacidosis [i.e. a build up of ketoacids in blood, a serious acute metabolic distrubance] should not be used in patients who are ketosis prone [20].
Identification of patient-related factors that potentially lead to non-response to specific treatments can help in choosing the optimal class of treatments for a patient and thus personalise and accelerate the patient treatment with known effective medications. Further benefits include reducing the number of medication trials, cost savings, and decrease patient exposure to potential side effects.
Big Data analysis provides opportunities in identifying groups of patients who are likely to respond to a specific line of treatment. Patient cohort data over an extended period and a combination of dataset sources enables to detect patterns and patient response to medications over time. Analysis of cohort data provides the potential to build prediction models to predict patient response to specific medications based on patient characteristics. The Diamond database offers a cohort VOLUME 10, 2022 of T2D patients, including medications recommended to them. A machine learning-based prediction model is built for predicting patient response to third line agents (i.e., SGLT2is inhibitors). The SGLT2is inhibitors are used to promote glycosuria and are an approved class of drugs in the treatment of T2D.

A. TREATMENT RESPONSE PREDICTOR IMPLEMENTATION AND RESULTS
Before building the prediction model, it is necessary to train the machine learning model to learn to predict patient response to SGLT treatment. From the T2D Diamond database, patients treated with SGLT are considered to show good response when they show improvement in HBA1c levels by 11 mmol/L over three or six month period. Based on the HbA1c changes, the patient response is classified into the top and lower quantiles of good response and bad response category. In the next step, patient features are extracted that are known to potentially influence patient response to medications. The features selected include age, gender, duration of diabetes, weight, BMI, HbA1c levels, and medications taken.
A cohort data of approximately 2300 patients from the Diamond database was selected to train and build the prediction model. Out of the 2300 patients, approximately 1000 patients belonged to the good response category and the remaining to the bad response category. The dataset was further classified into a training dataset (80%) and a validation dataset (20%). The well-known machine learning model support vector machine (SVM) was chosen as our prediction model due to its proven high-performance accuracy in data prediction [35]. The prediction model was implemented on R programming environment. The SVM model was validated via a 5-fold Cross-Validation study. An average prediction accuracy of 65.05% was obtained in the 5-fold Cross-Validation, and the best prediction accuracy obtained was 73.3%. The outcomes of the prediction model are shown in Table 4. The treatment response prediction model provides capabilities to analyse the response of patient subgroups to a specific line of treatments. This leads to a reduction in medication trials to find the most effective treatment for T2D patients.
Inclusion of such analytics is beneficial for clinicians to predict the response of a patient of a certain profile to a particular line of treatment. With increasing data collection on patient response to medications, the presented prediction model can be further periodically trained to be more reliable and to give accurate predictions. In addition to models such as SVM, the presented approach can be adapted to include other machine learning models such as Naives Bayes and k-nearest neighbor (kNN) for better support to clinicians with treatment decisions.

VI. DISCUSSION -CHALLENGES IN MEDICAL DATA ANALYSIS
The process of developing data analytics for healthcare presents unique challenges due to the sensitivity of the data involved and the impact of the outcomes. Some of the common challenges in data analysis along with recommendations to overcome the challenges are discussed below.
• Data quality: Like most big data solutions, data quality is a problem too in the healthcare domain. Main issues with data quality arise due to lack of completeness in the data (missing values), data repetition, irregular and VOLUME 10, 2022 inconsistent data update, less accurate and invalid data entries. Data pre-processing approaches such as multiple imputations and standardization of multiple data sources can address data quality issues. In our studies, several approaches to improve data quality were used. For instance, multiple imputations were part of data preprocessing for complication risk predictors presented in Section IV. The Diamond database and Prowellness databases were often merged to provide sufficient data volume for our analytics. Data standardisation was approached by conversion of metric units (e.g., mg/dL to mmol/L) and merging of similar data columns.
• Feasibility: Developing big data analytics for healthcare requires multidisciplinary effort between data analysts and clinical experts. Prior to development of data analytic solutions, feasibility analysis is required. From the clinician's perspective, use case scenarios must be developed to describe the relevant clinical problem to be addressed. Clinicians must also analyse the data feasibility, i.e., availability and quality of data. For instance, during the course of our study, development of advanced deep learning based data analytic solutions though desired were not feasible due to lack of availability of large datasets. From data analysts perspective, technical feasibility analysts would allow the stakeholders to arrive at a feasible solution for potential development. Factors such as cost-effectiveness, clinical relevance, and application of outcomes in clinical trials must be evaluated before investing in development of data analytics.
• Solutions for Decision Support System: It is essential for the solutions developed to enact as a Decision Support System (DSS). A DSS would be an empowering tool for clinicians to make patient treatment-related decisions. For instance, the survival probability analyser UI presented in Section IV can be utilised by clinicians to understand a particular patient's present risks to a complication and use the knowledge to strategise on disease management. Further modifications to the probability analyser to enable it to describe a patient risk in descriptive form (e.g., low, medium, and high risk) can potentially be used by a patient to assess their risk category either independently or under guidance from a clinician.
• Simplicity: Often, solutions for many data analytics do not require Big Data infrastructure and can be solved with available data mining tools. However, as the volume and veracity of healthcare records are increasing, sophisticated big data tools are required. Despite the sophistication and complication required for the development of big data analytics, it is desirable for the analytics outcome to be a simplified solution capable of utilisation in daily clinical practice. One of the objectives of the various analytics presented in this paper is to present simplified solutions for understanding and improving T2D disease management. We believe the data analytics presented in the paper with further clinical validation have the potential to be adopted in clinical practice especially for activities such as data visualization and risk prediction. A key factor being that it does not require significant IT infrastructure and can be adapted according to the data availability and requirements of the clinician.
• Extensibility: A desirable feature for data analytics is to permit inclusion of additional features and models in analysis. The analytics presented in the paper can be extended to include relevant features for analysis. For instance, the population pyramid analyser and complication risk predictor can be extended to include new biological markers for analysis and are not restricted to the markers presented in the paper. As discussed in Section V-A, the presented prediction model approach is not limited to SVM model alone and can be extended for use with other machine learning models.
• Scalability: A key characteristic for analytics is the ability to scale the analysis to larger datasets. The presented analytics are tested on relatively smaller datasets with lower than 20,000 patients. However, further tests are required to evaluate the capability for analysing significantly larger datasets. The tool requires further testing of the analytics on a large scale using more external T2D databases. Planned future works include design of a robust framework for the analytics suite that includes flexibility for clinicians to choose from multiple models. Further, the data models in the analytics will be extended to include more advanced, clinically validated models.

VII. CONCLUSION
In this paper, we presented an analytics suite that performs exploratory, predictive, and visual analysis of T2D data. Three types of analytics workflows were presented that perform: (1) classification of T2D patients into required categories and identifying associations to a condition of interest, (2) analysis of T2D database to build a predictive model that can assess risk of patients to T2D related complications, and (3) prediction of patients' response to a specific line of treatment plan. The visual analytics provides a simplified representation of the outcome for clinicians and patients.
The analytics presented have the potential to support clinicians to decide treatment plans for T2D patients. This offers huge advantage that had not been previously possible for a more personalised approach to treating T2D that will be safer and more beneficial for the patient as it will minimise side effects and offer faster, more effective treatment. It will also provide economic advantages to the healthcare system.
Possibilities for future work include building and training the model on larger databases to increase the prediction accuracy and develop more robust prediction models by adopting artificial intelligence methods, and clinical validation of the data analytics. Her research interests include the advancement of data and multimedia communication and networking and information technology for healthcare applications. She is a PI and a Co-PI of many national and international mHealth projects in the areas of personalized health for diabetes, cancer and COPD conditions, 5G health, wearables and cloud computing, the IoT, AI and big data analytics for health, social robotics for health, end to end QoS, and QoE in medical video streaming. She is the author and coauthor of more than 80 journals, peer-reviewed conferences, and book chapters. She is a member of the editorials and the review panels for many journals, including IEEE INTERNET OF   BARBARA K. PIERSCIONEK received the Ph.D. degree in the protein chemistry and optics of the eye lens from Melbourne University, Australia. She has expertise in optics, biochemistry, biomechanics, nanotechnology, and cell biology and how these apply to the study of eye development, ageing and disease and to new technologies for sight improvement. She is also qualified in law and has research interests in ethico-legal aspects of big data and emerging technologies. She has published over 150 peer-reviewed papers, four book chapters and a book on law and ethics for the eye care practitioner. She was awarded a Prestigious NHMRC Research Fellow (MRC equivalent) shortly after graduating to start an independent research program on the optics of the eye. She led the Vision Research Group, Ulster University, in biomedical science and worked as the Associate Dean (Research and Enterprise) with the Faculty of Science, Engineering and Computing, Kingston University. Subsequently, she held dual roles at Nottingham Trent University, the Associate Dean Research with the School of Science and Technology and the Pan-Institutional Head of Health and Wellbeing. More recently, she led research in two Schools as the Associate Dean Research with the School of Life Science and Education and the School of Health and Social Care, Staffordshire University, before taking up the post of the Deputy Dean (Research and Innovation) with the Faculty of Health, Education, Medicine and Social Care, Anglia Ruskin University. She has continued as an Active Researcher in the areas of optics and biomechanics of the eye, ageing of the eye and eye disease, bioinformatics, sports and binocular vision, nanotechnological applications to the eye and ethicolegal aspects of big data. She has received support for her research with funding from Research Councils (EPSRC, BBSRC), EU, Fight for Sight, Royal Society and industry (Essilor International and Zeiss Meditec) and being awarded beam time grants for work in Japan at SPring-8 the world's largest synchrotron. VOLUME 10, 2022