# Artificial Intelligence Algorithms for Treatment of Diabetes
## 1 Introduction
The decisions rendered in T2D typically are on longer-term timescales, with algorithms developed to offer pharmacotherapy suggestions and lifestyle modification recommendations to care providers for more effective personalized treatment of patients. The differences in the frequency of data and the timescales for rendering decisions lead to the development of different ML algorithms for these two types of diabetes. Training AI algorithms to help diagnose and treat T2D is challenging because of the diverse spectrum of the chronic disease across the population, the various treatment options and alternatives, and the potential existence of comorbidities and diabetes-related complications. The complex pathophysiology of T2D necessitated the development of different classes of oral and injectable drugs that target specific biochemical pathways to address various characteristics associated with T2D [20; 21]. Treatment can include the administration of one or more of these drugs [22; 23]. In case of comorbidities, such as cardiovascular diseases, chronic kidney disease, or diabetes complications such as nerve damage, foot complications, and eye disease, additional medications to treat these conditions are also administered. Drug-drug interactions and adverse side effects are common. Lifestyle, including diet and physical activity, is a critical component of the treatment of T2D. Physical activity can increase the risk of hypoglycemia with certain anti-diabetic medications. Thus, the diet, activity level, and lifestyle of the patient must be taken into consideration. A major goal of ML systems that assist medical professionals to personalize treatment approaches is to determine the characteristics and state of T2D for a subject, classify the subject in the most likely cluster of patients with similar characteristics [16; 24] and identify the treatment options that have the highest probability of success for this individual [16]. Electronic health records (EHR) capture the medical records of people with T2D and provide a good source of data for clustering people with similar characteristics and identifying treatment(s) that have been successful for each cluster. This data is heterogeneous, including free text, structured information (e.g., entered from hierarchical drop-downmenus) and numerical values (e.g., lab results), necessitating natural language processing (NLP), planning, and structuring for analysis. ML can also identify secondary connections to undiagnosed or potential comorbidities. AI will determine the interventions that are most likely to be effective for specific clusters of patients with T2D. Interventions include various types of antidiabetic drugs that affect different aspects of the metabolism and have different side effects and lifestyle changes (diet, physical activity, stress, and sleep). Currently, the management of all these factors, including the selection of the specific drugs and drug doses that would be appropriate for an individual relies on the experience and decisions of the medical care provider. We will pull the diagnosis codes, laboratory data, medications, and visit types for patients over a 10-year period. The data will include the free text notes from primary care physicians, nurses, social workers, and nutrition notes. Biomedical informatics can leverage ML algorithms to gain insights from historical EHR systems. The first step in EHR data mining is identifying missing data and errors, followed by data reconciliation. Then, concerns on bias in data and data size will be addressed. [PERSON] and [PERSON] have developed various techniques for detecting and reconciling missing data and errors by multivariate statistical and systems engineering techniques [25; 26; 27]. A different set of ML approaches have been developed by [PERSON] (fair and robust AI, learning with weak data) [28; 29; 30; 31; 32].