Machine Learning and Antibiotic Management

Machine learning and cluster analysis applied to the clinical setting of an intensive care unit can be a valuable aid for clinical management, especially with the increasing complexity of clinical monitoring. Providing a method to measure clinical experience, a proxy for that automatic gestalt evaluation that an experienced clinician sometimes effortlessly, but often only after long, hard consideration and consultation with colleagues, relies upon for decision making, is what we wanted to achieve with the application of machine learning to antibiotic therapy and clinical monitoring in the present work. This is a single-center retrospective analysis proposing methods for evaluation of vitals and antimicrobial therapy in intensive care patients. For each patient included in the present study, duration of antibiotic therapy, consecutive days of treatment and type and combination of antimicrobial agents have been assessed and considered as single unique daily record for analysis. Each parameter, composing a record was normalized using a fuzzy logic approach and assigned to five descriptive categories (fuzzy domain sub-sets ranging from “very low” to “very high”). Clustering of these normalized therapy records was performed, and each patient/day was considered to be a pertaining cluster. The same methodology was used for hourly bed-side monitoring. Changes in patient conditions (monitoring) can lead to a shift of clusters. This can provide an additional tool for assessing progress of complex patients. We used Fuzzy logic normalization to descriptive categories of parameters as a form nearer to human language than raw numbers.


Introduction
Machine learning (ML) is a subfield of artificial intelligence, providing systems with the ability to learn from experience and extract knowledge from the available data [1][2][3][4]. It has been widely used in the medical field, from radiology to surgery, from oncology to intensive care [5][6][7][8][9]. Supervised machine learning-based systems have been employed to predict patient deterioration risk [10,11], heart failure onset [12,13], acute kidney injury [14], delirium [15], sepsis [16][17][18][19] and mortality [20,21]. Unsupervised ML, on the other hand, has been used to analyze, cluster and manage large amounts of data that lie beyond clinicians' ability to handle them. It provides aid to medical staff in the decisionmaking process, diagnostic method and treatment prescription [22,23]. It can offer support, especially in antibiotic therapy management, although it remains subordinate to international guidelines, protocols and indications [24,25]. In fact, in everyday clinical practice, several issues concerning timing, selection and suitability of antibiotic therapy arise. Recently, the role of ML in infection management and electronic health records has been

Population and Data Collection
The study was conducted using data pertaining to all patients admitted in the 18-bed ICU at "Fondazione Policlinico Universitario A. Gemelli IRCCS" from 2012-2017.
ICU stay charts (including therapy, fluid balance, and vitals monitoring) are collected, managed, and stored in a patient database management system (PDMS): Digistat by Ascom UMS. All data for this study were extracted and analyzed in anonymized datasets. All clinically validated acquisitions stored in the database were considered for analysis.
For each patient, we assess the duration of antibiotic therapy, consecutive days of treatment and type and combination of antimicrobial agents (each with respective consecutive days of therapy). We decided to define a single "pattern of antimicrobial therapy" as the specific combination in a patient-day (treated as a single record) of the overall duration of therapy and one column for each antimicrobial therapy used in the population during the Antibiotics 2022, 11, 304 4 of 15 observation period (resulting in a record of 91 columns having 0 for drugs not used in that day for a patient or the sequential number of therapy days for that drug for a patient).
Duration of therapy was normalized using a fuzzy logic approach to minimize the dispersion effect: duration of therapy (overall and for single antimicrobial agent) for each patient was included in a fuzzy-logic domain having as an output the classification in "none", "ultra-short", "short", "medium", "long" and "ultra-long" for each item. [58,61,62] We extracted from our electronic database the following data for all patients (with or without antimicrobial therapy during ICU stay): heart rate, arterial pressure, central venous pressure, intracranial pressure, oxygen saturation, arterial blood gas (ABG), fluid balance (infusion velocity, diuresis and ultrafiltrate from renal replacement therapy if applicable). Each monitoring hour was considered as a whole single record: i.e., for each patient day of antibiotic therapy, we could have N (at least 1 and generally 24 for 24 h) patterns of monitoring parameters (resulting in a record of 46 columns: one for each possible monitoring parameter). Not every patient must necessarily have all the parameters monitored for every hour (i.e., intracranial pressure or continuous renal replacement).
For each day of antibiotic treatment given to every single patient included, we matched hourly monitoring records and only considered patients with both antimicrobial therapy and monitoring available for analysis.

System Development
Data extracted were analyzed using ad hoc Python scripts (Python 3,6 for Linux). Standard statistical and scientific libraries were used for analysis and graphics (Scipy, Statistics, Sklearn, Numpy, Pandas, Mathplotlib) [63,64]. Fuzzy domains were calculated for all non-null values, assuming data distribution in three overlapping triangular regions and two rectangular trapezoids at the extremities (with the triangular part overlapping the adjacent triangular region). Dimensions of each region and overlapping were automatically calculated for each parameter (starting from basic statistical analysis of the sample), assuming that the limits of the whole domain could describe 95% of population observations. A specific fuzzy domain was produced for every parameter.
For each parameter (in therapy as well as monitoring set), a specific domain was created starting from the statistical analysis of every non-null data in the population for that parameter. We aimed to obtain a scheme centered on the median value of the distribution (so to better represent all occurrences whose summed frequencies reached at least the 95% of observations). Frequencies of each occurrence of data elements for each parameter were first calculated for all raw observations in the population. Then only the values falling in the range of 95% of observations were extracted and put in a table. Subsequently, the data included in this table of the central 95% of values were used to calculate a new median point, and all values in the population of raw observations outside of this range were automatically assigned to the extreme trapezoid subsets of the domain named "very low" and "very high". Overlapping regions were set to be equal to one half standard deviation for parameter distribution in the 95% table. Normalization was performed to calculate the membership function of each value (fuzzification: calculating the degree of membership of a value for each subset). The membership function for each value in each domain has a range from 0 to 1: the degree 0 means that the value is not a member of the fuzzy subset; the degree 1 means that the value is fully a member of the fuzzy subset. Values falling in an overlapping region between two subsets were assigned to one of them in the process when their degree of membership was higher than 0.5. A graphic example of a fuzzy domain is presented in Figure 1.

Datasets
Data of antimicrobial therapy duration and monitoring parameters sets were normalized as previously described. After normalization of each variable, we obtained two normalized datasets (one for antimicrobial therapy and one for monitoring) used for further analysis. Each record of the two datasets has columns in which possible values are only 0 (for drug/monitoring parameter non-present) or 1 to 5 representing fuzzy subsets F1 to F5.
Each record of the two normalized datasets was treated as a potential unique pattern. Two tables (one for antimicrobial therapy and one for monitoring) were created containing only unique patterns (repeated pattern recorded as one in each set, non-repeated pattern recorded as one): assuming each record (i.e., pattern) of the two sets as a single vector (in a Euclidean multi-dimensional space), we matched each of them against all the others in the same set for Euclidean distance. When a distance of 0,0 (no distance) was found we assumed identity.
After this reducing step, we performed cluster analysis using k-modes unsupervised clustering on the two shorter datasets of unique patterns (k-modes is used for clustering categorical variables; it defines clusters based on the number of matching categories between data points-this is in contrast to the more well-known k-means algorithm, which clusters numerical data based on Euclidean distance) [65][66][67].
The number of clusters for every k-modes analysis was calculated by computing the elbow method for each k in a starting range of 25. We decided to use 4 clusters (cost score 285,103) in the therapy dataset and 7 clusters (cost score 41,737) in the monitoring set for k-modes analysis.
Single antibiotic days of therapy and single hours of monitoring (i.e., the records of the two datasets) were then translated as pertaining clusters for each set and so referred to in the remaining part of the analysis (i.e., patient X day 4 h 10 is in cluster 3 in monitoring and in cluster 2 for antibiotic therapy). For each patient a table of days of therapy, marked using therapy pattern cluster id, and 24 columns of consecutive hours of monitoring (each marked as the respective monitoring cluster id as well, or 0 if not present: not all the days of every patient have a complete range of 24 h monitoring) was obtained (i.e.,: patient X day 4, therapy-cluster-id, n = 24 monitoring-cluster-id). Each of the rows in this table, chronologically ordered for each patient, was used for patient ICU stay statistics.
Basic descriptive statistical analysis was performed for each cluster and on ICU stays. Each variable composing a record of the two datasets (Therapy and Monitoring), normalized using fuzzy-logic as described above, is intended as suitable for daily patient evaluation for clinicians alongside results of clustering in tables and charts.
Charts for fuzzy representation of parameters and for clustering were produced, as well as charts for each patient ICU stay (excerpts of 14 h of ICU stay of two random patients are presented in Figures 2 and 3).

Results
During the period 2012-2017, 5164 ICU admitted patients undergoing antibiotic therapy were extracted from the database. All together, these provided 57,329 patient-day combinations of normalized data, referred to as "antimicrobial therapy pattern". After removing repeated patterns, the total number of unique antimicrobial therapy patterns was 7763. In the same period, we extracted 935,102 hourly observations of monitoring variables-named "hourly monitoring patterns" (of normalized data)-, referring to patients treated or not with antibiotic therapy, to be assured of including the widest range of measures for each variable. After removing repetitions of patterns, the total number of unique hourly monitoring patterns was 57,966. Considering patients undergoing antimicrobial therapy and available monitoring data, we analyzed 4129 patients and 543,190 h of monitoring in 31,455 patient days.
Duration of antibiotic therapy was normalized according to fuzzy logic in a domain with five fuzzy subsets: "ultra-short", "short", "medium", "long" and "ultra-long" ("none" for non-present data as previously described) for both overall consecutive days of therapy and single drug consecutive days of therapy. Unsupervised cluster analysis collects unique daily antimicrobial therapy patterns in four clusters. Table 1 shows frequencies of every fuzzy domain subset in each antibiotic therapy cluster. Each monitoring variable has been fuzzy normalized in five fuzzy subsets: "very low", "low", "medium", "high", "very high" ("none" for non-present data). Unsupervised cluster analysis collects unique hourly parameter monitoring patterns in seven clusters. Frequencies of every cluster in each fuzzy domain of hourly monitoring pattern are shown in Table 2.  Table 3 shows an example of a fuzzification method applied to the parameter of total days of consecutive antimicrobial therapy.   Limits in the fuzzy domain for total days of therapy (limits are in days). Values equal or over the limit of VHH observation are classified in category (subset) 5; equal or below VLL observation are classified in category (subset) 1. Figure 1 represents an example of a fuzzy domain.         Considering each single patient ICU stay, we found that the maximum number of antimicrobial therapy clusters per ICU stay was four. We observed groups of patients having one, two, three, or four different therapy clusters during stay, not saying which of the therapy clusters-Nabtcl... Table 5 presents a synoptical view of therapy clusters, monitoring clusters and consecutive days of therapy stratified by number of therapy clusters in ICU stay (Nabtcl).
For more details on k-modes cluster analysis compared to k-means cluster analysis on the same data, see Supplementary Materials.

Discussion
In their 2019 paper, Al-Dmour et al. [59] proposed an implementation of a warning system that utilizes fuzzy logic for patient classification. Starting from the literature reported in the paper, they proposed that, when the diagnosis might not be very clear, and there is an element of uncertainty in the reasoning process followed to reach a diagnosis, the use of fuzzy logic has shown to provide an effective reasoning methodology that can address uncertainties and vagueness since it allows for the representation of imprecise knowledge. They used parameters coming from assessment of the Modified Early Warning Scoring (MEWS) system (physiological parameters or vital signs readings such as temperature, blood pressure, heart rate, respiratory rate, oxygen saturation, and blood sugar) [66]. MEWS score ranges, in the cited paper, for each parameter were reviewed by experts and transferred to linguistic terms or categories, each category identifies a fuzzy set; a membership function for each set and a range were defined for each function.
In the present paper, we used a similar fuzzy logic-based approach for data translation. We used a statistical method instead of expert definition for fuzzy domain range settings; we think that this method could be useful for continuous retraining of the model or for different kinds of applications (i.e., for a single parameter performing stratification on a subset of the general population or focusing only on a single patient during the ICU stay). In the present paper, the typical process of a Fuzzy Inference System of mapping an input to an output is used only for the first stages: defining the membership functions and converting the data to linguistic categories. We applied fuzzy logic conversion to linguistic terms to both ICU patient monitoring parameters and antimicrobial therapy expressed in days. We then used converted parameters for exploration of clustering methods.
In our approach, we do not define a priori conditions for defining clusters either in antimicrobial therapy or monitoring. The assumption is: we are not looking only at a specific antibiotic (or combination of multiple drugs), its duration of therapy in patients with specific severity score (i.e., MEWS), or for a specific clinical condition ( [33][34][35][36][37][38]. We do not, at the moment, even imply an association with outcome or length of stay in ICU to therapy patterns and clusters. We do not want to suggest therapy changes using specific patterns of empirical therapy outside of protocols when clinical modifications are observed. In other words: we do not propose a rule-based engine for prediction, but rather we show a model for data presentation to clinicians. Our definition of therapy pattern is based on duration of therapy (overall and for each drug during ICU stay: i.e., patient X is at day 7 of antimicrobial therapy, receiving drug Y for 3 days and drug Z for 7 days). Clusters of this interpretation of therapy patterns were analyzed. We can say, looking at the frequency distribution of fuzzy subsets in each therapy cluster, that cluster 1 and 2 (T1 and T2 in tables and charts) contain more fuzzy subsets F1 (11% in T1; 21% in T2) and F2 (49% in T1 and 47% in T2) (representing "very low" and "low" duration of therapy), and that in cluster 3 (T3) there are more of summed "high" and "very high" fuzzy subsets (F4 and F5 = 36%), meaning long and very long duration of therapy (but also 34% of F2 = "low" duration). Cluster T0 has a very low percentage of "long" and "very long" duration of therapy (F4 = 9%, F5 = 7%).
This does not mean that a patient starting antimicrobial therapy (at day 1) is per se in cluster 1 (T1), but if he/she is in cluster T1 he/she shares something (maybe the drugs used in the pattern or the combination of overall duration of therapy and the same drugs) with other patients. With passing days of therapy, the same patient could change his/her pattern and the day of therapy could be in a different cluster. The new cluster he/she is in, means he/she shares the condition of overall and single/multiple drugs duration of therapy with other patients.
In our population, the maximum number of therapy clusters per patient ICU stay was four (i.e., there were patients who changed therapy pattern and overall duration of therapy to a maximum of four different clusters). Patients with only one therapy cluster during ICU stay had therapy days mostly in cluster T0; patients with three clusters in the ICU stay had equal frequencies of the four therapy clusters and patients with four therapy clusters in the same ICU stay most frequently had cluster 1 (40%).
The same point of view must be used for monitoring. Monitoring clusters 0 and 3 (M0 and M3 in tables and charts) have most of summed fuzzy subsets F4 and F5 (49% in M0 and 38% in M3), while M1 and M6 have more of summed F1 and F2 (M1 47%; M6 51%) than the others. The severity of having "very low" or "very high" for a parameter is parameter-dependent ("very high" Heart rate and "very high" SpO2 are different). Therefore, assuming that a monitoring hour in cluster M0 is better than M6 is erroneous. However, small (and not so small) variations for monitoring parameters are compensated using fuzzy subsets and clustering. Medical evaluation of single variables (even if expressed in descriptive terms) and their association is always needed. If a patient changes his/her cluster for monitoring from one hour to another, considerations of similarities to other patients should be made (the patient stopped being equal to him/herself).
Combining the two sets (antimicrobial therapy and monitoring), we can obtain a broader space for medical discussion. Again not a priori, but rather a patient-centered discussion nearer to precision-medicine.
In our population, we observed relatively higher frequencies of monitoring cluster M4 in all therapy clusters. The contingency table is presented in Table 4.
Patient profiling is a physician/human attitude, often addressed as a clinician's experience. In everyday ICU practice, data (lab, vitals, imaging, and physical examination) are summarized in briefings and hand-over using more descriptive qualitative rather than quantitative expressions. Providing a method to measure that clinical experience, a proxy for that automatic gestalt evaluation that an experienced clinician sometimes effortlessly, but often only after long, hard consideration and consultation with colleagues, relies upon for decision making, is what we wanted to achieve with the present work.
Critical patients are so defined as a "whole" and clustering is strictly implicit in the definitions. Scoring systems for severity are daily used for staking patients in stratifications often based on comorbidity, reasons for ICU stay, chronicity, etc. Smart alarms based on variations in vitals are used in monitoring equipment. Using scoring systems based on fixed ranges for vitals instead of five different grades could limit the prospectical vision of a patient deterioration.
We explored the possibility of combining medical reasoning and language (expressions like: "worsening", "stable", "always the same", "similar to that kind of patient", etc.) to the machine learning world.
Using fuzzy logic-style normalization for data and performing cluster analysis on these sets could be seen as choosing different keys when trying to open a lock: the shape of the key can be similar to some but very different to others. Exploring similarities can be an option, but having evidence of differences could be more informative, particularly when changes occur in the same patient.
We decided to use data from our database instead of public domain datasets for vitals and therapy. In our ICU, antimicrobial therapy has always been prescribed using a stewardship approach. Changes in therapy are (and have been) always made, in our ICU, using both protocols and patient evidence (laboratory findings, microbiological evidence, patient risk factors). Nonetheless, changes in patient conditions can lead to diagnostic and therapy changes using a human (experience) sense of probability more than weighted or statistical evidence.
Cluster analysis of antimicrobial therapy and monitoring as separate entities is not what we (as intensivist care specialists) call "the real world". We decided, therefore, to combine two sets in one presentation to reproduce what we consider in single-patient analysis when antimicrobial therapy changes are concerned (i.e., How long has he been on therapy? How long on XXX-drug? And in combination? How is he doing with his hemodynamics/temperature/renal-organ-functions? Never did better/worse?).
As proof of this concept, we wanted to develop a system that could provide the clinicians a synoptical view of data as a support for therapy evaluation. We, then, decided to have an unsupervised cluster analysis on therapy and monitoring sets. The monitoring and therapy patient data are expressed in a descriptive/categorical form, typical of the human language.
As evident, our proposal for antimicrobial therapy evaluation using temporal categories cannot substitute general/local protocols or recommendations. The cluster analysis of the datasets, and the combination of these, can provide statistics for clinical discussion about patients. Suppose a patient is in a cluster of antimicrobial therapy (i.e., overall days of therapy and each drug consecutive day of therapy). In that case, he/she shares a statistical nearness with other patients independently from reasons of ICU stays or severity score at admission (i.e., Apache-II or SAPS-II). In a retrospective analysis, this is always a subtly implied entity. Using experience and weighing the evidence of shifting from one cluster to another can give an idea in an ongoing view of what the missing data might be (antimicrobial evidence, vitals changing for not-yet-known new illness, and so forth).
What we yielded, and propose here, is an embryonal series of graphic presentations for each patient's progress during his/her ICU stay based on the fuzzy translation of each parameter and cluster linkage for clinical discussion. In our mind, this should be an integrated tool of our digital patient record as a natural companion to the numeric tables for vitals and therapy charts.
Future research opportunities using this approach could be: analysis of whole patient therapy (not only antimicrobial); comparison of patients within same clusters and co-morbidities; exploration of antimicrobial therapy clusters for severity and mortality focusing on use of specific antibiotic patterns; temporal analysis of antimicrobial drug use.
As criticism about the reasons why clinician trust for ML methods were proposed [60], we hope that our approach could improve trust in ML methods.
This study has some limits. It is a single center retrospective study based on ICU patients. Monitoring data and therapy are limited to a short set. It is an embryonal exercise proposed as a proof of concept of a methodology. Upon these premises, no clinical validation, nor prediction model is proposed. Antimicrobial therapy was used, but concurring drugs/therapies were not considered. We did not perform any kind of analysis on subsets of antimicrobial drugs or combinations of them (i.e., different classes use, daily drug dosage, etc.). We did not construct a fully structured fuzzy-logic inference engine, using only conversion to linguistic terms of the variables: no expert revision and validation, nor comparison to existing severity scores, of the fuzzy domain ranges has been performed. We performed clustering analysis just using k-modes algorithm: in Supplementary Materials, a raw comparison to k-means analysis on the same datasets is only proposed as an example, not as demonstration of robustness of our approach. Considering an expansion of the datasets (especially for therapy) could lead to different clustering and need for a wider population or change in the methods proposed here.

Conclusions
A practical clinical approach to the constant increase in patient data flow in a modern ICU is a widespread issue. Antimicrobial therapy is an issue often discussed during patient examination, briefing or handover. Consideration of a patient's modifications in terms of a group of parameters, normalized using fuzzy categories, could be used as a logical map for describing his/her ICU stay. Far from being conclusive in considering antimicrobial therapy prescription in intensive care, our approach could be a guide for daily clinical patient management for diagnostics and care. Extending the same methods to other patient parameters (i.e., non-antimicrobial therapy, laboratory findings, microbiological evidence, etc.) collected during the ICU stay and presenting them to the intensivist could be, as a further extension of the present paper, useful to paint a more precise picture of the clinical patient condition when modifications are observed.
Using fuzzy sets and clustering could be, in our opinion, a starting point for a different approach to presenting ML prediction algorithms to the clinician for precision medicine.
Supplementary Materials: The following are available online at https://www.mdpi.com/article/ 10.3390/antibiotics11030304/s1, Figure S1: silhouette plot of k-means clustering using four centers for antibiotic therapy; Figure S2: Silhouette plot of k-means clustering using seven centers for monitoring parameters; Figures S3 and S4: K-Modes clustering. Cost plot for Monitoring ( Figure S3) and Therapy ( Figure S4) clustering for number of cluster selection; Table S1: K-Means clustering. Frequencies of every fuzzy domain subset in each antibiotic therapy cluster; Table S2: K-Means clustering. Distribution of frequencies of fuzzy categories (subsets) per monitoring cluster; Table S3: K-Means clustering. We show the contingency table between antimicrobial therapy pattern clusters and monitoring pattern clusters; Table S4: K-Means clustering. Basic statistics on ICU stays; Table S5: K-Means clustering. Basic statistics on ICU stays; Table S6: K-Modes clustering. Clustering of unique daily antimicrobial therapy patterns: distribution of frequencies of fuzzy domain subsets per antibiotic therapy cluster; Table S7: K-Modes clustering. Clustering on unique hourly parameter monitoring patterns: distribution of frequencies of sum of fuzzy subsets per monitoring cluster; Table S8: K-Modes clustering; Table S9: K-Modes clustering. Basic statistics on ICU stays; Table S10: K-Modes clustering. Basic statistics on ICU stays.