<?xml version="1.0"?><!DOCTYPE article PUBLIC "-//NLM//DTD JATS (Z39.96) Journal Publishing DTD v1.2 20190208//EN" "JATS-journalpublishing1.dtd"[]><article xml:lang="en" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:mml="http://www.w3.org/1998/Math/MathML" dtd-version="1.2" article-type="research-article"><front><journal-meta><journal-id journal-id-type="publisher-id">IJPDS</journal-id><journal-title-group><journal-title>International Journal of Population Data Science</journal-title><abbrev-journal-title>IJPDS</abbrev-journal-title></journal-title-group><issn pub-type="epub">2399-4908</issn><publisher><publisher-name>Swansea University</publisher-name></publisher></journal-meta><article-meta><article-id pub-id-type="doi">10.23889/ijpds.v6i1.1650</article-id><article-id pub-id-type="publisher-id">6:1:1650</article-id><article-id pub-id-type="pii">S2399490821016505</article-id><article-categories><subj-group subj-group-type="heading"><subject>Population Data Science</subject></subj-group></article-categories><title-group><article-title>Machine learning for identification of frailty in Canadian primary care practices</article-title></title-group><contrib-group><contrib contrib-type="author"><name><surname>Aponte-Hao</surname><given-names initials="S">Sylvia</given-names></name><xref ref-type="aff" rid="affil-1">1</xref><xref ref-type="corresp" rid="correspondingAurthor">*</xref></contrib><contrib contrib-type="author"><name><surname>Wong</surname><given-names initials="ST">Sabrina T.</given-names></name><xref ref-type="aff" rid="affil-2">2</xref><xref ref-type="aff" rid="affil-3">3</xref></contrib><contrib contrib-type="author"><name><surname>Thandi</surname><given-names initials="M">Manpreet</given-names></name><xref ref-type="aff" rid="affil-2">2</xref><xref ref-type="aff" rid="affil-3">3</xref></contrib><contrib contrib-type="author"><name><surname>Ronksley</surname><given-names initials="P">Paul</given-names></name><xref ref-type="aff" rid="affil-1">1</xref></contrib><contrib contrib-type="author"><name><surname>McBrien</surname><given-names initials="K">Kerry</given-names></name><xref ref-type="aff" rid="affil-1">1</xref></contrib><contrib contrib-type="author"><name><surname>Lee</surname><given-names initials="J">Joon</given-names></name><xref ref-type="aff" rid="affil-1">1</xref></contrib><contrib contrib-type="author"><name><surname>Grandy</surname><given-names initials="M">Mathew</given-names></name><xref ref-type="aff" rid="affil-4">4</xref></contrib><contrib contrib-type="author"><name><surname>Mangin</surname><given-names initials="D">Dee</given-names></name><xref ref-type="aff" rid="affil-5">5</xref></contrib><contrib contrib-type="author"><name><surname>Katz</surname><given-names initials="A">Alan</given-names></name><xref ref-type="aff" rid="affil-6">6</xref><xref ref-type="aff" rid="affil-7">7</xref></contrib><contrib contrib-type="author"><name><surname>Singer</surname><given-names initials="A">Alexander</given-names></name><xref ref-type="aff" rid="affil-8">8</xref></contrib><contrib contrib-type="author"><name><surname>Manca</surname><given-names initials="D">Donna</given-names></name><xref ref-type="aff" rid="affil-9">9</xref></contrib><contrib contrib-type="author"><name><surname>Williamson</surname><given-names initials="T">Tyler</given-names></name><xref ref-type="aff" rid="affil-10">10</xref></contrib><aff id="affil-1"><label>1</label><institution>Cumming School of Medicine, University of Calgary</institution></aff><aff id="affil-2"><label>2</label><institution>Centre for Health Services and Policy Research, University of British Columbia</institution></aff><aff id="affil-3"><label>3</label><institution>School of Nursing, University of British Columbia</institution></aff><aff id="affil-4"><label>4</label><institution>Department of Family Medicine, Dalhousie University</institution></aff><aff id="affil-5"><label>5</label><institution>Department of Family Medicine, McMaster University</institution></aff><aff id="affil-6"><label>6</label><institution>Manitoba Centre for Health Policy, University of Manitoba</institution></aff><aff id="affil-7"><label>7</label><institution>College of Medicine Faculty of Health Sciences, University of Manitoba</institution></aff><aff id="affil-8"><label>8</label><institution>Department of Family Medicine, University of Manitoba</institution></aff><aff id="affil-9"><label>9</label><institution>Department of Family Medicine, University of Alberta</institution></aff><aff id="affil-10"><label>10</label><institution>Cumming School of Medicine, University of Calgary</institution></aff></contrib-group><author-notes><corresp id="correspondingAurthor"><label>*</label>Corresponding author: Sylvia Aponte-Hao <email>zhi.hao@ucalgary.ca</email></corresp><fn fn-type="conflict"><label>Conflict of interest</label><p>The authors declare no conflicts of interest.</p></fn></author-notes><pub-date date-type="pub" publication-format="electronic"><day></day><month></month><year></year></pub-date><pub-date date-type="collection" publication-format="electronic"><year></year></pub-date><volume>6</volume><issue>1</issue><elocation-id>1650</elocation-id><permissions><license license-type="open-access" xlink:href="https://creativecommons.org/licenses/by-nc-nd/4.0/"><license-p>This work is licensed under a Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International License.</license-p></license></permissions><self-uri xlink:href="https://ijpds.org/article/view/1650">This article is available from the IJPDS website at: https://ijpds.org/article/view/1650</self-uri><abstract><title>Abstract</title><sec><title>Introduction</title><p>Frailty is a medical syndrome, commonly affecting people aged 65 years and over and is characterized by a greater risk of adverse outcomes following illness or injury. Electronic medical records contain a large amount of longitudinal data that can be used for primary care research. Machine learning can fully utilize this wide breadth of data for the detection of diseases and syndromes. The creation of a frailty case definition using machine learning may facilitate early intervention, inform advanced screening tests, and allow for surveillance.</p></sec><sec><title>Objectives</title><p>The objective of this study was to develop a validated case definition of frailty for the primary care context, using machine learning.</p></sec><sec><title>Methods</title><p>Physicians participating in the Canadian Primary Care Sentinel Surveillance Network across Canada were asked to retrospectively identify the level of frailty present in a sample of their own patients (total n <italic>=</italic> 5,466), collected from 2015&#x2013;2019. Frailty levels were dichotomized using a cut-off of 5. Extracted features included previously prescribed medications, billing codes, and other routinely collected primary care data. We used eight supervised machine learning algorithms, with performance assessed using a hold-out test set. A balanced training dataset was also created by oversampling. Sensitivity analyses considered two alternative dichotomization cut-offs. Model performance was evaluated using area under the receiver-operating characteristic curve, F1, accuracy, sensitivity, specificity, negative predictive value and positive predictive value.</p></sec><sec><title>Results</title><p>The prevalence of frailty within our sample was 18.4%. Of the eight models developed to identify frail patients, an XGBoost model achieved the highest sensitivity (78.14%) and specificity (74.41%). The balanced training dataset did not improve classification performance. Sensitivity analyses did not show improved performance for cut-offs other than 5.</p></sec><sec><title>Conclusion</title><p>Supervised machine learning was able to create well performing classification models for frailty. Future research is needed to assess frailty inter-rater reliability, and link multiple data sources for frailty identification.</p></sec></abstract><kwd-group><kwd>electronic medical records</kwd><kwd>electronic health records</kwd><kwd>machine learning</kwd><kwd>supervised machine learning</kwd><kwd>case definition</kwd><kwd>frailty</kwd><kwd>primary care</kwd><kwd>Canada</kwd></kwd-group><funding-group><funding-statement>This research study was funded by The Canadian Frailty Network. Preceding research resulting in Alberta data used for this current research study was funded by The Canadian Institutes for Health Research (SQS-145182), Michael Smith Foundation for Health Research (#16734) and the Canadian Frailty Network.</funding-statement></funding-group></article-meta></front><body><sec><title>Introduction</title><p>Frailty is a medical syndrome, commonly affecting people aged 65 years and older, characterized by a greater risk of adverse outcomes following illness or injury, despite accounting for age, other diseases, and medical treatment [<xref ref-type="bibr" rid="ref-1">1</xref>]. Frailty is associated with higher health care costs [<xref ref-type="bibr" rid="ref-2">2</xref>], greater risk of adverse events during [<xref ref-type="bibr" rid="ref-3">3</xref>] and post-surgery [<xref ref-type="bibr" rid="ref-4">4</xref>], markedly worse quality of life [<xref ref-type="bibr" rid="ref-5">5</xref>] and increased burden for family caregivers of frail patients [<xref ref-type="bibr" rid="ref-6">6</xref>]. As of 2018, there were an estimated 1.5 million Canadians living with frailty [<xref ref-type="bibr" rid="ref-7">7</xref>], and by 2025 this number is projected to increase to over 2 million. However, studies have demonstrated that frailty can be delayed or improved through a variety of interventions, such as nutrient supplementation and increased exercise [<xref ref-type="bibr" rid="ref-8">8</xref>]. Primary care is often the first point of care for patients and thus accurate identification of frailty in this setting may enable improved management of identified individuals such as ensuring early initiation of interventions [<xref ref-type="bibr" rid="ref-9">9</xref>] and informing advanced frailty screening tests [<xref ref-type="bibr" rid="ref-10">10</xref>], which could lead to reduced downstream costs through reduced hospitalizations [<xref ref-type="bibr" rid="ref-9">9</xref>]. There is currently no standard definition or instrument to measure frailty, and frailty prevalence estimates have found to vary greatly depending on the frailty instrument used [<xref ref-type="bibr" rid="ref-11">11</xref>].</p><p>Electronic medical records (EMRs) are a rich clinical data source for primary care research. Disease case definitions are routinely created and validated for the identification of patient cohorts. Machine learning has successfully been used in the creation of case definitions for other diseases such as hypertension and osteoarthritis in primary care that are being used for practice reporting, quality improvement, public health surveillance, and research [<xref ref-type="bibr" rid="ref-12">12</xref>]. Previous work using supervised machine learning for the identification of frailty in EMR data by Williamson et al. used data from Alberta, Canada [<xref ref-type="bibr" rid="ref-13">13</xref>]. This study defined frailty using the Clinical Frailty Scale [<xref ref-type="bibr" rid="ref-14">14</xref>] showed fair performance, achieving a sensitivity of 0.28 and a specificity of 0.94. Other research has been done on the classification of frailty using machine learning methods, but frailty was defined using other instruments. Hassler et al. identified frailty using the Frailty Phenotype, while also using supervised machine learning methods but not using EMR data [<xref ref-type="bibr" rid="ref-15">15</xref>]. This research obtained sensitivity estimates ranging between 65.7% to 86.7%, and specificity ranging between 58.1% to 85.6% [<xref ref-type="bibr" rid="ref-16">16</xref>]. Ambagtsheer et al. used the electronic Frailty Index [<xref ref-type="bibr" rid="ref-17">17</xref>] for the identification of frailty, while also using supervised machine learning methods on EMR data [<xref ref-type="bibr" rid="ref-18">18</xref>]. The best performing model was able to achieve a sensitivity of 97.8% and a specificity of 89.1%.</p><p>The objective of this study was to develop a validated case definition of frailty for the primary care context using machine learning. The creation of a frailty case definition using supervised machine learning for wide distribution and deployment in Canadian primary care practices may allow for surveillance of frailty, future research on frail cohorts, as well as contribute to better management and care for frail patients.</p></sec><sec><title>Methods</title><p>The Canadian Primary Care Sentinel Surveillance Network (CPCSSN) is a pan-Canadian primary care database that routinely collects and stores de-identified patient EMR data from eight provinces and one territory across Canada, with approximately 1.8 million unique patients in its database, and over a thousand primary care providers [<xref ref-type="bibr" rid="ref-19">19</xref>]. Data consistently captured within CPCSSN include diagnoses, billing codes, and prescribed medications.</p><sec><title>Reference set creation</title><p>Five CPCSSN networks participated in data collection and building the reference set of frail patients: British Columbia, Alberta, Nova Scotia, Ontario, and Manitoba. Primary care physicians used the Rockwood Clinical Frailty Scale (CFS) to retrospectively classify the degree of frailty observed in their patients aged 65 and above who were seen within the last 24 months. The CFS is a validated frailty measurement tool commonly used in primary care and is based on short written descriptions of increasing levels of frailty [<xref ref-type="bibr" rid="ref-14">14</xref>] (<xref ref-type="supplementary-material" rid="sup-a">Appendix I</xref>). The CFS ranges from 1 to 9, with 1 having the label of &#x2018;very fit&#x2019; and 9 labelled &#x2018;terminally ill&#x2019; (the highest degree of frailty).</p><p>Physicians were given the option of basing their assessments on recall or querying information in their EMRs in order to provide an accurate frailty rating. Data were gathered in two stages, with the initial data collection being restricted to Alberta only. Data from Alberta were gathered in 2015 for a previous study that focused on frailty identification [<xref ref-type="bibr" rid="ref-13">13</xref>], while the other provincial sites gathered data in 2019. A total of 5,466 patients were rated by 90 physicians in total across the five regional CPCSSN sites located across five Canadian provinces, with each patient receiving one CFS rating by their physician only.</p></sec><sec><title>Feature engineering</title><p>We extracted patient EMR data from participating CPCSSN sentinels with the accompanying CFS score and included features (measured data elements representative of a patient characteristic) that were present in all EMRs to form a unified dataset. Patient visit diagnoses, prescribed medications, lab results and biometrics (height, weight and body mass index) were extracted from the past two years prior to the CFS score assignment. For the purposes of this study, frailty was dichotomized into frail or not frail from the original physician-rated CFS score, with those receiving a score of 5 or higher on the CFS being labelled as frail, and those with a score of 4 or lower being labelled as not frail.</p><p>The following chronic conditions, detected using validated case-detection algorithms available in CPCSSN [<xref ref-type="bibr" rid="ref-20">20</xref>], were extracted: chronic obstructive pulmonary disease, dementia, depression, epilepsy, hypertension, and osteoarthritis. Patient demographics such as age and sex were also extracted.</p><p>We performed feature selection by removing features with very low variability, as defined by the ratio of the most common value to the second most common value being more than a ratio of 95:5. As missing data are often observed in EMR data, any feature with greater than 20% missing data was also removed (with the exception of height, weight, and BMI information as these were considered to be potentially important), and for those with less than 20% missing data (systolic and diastolic blood pressures), single imputation using predictive mean matching [<xref ref-type="bibr" rid="ref-21">21</xref>] was performed. In addition to single imputation, missingness-indicator variables were also created, in the event that these missing values were potentially related to frailty status. The regional CPCSSN network the data were collected from was also included as a feature, as there may be regional data extraction and processing differences. However, the inclusion of this feature limits the generalizability of the models to only the regional CPCSSN networks included in this study.</p><p>After the removal of features with low variance or high correlation, no additional feature selection was performed as this had reduced the total number of features from 5,466 to 75. The final set of features used is presented in <xref ref-type="table" rid="table-1">Table 1</xref>.</p><table-wrap id="table-1"><label>Table 1: Features used for machine learning</label><table frame="hsides" rules="groups"><thead><tr><th valign="middle" align="left" style="border-top: solid 1pt; border-bottom: solid 1pt"><bold>Features</bold></th><th valign="middle" align="center" style="border-top: solid 1pt; border-bottom: solid 1pt"><bold>n</bold></th><th valign="middle" align="center" style="border-top: solid 1pt; border-bottom: solid 1pt"><bold>Data type</bold></th></tr></thead><tbody><tr><td valign="middle" align="left">Patient age</td><td valign="middle" align="center">1</td><td valign="middle" align="center">Numeric</td></tr><tr><td valign="middle" align="left">Patient sex</td><td valign="middle" align="center">1</td><td valign="middle" align="center">Binary</td></tr><tr><td valign="middle" align="left">Patient Diagnoses Received in Last 2 Years (ICD-9 Codes)</td><td valign="middle" align="center">13</td><td valign="middle" align="center">Numeric</td></tr><tr><td valign="middle" align="left">CPCSSN&#x2019;s Detection of 6 Chronic Conditions</td><td valign="middle" align="center">6</td><td valign="middle" align="center">Binary</td></tr><tr><td valign="middle" align="left">Medications Prescribed in Last 2 Years</td><td valign="middle" align="center">39</td><td valign="middle" align="center">Numeric</td></tr><tr><td valign="middle" align="left">Patient Biometrics</td><td valign="middle" align="center">7</td><td valign="middle" align="center">Numeric</td></tr><tr><td valign="middle" align="left">Province</td><td valign="middle" align="center">1</td><td valign="middle" align="center">Categorical</td></tr><tr><td valign="middle" align="left">Missing Medication Indicator</td><td valign="middle" align="center">1</td><td valign="middle" align="center">Binary</td></tr><tr><td valign="middle" align="left">Missing Height, Weight and BMI Indicators</td><td valign="middle" align="center">3</td><td valign="middle" align="center">Binary</td></tr><tr><td valign="middle" align="left">Missing Chronic Conditions Indicator</td><td valign="middle" align="center">1</td><td valign="middle" align="center">Binary</td></tr><tr><td valign="middle" align="left">Missing Patient Diagnoses Indicator</td><td valign="middle" align="center">1</td><td valign="middle" align="center">Binary</td></tr><tr><td valign="middle" align="left">Missing Blood Pressure Indicator</td><td valign="middle" align="center">1</td><td valign="middle" align="center">Binary</td></tr><tr><td valign="middle" align="left"><bold>Total</bold></td><td valign="middle" align="center"><bold>75</bold></td><td valign="middle" align="left"></td></tr></tbody></table></table-wrap></sec><sec><title>Supervised machine learning</title><p>Patients were partitioned into a 30-70 split, with 70% (n <italic>=</italic> 3,827) of patients used for training, and 30% (n <italic>=</italic> 1,639) as the hold-out test set. Within the training set, there were 3,103 non-frail patients and 724 frail patients. The hold-out test set had 1,360 non-frail patients and 279 frail patients.</p><p>Numeric features in both the training and test sets were scaled and centered according to the training set to ensure no data leakage from the validation set. Within the 70% training set, the data were split into five random folds for cross validation to guard against overfitting.</p><p>Imbalanced data can result in biased estimates of training performance, especially when the class of interest is the minority class. A model predicting everyone as non-frail will still result in a 81.1% accuracy rate, but is actually of no value when none of the frail patients have been identified. One method of combating imbalanced datasets is to oversample the minority class such that the training data becomes balanced. As the original training data were imbalanced (18.9% frail), synthetic minority over-sampling technique (SMOTE) [<xref ref-type="bibr" rid="ref-22">22</xref>] was also performed to create synthetic samples of frail patients, such that there were an equal number of frail (n <italic>=</italic> 3,103) and non-frail (n <italic>=</italic> 3,103) patients. The specific implementation of SMOTE used was SMOTE-Nominal Continuous (SMOTE-NC), as there are both categorical and numerical data as features (for the sake of simplicity, future references of SMOTE-NC will be simplified to just SMOTE). SMOTE was used only to create more synthetic frail observations, and no undersampling of non-frail patients was performed.</p><p>A random search of 60 combinations was used for hyperparameter tuning within five fold cross validation, with the best performing model chosen by average sensitivity across the five folds for the balanced training dataset created by SMOTE, and average area under the receiver-operating characteristic curve (AUC) for the imbalanced datasets.</p><p>A selection of seven commonly used binary supervised machine learning architectures were used, including: classification and regression tree (CaRT); elastic net logistic regression [<xref ref-type="bibr" rid="ref-23">23</xref>]; support vector machines (SVM); Na&#x00EF;ve Bayes; feedforward artificial neural network (NN) with five hidden layers; k-nearest neighbours (KNN); random forest; eXtreme Gradient Boosting (XGBoost).</p><p>The best performing algorithm resulting from each architecture was evaluated using AUC, accuracy, sensitivity, specificity, F1 score, negative predictive value (NPV), and positive predictive value (PPV). AUC can be understood as the probability that a randomly chosen non-frail patient will have a score lower than a randomly chosen frail patient. AUC is constructed by plotting the achieved sensitivity and specificity of the classifier at every possible decision threshold level, and measuring the area under the curve. AUC ranges from 0 to 1, with 0.5 being no better than random guessing, and 1 being a perfect classifier. Receiver-operating characteristic (ROC) curves were also constructed and assessed. Although the default decision threshold for binary classification is 0.5, this threshold can also be moved along the ROC curve to account for imbalances in the training data [<xref ref-type="bibr" rid="ref-24">24</xref>], or to maximize both sensitivity and specificity (defined as the point on each curve closest to the upper left corner).</p><p>This study followed the RECORD (Reporting of studies Conducted using Observational Routinely-collected health Data) statement [<xref ref-type="bibr" rid="ref-25">25</xref>], with the associated checklist available in the <xref ref-type="supplementary-material" rid="sup-a">Appendix II</xref>.</p></sec><sec><title>Sensitivity analyses</title><p>As the original CFS is a 9 point ordinal scale, the assigned CFS scores were dichotomized to reduce the task to a binary classification problem. A scoping review on the usage of CFS in research identified that the majority of studies used a cut-off of 5 and above to define frailty, while fewer studies used a cut-off of 4 and above, and 2 studies used a cut-off of 6 and above [<xref ref-type="bibr" rid="ref-26">26</xref>]. A CFS score of 5 labelled &#x201C;mildly frail&#x201D; is also the first time the term &#x201C;frail&#x201D; appears in the corresponding label for each frailty score. We will also use cut-off scores of 4 and 6 for sensitivity analyses. By using a cut-off of 4, patients who were identified as &#x2018;vulnerable&#x2019; in the CFS are now considered to be frail, whom were previously labelled to be non-frail. This increased the number of frail patients from the original training set from 724 to 1362, changing the proportion of frail patients from 18.9% to 35.6%. A cut-off of 6 would consider patients were identified as &#x2018;mildly frail&#x2019; to be non-frail, whom were previously labelled frail. This increases the imbalance in the training dataset, as the number of frail patients were reduced from 724 to 358, changing the proportion of frail patients from 18.9% to 9.3%.</p><p>All analyses were performed in R version 4.0.4, where the packages &#x2018;caret&#x2019; and &#x2018;h2o&#x2019; were used for model building [<xref ref-type="bibr" rid="ref-27">27</xref>, <xref ref-type="bibr" rid="ref-28">28</xref>]. SMOTE was implemented using Python 3 through R using the package &#x2018;reticulate&#x2019; [<xref ref-type="bibr" rid="ref-29">29</xref>].</p></sec></sec><sec><title>Results</title><p>Of the 5,466 patients sampled, the median age was 74 years (IQR: 11), with 50% of the sample falling between 69 and 80 years of age. The sample had more females than males, with 44% (n <italic>=</italic> 2,425) of the sample being males. There was 13.4% (n <italic>=</italic> 732) of the sample that had no known chronic conditions as detected by CPCSSN&#x2019;s validated chronic condition case detection algorithms; of those with known chronic conditions, the most common chronic condition was hypertension (76.35%). The estimated prevalence of frailty among seniors aged 65 and older in this sample of CPCSSN patients was 18.4%.</p><p>Compared with non-frail patients (n <italic>=</italic> 4,460), frail patients (n <italic>=</italic> 1,006) were statistically significantly likely to be older, female, and less likely to have no known chronic conditions as identified by the seven validated CPCSSN case detection algorithms. Of those with at least one chronic condition, frail patients were more likely to have chronic obstructive pulmonary disease (COPD), dementia, depression, and hypertension. Frail patients were also statistically more likely to have a higher number of clinic visits in the most recent calendar year of when their frailty score was given, with a median of seven visits. The proportion of missingness was also unevenly distributed across frailty, with frail patients statistically significantly less likely to have missing BMI, height, weight, clinic visitations and medications.</p><p><xref ref-type="fig" rid="fig-1">Figure 1</xref> compares the ROC curves for the models trained using the original imbalanced dataset, and a cut-off of 5 and above as frail.</p><fig id="fig-1"><label>Figure 1: Comparison of ROC curves for final models trained on original dataset</label><graphic xlink:href="ijpds-06-1650-g001.tif"/></fig><p><xref ref-type="table" rid="table-3a">Table 3a</xref> shows the performance of the 8 supervised machine learning models using the default threshold of 0.5. All models were able to achieve an AUC of over 65%, ranging from 66.48% (KNN) to 83.18% (XGBoost). Sensitivity ranged from 13.62% (KNN) to 67.38% (Na&#x00EF;ve Bayes). Specificity ranged from 70.81% (Na&#x00EF;ve Bayes) to 97.72% (KNN). PPV ranged from 31.14% (Na&#x00EF;ve Bayes) to 64.76% (neural network). NPV ranged from 84.65% (KNN) to 91.37% (Na&#x00EF;ve Bayes).</p><table-wrap id="table-2"><label>Table 2: Cohort demographics</label><table frame="hsides" rules="groups"><thead><tr><th valign="middle" align="left" style="border-top: solid 1pt; border-bottom: solid 1pt"></th><th valign="middle" align="center" style="border-top: solid 1pt; border-bottom: solid 1pt"><bold>All (n <italic>=</italic> 5,466)</bold></th><th valign="middle" align="center" style="border-top: solid 1pt; border-bottom: solid 1pt"><bold>Frail (n <italic>=</italic> 1,006)</bold></th><th valign="middle" align="center" style="border-top: solid 1pt; border-bottom: solid 1pt"><bold>Not frail (n <italic>=</italic> 4,460)</bold></th><th valign="middle" align="center" style="border-top: solid 1pt; border-bottom: solid 1pt"><bold>p-value</bold></th></tr></thead><tbody><tr><td valign="middle" align="left">Age (Median, [Q1-Q3])</td><td valign="middle" align="center">74 [69&#x2013;80]</td><td valign="middle" align="center">81 [74&#x2013;88]</td><td valign="middle" align="center">72 [68&#x2013;78]</td><td valign="middle" align="center"><italic>&#x003C;</italic>0.001<sup>&#x2020;</sup></td></tr><tr><td valign="middle" align="left">Sex (% Male)</td><td valign="middle" align="center">2,425 (44.4%)</td><td valign="middle" align="center">348 (34.6%)</td><td valign="middle" align="center">2,077(46.6%)</td><td valign="middle" align="center"><italic>&#x003C;</italic>0.001</td></tr><tr><td valign="middle" align="left">No Known Chronic Conditions</td><td valign="middle" align="center">732 (13.4%)</td><td valign="middle" align="center">52 (5.2%)</td><td valign="middle" align="center">680 (15.2%)</td><td valign="middle" align="center"><italic>&#x003C;</italic>0.001</td></tr><tr><td valign="middle" align="left">COPD*</td><td valign="middle" align="center">534 (11.3%)</td><td valign="middle" align="center">382 (10.1%)</td><td valign="middle" align="center">152 (15.9%)</td><td valign="middle" align="center"><italic>&#x003C;</italic>0.001</td></tr><tr><td valign="middle" align="left">Dementia*</td><td valign="middle" align="center">449 (9.5%)</td><td valign="middle" align="center">238 (24.9%)</td><td valign="middle" align="center">211 (5.6%)</td><td valign="middle" align="center"><italic>&#x003C;</italic>0.001</td></tr><tr><td valign="middle" align="left">Depression*1,155 (24.4%)</td><td valign="middle" align="center">316 (33.1%)</td><td valign="middle" align="center">839 (22.2%)</td><td valign="middle" align="center"><italic>&#x003C;</italic>0.001</td><td valign="middle" align="left"></td></tr><tr><td valign="middle" align="left">Diabetes Mellitus*</td><td valign="middle" align="center">1,866 (39.4%)</td><td valign="middle" align="center">374 (39.2%)</td><td valign="middle" align="center">1,492 (39.5%)</td><td valign="middle" align="center">0.909</td></tr><tr><td valign="middle" align="left">Epilepsy*</td><td valign="middle" align="center">94 (2.0%)</td><td valign="middle" align="center">24 (2.5%)</td><td valign="middle" align="center">70 (1.9%)</td><td valign="middle" align="center">0.237</td></tr><tr><td valign="middle" align="left">Hypertension*</td><td valign="middle" align="center">3,614 (76.35)</td><td valign="middle" align="center">760 (79.7%)</td><td valign="middle" align="center">2,854(75.5%)</td><td valign="middle" align="center">0.008</td></tr><tr><td valign="middle" align="left">Osteoarthritis*</td><td valign="middle" align="center">2,187 (46.2%)</td><td valign="middle" align="center">439 (46.2%)</td><td valign="middle" align="center">1,748 (46.2%)</td><td valign="middle" align="center">0.929</td></tr><tr><td valign="middle" align="left">Mean BMI (Median [Q1&#x2013;Q3])</td><td valign="middle" align="center">28.5 [25.31&#x2013;32.49]</td><td valign="middle" align="center">28.34 [24.52&#x2013;33.17]</td><td valign="middle" align="center">28.50 [25.40&#x2013;32.40]</td><td valign="middle" align="center">0.501<sup>&#x2020;</sup></td></tr><tr><td valign="middle" align="left">Missing BMI</td><td valign="middle" align="center">1,735 (45.3%)</td><td valign="middle" align="center">436 (60.2%)</td><td valign="middle" align="center">1,299 (41.9%)</td><td valign="middle" align="center"><italic>&#x003C;</italic>0.001</td></tr><tr><td valign="middle" align="left">Mean Height (centimetres) (Median [Q1&#x2013;Q3])</td><td valign="middle" align="center">165.00 [157.47&#x2013;173.15]</td><td valign="middle" align="center">160.00 [152.81&#x2013;168.50]</td><td valign="middle" align="center">165.80 [158.15&#x2013;174.00]</td><td valign="middle" align="center"><italic>&#x003C;</italic>0.001<sup>&#x2020;</sup></td></tr><tr><td valign="middle" align="left">Missing Height (centimetres)</td><td valign="middle" align="center">1761 (46.0%)</td><td valign="middle" align="center">443 (61.2%)</td><td valign="middle" align="center">1318 (42.5%)</td><td valign="middle" align="center"><italic>&#x003C;</italic>0.001</td></tr><tr><td valign="middle" align="left">Mean Weight (kg) (Median [Q1&#x2013;Q3])</td><td valign="middle" align="center">79.60 [67.39&#x2013;92.60]</td><td valign="middle" align="center">75.19 [64.21&#x2013;90.00]</td><td valign="middle" align="center">80.32 [68.40&#x2013;93.00]</td><td valign="middle" align="center"><italic>&#x003C;</italic>0.001<sup>&#x2020;</sup></td></tr><tr><td valign="middle" align="left">Missing Weight (kg)</td><td valign="middle" align="center">1,317 (34.4%)</td><td valign="middle" align="center">302 (42.7%)</td><td valign="middle" align="center">1,015 (32.7%)</td><td valign="middle" align="center"><italic>&#x003C;</italic>0.001</td></tr><tr><td valign="middle" align="left">Missing Systolic Blood Pressure Measurement</td><td valign="middle" align="center">611 (16.0%)</td><td valign="middle" align="center">111 (15.3%)</td><td valign="middle" align="center">500 (16.1%)</td><td valign="middle" align="center">0.645</td></tr><tr><td valign="middle" align="left">Mean Systolic Blood Pressure (Median [Q1&#x2013;Q3])</td><td valign="middle" align="center">132.62 [124.50&#x2013;141.28]</td><td valign="middle" align="center">133.00 [125.33&#x2013;141.67]</td><td valign="middle" align="center">133.61 [123.95&#x2013;142.00]</td><td valign="middle" align="center">0.546<sup>&#x2020;</sup></td></tr><tr><td valign="middle" align="left">Number of Clinic Visits In Most Recent Calendar Year (Median [Q1&#x2013;Q3])</td><td valign="middle" align="center">5 [3&#x2013;9]</td><td valign="middle" align="center">7 [4&#x2013;11]</td><td valign="middle" align="center">5 [3&#x2013;9]</td><td valign="middle" align="center"><italic>&#x003C;</italic>0.001<sup>&#x2020;</sup></td></tr><tr><td valign="middle" align="left">Missing Clinic Visits</td><td valign="middle" align="center">296 (17.1%)</td><td valign="middle" align="center">35 (4.8%)</td><td valign="middle" align="center">261 (8.4%)</td><td valign="middle" align="center">0.002</td></tr><tr><td valign="middle" align="left">Number of Unique Medications Prescribed In Last 2 Years (Median [Q1&#x2013;Q3])</td><td valign="middle" align="center">6 [3&#x2013;10]</td><td valign="middle" align="center">5 [3&#x2013;9]</td><td valign="middle" align="center">7 [4&#x2013;11]</td><td valign="middle" align="center"><italic>&#x003C;</italic>0.001<sup>&#x2020;</sup></td></tr><tr><td valign="middle" align="left">Missing Medications</td><td valign="middle" align="center">249 (6.5%)</td><td valign="middle" align="center">27 (3.7%)</td><td valign="middle" align="center">222 (7.2%)</td><td valign="middle" align="center">0.001</td></tr></tbody></table><table-wrap-foot><p>*Proportions of those who has at least one known chronic condition.</p><p><sup>&#x2020;</sup>Tested using the Krusal-Wallis test.</p></table-wrap-foot></table-wrap><table-wrap id="table-3a"><label>Table 3a: Performance metrics of models trained on original data using hold-out test set</label><table frame="hsides" rules="groups"><thead><tr><th valign="middle" align="left" style="border-top: solid 1pt; border-bottom: solid 1pt"><bold>Model</bold></th><th valign="middle" align="center" style="border-top: solid 1pt; border-bottom: solid 1pt"><bold>AUC</bold></th><th valign="middle" align="center" style="border-top: solid 1pt; border-bottom: solid 1pt"><bold>Accuracy</bold></th><th valign="middle" align="center" style="border-top: solid 1pt; border-bottom: solid 1pt"><bold>F1</bold></th><th valign="middle" align="center" style="border-top: solid 1pt; border-bottom: solid 1pt"><bold>Sensitivity</bold></th><th valign="middle" align="center" style="border-top: solid 1pt; border-bottom: solid 1pt"><bold>Specificity</bold></th><th valign="middle" align="center" style="border-top: solid 1pt; border-bottom: solid 1pt"><bold>PPV</bold></th><th valign="middle" align="center" style="border-top: solid 1pt; border-bottom: solid 1pt"><bold>NPV</bold></th></tr></thead><tbody><tr><td valign="middle" align="left">Elastic Net Logistic Regression</td><td valign="middle" align="center">81.58%</td><td valign="middle" align="center">85.42%*</td><td valign="middle" align="center">46.05%</td><td valign="middle" align="center">36.56%</td><td valign="middle" align="center">95.44%</td><td valign="middle" align="center">62.20%</td><td valign="middle" align="center">88.00%</td></tr><tr><td valign="middle" align="left">SVM</td><td valign="middle" align="center">80.75%</td><td valign="middle" align="center">85.23%</td><td valign="middle" align="center">49.16%*</td><td valign="middle" align="center">41.94%</td><td valign="middle" align="center">94.12%</td><td valign="middle" align="center">59.39%</td><td valign="middle" align="center">88.77%</td></tr><tr><td valign="middle" align="left">KNN</td><td valign="middle" align="center">66.48%</td><td valign="middle" align="center">83.40%</td><td valign="middle" align="center">21.84%</td><td valign="middle" align="center">13.62%</td><td valign="middle" align="center">97.72%*</td><td valign="middle" align="center">55.07%</td><td valign="middle" align="center">84.65%</td></tr><tr><td valign="middle" align="left">Na&#x00EF;ve Bayes</td><td valign="middle" align="center">74.72%</td><td valign="middle" align="center">70.23%</td><td valign="middle" align="center">43.52%</td><td valign="middle" align="center">67.38%*</td><td valign="middle" align="center">70.81%</td><td valign="middle" align="center">32.14%</td><td valign="middle" align="center">91.37%*</td></tr><tr><td valign="middle" align="left">CaRT</td><td valign="middle" align="center">77.56%</td><td valign="middle" align="center">82.18%</td><td valign="middle" align="center">44.70%</td><td valign="middle" align="center">42.29%</td><td valign="middle" align="center">90.37%</td><td valign="middle" align="center">47.39%</td><td valign="middle" align="center">88.42%</td></tr><tr><td valign="middle" align="left">Random Forest</td><td valign="middle" align="center">81.03%</td><td valign="middle" align="center">85.11%</td><td valign="middle" align="center">47.64%</td><td valign="middle" align="center">39.79%</td><td valign="middle" align="center">94.41%</td><td valign="middle" align="center">59.36%</td><td valign="middle" align="center">88.43%</td></tr><tr><td valign="middle" align="left">XGBoost</td><td valign="middle" align="center">83.18%*</td><td valign="middle" align="center">84.87%</td><td valign="middle" align="center">47.68%</td><td valign="middle" align="center">40.50%</td><td valign="middle" align="center">93.97%</td><td valign="middle" align="center">57.95%</td><td valign="middle" align="center">88.50%</td></tr><tr><td valign="middle" align="left">Feedforward NN</td><td valign="middle" align="center">78.20%</td><td valign="middle" align="center">84.87%</td><td valign="middle" align="center">35.32%</td><td valign="middle" align="center">24.37%</td><td valign="middle" align="center">97.28%</td><td valign="middle" align="center">64.76%*</td><td valign="middle" align="center">86.25%</td></tr></tbody></table><table-wrap-foot><p>*Highest value achieved for each metric.</p></table-wrap-foot></table-wrap><p><xref ref-type="table" rid="table-3b">Table 3b</xref> shows the maximum combined sensitivity and specificity that can be achieved by using the most optimal thresholds determined using ROC curves. An XGBoost model achieved the best performance using a threshold of 0.1851, where sensitivity was 78.14% and 74.41%.</p><table-wrap id="table-3b"><label>Table 3b: Sensitivity and specificity of models trained on original data using best threshold</label><table frame="hsides" rules="groups"><thead><tr><th valign="middle" align="left" style="border-top: solid 1pt; border-bottom: solid 1pt"><bold>Model</bold></th><th valign="middle" align="center" style="border-top: solid 1pt; border-bottom: solid 1pt"><bold>Sensitivity</bold></th><th valign="middle" align="center" style="border-top: solid 1pt; border-bottom: solid 1pt"><bold>Specificity</bold></th><th valign="middle" align="center" style="border-top: solid 1pt; border-bottom: solid 1pt"><bold>Threshold</bold></th></tr></thead><tbody><tr><td valign="middle" align="left">Elastic Net Logistic Regression</td><td valign="middle" align="center">77.78%</td><td valign="middle" align="center">72.72%</td><td valign="middle" align="center">0.4730</td></tr><tr><td valign="middle" align="left">SVM</td><td valign="middle" align="center">74.55%</td><td valign="middle" align="center">73.38%</td><td valign="middle" align="center">0.1889</td></tr><tr><td valign="middle" align="left">KNN</td><td valign="middle" align="center">64.16%</td><td valign="middle" align="center">61.69%</td><td valign="middle" align="center">0.1000</td></tr><tr><td valign="middle" align="left">Na&#x00EF;ve Bayes</td><td valign="middle" align="center">70.97%</td><td valign="middle" align="center">68.60%</td><td valign="middle" align="center">0.2777</td></tr><tr><td valign="middle" align="left">CaRT</td><td valign="middle" align="center">69.89%</td><td valign="middle" align="center">72.79%</td><td valign="middle" align="center">0.1228</td></tr><tr><td valign="middle" align="left">Random Forest</td><td valign="middle" align="center">75.27%</td><td valign="middle" align="center">71.99%</td><td valign="middle" align="center">0.3104</td></tr><tr><td valign="middle" align="left">XGBoost</td><td valign="middle" align="center">78.14%*</td><td valign="middle" align="center">74.41%*</td><td valign="middle" align="center">0.1851</td></tr><tr><td valign="middle" align="left">Feedforward NN</td><td valign="middle" align="center">73.84%</td><td valign="middle" align="center">68.82%</td><td valign="middle" align="center">0.2712</td></tr></tbody></table><table-wrap-foot><p>*Highest value achieved for each metric.</p></table-wrap-foot></table-wrap><p><xref ref-type="fig" rid="fig-2">Figure 2</xref> compares the ROC curves for the models trained using the balanced dataset created using SMOTE, and a cut-off score of 5 and above as frail.</p><fig id="fig-2"><label>Figure 2: ROC Curves of models trained on balanced data</label><graphic xlink:href="ijpds-06-1650-g002.tif"/></fig><p><xref ref-type="table" rid="table-4a">Table 4a</xref> shows the performance of the eight supervised machine learning models trained using the balanced dataset created by SMOTE, and where the default threshold of 0.5 was used. AUC ranged from 65.37% (KNN) to 80.53% (XGBoost). Sensitivity ranged from 30.47% (KNN) to 67.38% (elastic net logistic regression). Specificity ranged from 72.06% (Na&#x00EF;ve Bayes) to 93.80% (Random Forest). PPV ranged from 31.53% (Na&#x00EF;ve Bayes) to 55.38% (Random Forest). NPV ranged from 85.96% (KNN) to 91.70% (elastic net logistic regression).</p><table-wrap id="table-4a"><label>Table 4a: Performance metrics of models trained on balanced data using default threshold</label><table frame="hsides" rules="groups"><thead><tr><th valign="middle" align="left"><bold>Model</bold></th><th valign="middle" align="center"><bold>AUC</bold></th><th valign="middle" align="center"><bold>Accuracy</bold></th><th valign="middle" align="center"><bold>F1</bold></th><th valign="middle" align="center"><bold>Sensitivity</bold></th><th valign="middle" align="center"><bold>Specificity</bold></th><th valign="middle" align="center"><bold>PPV</bold></th><th valign="middle" align="center"><bold>NPV</bold></th></tr></thead><tbody><tr><td valign="middle" align="left">Elastic Net Logistic Regression</td><td valign="middle" align="center">77.21%</td><td valign="middle" align="center">72.79%</td><td valign="middle" align="center">45.74%</td><td valign="middle" align="center">67.38%</td><td valign="middle" align="center">73.90%</td><td valign="middle" align="center">34.62%</td><td valign="middle" align="center">91.70%</td></tr><tr><td valign="middle" align="left">SVM</td><td valign="middle" align="center">77.26%</td><td valign="middle" align="center">73.89%</td><td valign="middle" align="center">46.10%</td><td valign="middle" align="center">65.59%*</td><td valign="middle" align="center">75.59%</td><td valign="middle" align="center">35.53%</td><td valign="middle" align="center">91.46%*</td></tr><tr><td valign="middle" align="left">KNN</td><td valign="middle" align="center">65.37%</td><td valign="middle" align="center">77.67%</td><td valign="middle" align="center">31.72%</td><td valign="middle" align="center">30.47%</td><td valign="middle" align="center">87.35%</td><td valign="middle" align="center">33.07%</td><td valign="middle" align="center">85.96%</td></tr><tr><td valign="middle" align="left">Na&#x00EF;ve Bayes</td><td valign="middle" align="center">71.70%</td><td valign="middle" align="center">70.47%</td><td valign="middle" align="center">52.36%*</td><td valign="middle" align="center">62.72%</td><td valign="middle" align="center">72.06%</td><td valign="middle" align="center">31.53%</td><td valign="middle" align="center">90.41%</td></tr><tr><td valign="middle" align="left">CaRT</td><td valign="middle" align="center">71.27%</td><td valign="middle" align="center">76.69%</td><td valign="middle" align="center">46.20%</td><td valign="middle" align="center">58.78%</td><td valign="middle" align="center">80.37%</td><td valign="middle" align="center">38.05%</td><td valign="middle" align="center">90.48%</td></tr><tr><td valign="middle" align="left">Random Forest</td><td valign="middle" align="center">80.90%*</td><td valign="middle" align="center">84.20%*</td><td valign="middle" align="center">44.30%</td><td valign="middle" align="center">36.92%</td><td valign="middle" align="center">93.80%*</td><td valign="middle" align="center">55.38%*</td><td valign="middle" align="center">87.89%</td></tr><tr><td valign="middle" align="left">XGBoost</td><td valign="middle" align="center">80.53%</td><td valign="middle" align="center">83.83%</td><td valign="middle" align="center">44.44%</td><td valign="middle" align="center">37.99%</td><td valign="middle" align="center">93.24%</td><td valign="middle" align="center">53.54%</td><td valign="middle" align="center">87.99%</td></tr><tr><td valign="middle" align="left">Feedforward NN</td><td valign="middle" align="center">77.76%</td><td valign="middle" align="center">83.28%</td><td valign="middle" align="center">38.01%</td><td valign="middle" align="center">30.11%</td><td valign="middle" align="center">94.19%</td><td valign="middle" align="center">51.53%</td><td valign="middle" align="center">86.79%</td></tr></tbody></table></table-wrap><p><xref ref-type="table" rid="table-4b">Table 4b</xref> shows the maximum combined sensitivity and specificity that can be achieved by using the most optimal thresholds determined using ROC curves. XGBoost achieved the best performance using a threshold of 0.2185, where sensitivity was 77.42% and specificity was 71.84%.</p><table-wrap id="table-4b"><label>Table 4b: Sensitivity and specificity of models trained on balanced data using best threshold</label><table frame="hsides" rules="groups"><thead><tr><th valign="middle" align="left"><bold>Model</bold></th><th valign="middle" align="center"><bold>Sensitivity</bold></th><th valign="middle" align="center"><bold>Specificity</bold></th><th valign="middle" align="center"><bold>Threshold</bold></th></tr></thead><tbody><tr><td valign="middle" align="left">Elastic Net Logistic Regression</td><td valign="middle" align="center">74.19%</td><td valign="middle" align="center">67.79%</td><td valign="middle" align="center">0.4019</td></tr><tr><td valign="middle" align="left">SVM</td><td valign="middle" align="center">70.97%</td><td valign="middle" align="center">71.25%</td><td valign="middle" align="center">0.4429</td></tr><tr><td valign="middle" align="left">KNN</td><td valign="middle" align="center">65.95%</td><td valign="middle" align="center">61.18%</td><td valign="middle" align="center">0.0833</td></tr><tr><td valign="middle" align="left">Na&#x00EF;ve Bayes</td><td valign="middle" align="center">62.01%</td><td valign="middle" align="center">73.75%</td><td valign="middle" align="center">0.6216</td></tr><tr><td valign="middle" align="left">CaRT</td><td valign="middle" align="center">58.78%</td><td valign="middle" align="center">80.37%</td><td valign="middle" align="center">0.5121</td></tr><tr><td valign="middle" align="left">Random Forest</td><td valign="middle" align="center">72.76%</td><td valign="middle" align="center">76.10%</td><td valign="middle" align="center">0.3525</td></tr><tr><td valign="middle" align="left">XGBoost</td><td valign="middle" align="center">77.42%*</td><td valign="middle" align="center">71.84%*</td><td valign="middle" align="center">0.2185</td></tr><tr><td valign="middle" align="left">Feedforward NN</td><td valign="middle" align="center">66.67%</td><td valign="middle" align="center">77.72%</td><td valign="middle" align="center">0.6636</td></tr></tbody></table></table-wrap><p>Using a cut-off CFS score of 4 and above as frail, an XGBoost model achieved the best performance of sensitivity (77.42%) using a threshold of 0.3385. A CaRT model achieved the best specificity (76.02%) using a threshold of 0.2540. Using a cut-off CFS score of 6 and above, a CaRT model achieved the highest sensitivity (78.85%) using a threshold of 0.0568. An XGBoost model achieved the best specificity (77.77%) using a threshold of 0.0875. The detailed results of the sensitivity analyses are listed in <xref ref-type="supplementary-material" rid="sup-a">Appendix III</xref>.</p><p>The final hyperparameters used for all models are listed in <xref ref-type="supplementary-material" rid="sup-a">Appendix III Table 5</xref>.</p></sec><sec><title>Discussion</title><p>This is the first study to use pan-Canadian primary care data to create a frailty case definition using machine learning. We observed a frailty prevalence of 18.4% in the data gathered, which is similar to other reported frailty prevalence estimates in seniors over the age of 65 [<xref ref-type="bibr" rid="ref-30">30</xref>]. A collection of eight common supervised machine learning architectures were used for the identification of dichotomized frailty, and performance assessed using the hold-out test set.</p><p>XGBoost had the overall best performance across all training datasets, achieving the highest or second highest sensitivity in each. Using the original imbalanced dataset, an XGBoost model was able to achieve great performance, with 78.14% sensitivity and 74.41% specificity using a decision threshold of 0.1851.</p><p>The same XGBoost model achieved a sensitivity of 40.50% and a specificity of 93.97% using a decision threshold of 0.5. We can compare these results with what was achieved previously by Williamson et al, where the CPCSSN EMR data used were only from Alberta and decision threshold used was 0.5 [<xref ref-type="bibr" rid="ref-13">13</xref>]. We can see that by using more machine learning models and a larger dataset, sensitivity was able to improve from 28% to 40.50%, and specificity did not suffer a loss with both at 94%.</p><p>The balanced dataset created by SMOTE did not result in better performance as compared with the original imbalanced dataset. One explanation may be that no undersampling was performed. While random undersampling used in tandem with SMOTE can lead to increased classification performance [<xref ref-type="bibr" rid="ref-22">22</xref>], we elected not to undersample the proportion of non-frail patients to preserve information. This lack of undersampling increased the number of synthetic oversampling required to reach a balance between the number of frail and non-frail patients. If the feature space for frail patients and non-frail patients had areas of overlap, oversampling the frail patients may have introduced patients whose label may in actuality be non-frail, inadvertently introducing false positive samples to the training dataset. As <xref ref-type="table" rid="table-2">Table 2</xref> shows, there was no significant statistical difference in proportion between frail and non-frail patients for diabetes mellitus, epilepsy, osteoarthritis. The distributions of mean BMI and mean systolic blood pressure also had sufficient overlap between that of frail and non-frail patients to not be statistically significantly different.</p><p>The sensitivity analyses using two alternative cut-offs for the binary classification of frailty based on the CFS scores resulted in similar performances when the decision threshold was determined using the ROC curves, where the highest sensitivities ranged from 76.37% to 78.85%, and the highest specificities ranged from 76.02% to 77.7%. Changing the cut-off also changed the sample size in each class, affecting the level of imbalance present. When a cut-off of 4 and above was used to identify frailty, the number of frail patients increased. However more noise was potentially introduced as now the sample with the &#x2018;frail&#x2019; label had ranged from patients that were rated &#x2018;vulnerable&#x2019; to those who were rated as &#x2018;terminally ill&#x2019;. Conversely, when a cut-off of 6 and above was used the number of frail patients decreased, resulting in a more severe imbalance and an increase in the noise in the features of the non-frail group.</p><p>As there was no significant classification difference between any of the four training datasets, we propose that the best model to use for the identification of frail patients in EMR data is the XGBoost model trained using the original data, with frailty defined using the standard CFS score cut-off of 5 and above. This model is readily deployable, inexpensive, and could be used for public health surveillance and frailty research. As the features used in the model were based on routinely collected structured primary care EMR data, this model could also be easily tested and used in other primary care EMRs.</p><p>While our goal was to maximize sensitivity and specificity in tandem, it&#x2019;s also possible to change the decision threshold to other points on the ROC curve that maximize sensitivity at the expense of specificity (and vice versa). For example, the XGBoost model trained on the original imbalanced data with a decision threshold of 0.5 has a sensitivity of 40.50% and a specificity of 93.97%. This model would classify a relatively low number of false positives, and can be used to rule-in frail patients, as patients classified as &#x2018;frail&#x2019; has a high certainty of actually being frail. A model with high specificity could be used for studies assessing the efficacy of interventions for reducing existing level of frailty. These studies may find inconclusive results if both non-frail and frail patients were included, as the level of frailty is unlikely to change for non-frail patients.</p><p>The decision threshold may also be moved to achieve a high sensitivity and low specificity, which would result in a low number of false negatives. A model with these characteristics could be used to create frailty screening cohorts, where the goal is to select as many frail patients as possible at the expense of having some false positives.</p><sec><title>Limitations</title><p>One important limitation of this study is in the assignment of the CFS scores. The application of the CFS to their own patients may have varied between physicians, and as each patient received only one CFS score, we were also not able to assess inter-rater reliability. Previous research on the inter-rater reliability of the CFS in an emergency care setting showed a kappa of 0.9 between emergency department nurses and emergency department physicians [<xref ref-type="bibr" rid="ref-31">31</xref>]. Another study in an outpatient setting showed an inter-rater reliability of 0.811 for the CFS between physicians [<xref ref-type="bibr" rid="ref-32">32</xref>]. Future on frailty classification may also wish to have physicians rate the same group of patients to assess inter-rater reliability.</p><p>Another limitation of clinicians assessing their own patients is that they may have used recall of patient encounters and conversations to assess frailty severity. It was very likely that clinicians used information not recorded in EMR, such as past experiences or intuition in their assessment of the severity of frailty. The classification ability of any model will be hindered if some data used to inform the label was not available. Although this may be an ever present issue in primary care where long-term clinician-patient relationships are common.</p><p>Selection bias may have occurred when some physicians had selected a group of their own patients to rate, rather than being provided a list of randomly sampled patients. These physicians may have been more likely to select patients they have seen frequently to better assess their level of frailty. These patients may have higher rates of clinic visitation compared with the average patient in the EMR. Resulting models may be consistently poorer at classifying frailty for patients with few clinic visitations as compared with patients with frequent clinic visitations.</p><p>It should be noted that although the task of classification requires a reference-standard label that represents the ground truth, this may not be possible for diseases with unclear or subjective diagnostic criteria. The CFS was created to allow for room for clinical judgement [<xref ref-type="bibr" rid="ref-14">14</xref>], and this flexibility will also introduce wanted variation between patients with the same frailty score on the CFS. However, this variation is undesirable for supervised machine learning. Future research may wish to use multiple raters to assess each senior patient on their level of frailty, and assess the differences between patients who had varied CFS scores versus those who had consistent CFS scores.</p><p>While dichotomization is common practice in disease identification, it reduces the amount of information that can be used. Patients who were previously separated by frailty severity are now one common class, where mildly frail patients have the same label as severely frail patients. As we had dichotomized the CFS after the physicians had rated their patients, it is also possible that some physicians would have disagreed with the cut-off of 5 to define frailty. This may have been another source of variation introduced to the data. Future work may wish to keep the original 9 point ordinal scale, or collapsed groups of 4 or 5 levels of frailty to increase the sample size in each category. An alternative approach could be to assess the CFS as a continuous variable, by approximating the underlying distribution to the distribution of the nine classes, then creating decision boundaries for the transformation back to the ordinal CFS to assess performance.</p><p>One of the challenges of using EMR data is the lack of standard in how each EMR database may record, process, and store their information [<xref ref-type="bibr" rid="ref-33">33</xref>, <xref ref-type="bibr" rid="ref-34">34</xref>]. This study combined data from five different regional CPCSSN networks, each one within a unique province in Canada. Each regional CPCSSN network had provided the most recent extraction of their data, which had been cleaned and processed using their own methods. Not all networks provided EMR records containing unstructured data, thus all available data for featurization were reduced to structured data that were collected in all networks. This was a large limitation as while processed data may be more readily used, unstructured free-text notes have been shown to contain diagnostic suspicion that was not coded [<xref ref-type="bibr" rid="ref-35">35</xref>] and potential disease incidence [<xref ref-type="bibr" rid="ref-36">36</xref>]. Kharrazi et al. showed that geriatric syndromes were significantly more likely to be identified using unstructured EMR notes as compared with structured data only [<xref ref-type="bibr" rid="ref-37">37</xref>]. Specifically, the addition of free-text notes processed using natural language processing methods increased the detection rate of geriatric syndromes by a factor of 3.2 times for falls, 18 for malnutrition, 3.4 for walking difficulties, and 455.9 for lack of social support. Future studies could link primary EMR data with other data sources, such as hospitalization or emergency care records, or specialist outpatient clinics EMRs to increase the amount of available data.</p></sec></sec><sec><title>Conclusion</title><p>We were able to create a supervised classification model using XGBoost for the identification of frailty with a 78.14% sensitivity and 74.41% specificity using routinely collected primary care EMR data for usage in the Canadian context. This classification model could be used for further research on frail patients within primary care, as well as for public health surveillance.</p><p>Neither the use of alternative cut-offs for the definition of frailty nor the use of SMOTE for minority oversampling resulted in a change in classification performance. Future research may consider using physicians to rate the same group of patients to assess for inter-rater reliability, and to supplement primary care EMR data with data from other sources in the healthcare system.</p></sec><sec sec-type="supplementary-material"><title>Supplementary Files</title><supplementary-material id="sup-a"><label>Supplementary Appendices</label> <media mimetype="application" mime-subtype="pdf" xlink:href="ijpds-06-1650-s001.pdf"/></supplementary-material></sec></body><back><ack><title>Acknowledgements</title><p>We would like to acknowledge the family physicians in Alberta, British Columbia, Manitoba, Ontario, and Nova Scotia that took part in completing the Rockwood Clinical Frailty Scale.</p></ack><sec><title>Ethics</title><p>All procedures and analyses were approved by regional network directors&#x2019; ethics boards, including: University of British Columbia (REB# H18-01341), University of Calgary (REB# 18-1881), University of Manitoba (REB # HS22406 (H2018:486)), McMaster University (REB# 5393), and Dalhousie University (REB #1024172).</p></sec><sec><title>Accessibility of data and code</title><p>Similar data are available from CPCSSN upon request. Code is available upon request from authors.</p></sec><ref-list><title>References</title><ref id="ref-1"><label>1</label><mixed-citation publication-type="journal"><string-name><surname>Walston</surname> <given-names>J</given-names></string-name>, <string-name><surname>Hadley</surname> <given-names>EC</given-names></string-name>, <string-name><surname>Ferrucci</surname> <given-names>L</given-names></string-name>, <string-name><surname>Guralnik</surname> <given-names>JM</given-names></string-name>, <string-name><surname>Newman</surname> <given-names>AB</given-names></string-name>, <string-name><surname>Studenski</surname> <given-names>SA</given-names></string-name>, <etal>et al</etal>. <article-title>Research agenda for frailty in older adults: toward a better understanding of physiology and etiology: summary from the American Geriatrics Society/National Institute on Aging Research Conference on Frailty in Older Adults</article-title>. <source>J Am Geriatr Soc</source>. <year>2006</year> <month>Jun</month>;<volume>54</volume>(<issue>6</issue>):<fpage>991</fpage>&#x2013;<lpage>1001</lpage>. <pub-id pub-id-type="doi">10.1111/j.1532-5415.2006.00745.x</pub-id>.</mixed-citation></ref><ref id="ref-2"><label>2</label><mixed-citation publication-type="journal"><string-name><surname>Yanagawa</surname> <given-names>B</given-names></string-name>, <string-name><surname>Latter</surname> <given-names>DA</given-names></string-name>, <string-name><surname>Fedak</surname> <given-names>PWM</given-names></string-name>, <string-name><surname>Cutrara</surname> <given-names>C</given-names></string-name>, <string-name><surname>Verma</surname> <given-names>S</given-names></string-name>. <article-title>The Cost of Frailty in Cardiac Surgery</article-title>. <source>Can J Cardiol</source>. <year>2017</year> <month>Aug</month> <day>1</day>;<volume>33</volume>(<issue>8</issue>):<fpage>959</fpage>&#x2013;<lpage>60</lpage>. <pub-id pub-id-type="doi">10.1016/j.cjca.2017.05.015</pub-id>.</mixed-citation></ref><ref id="ref-3"><label>3</label><mixed-citation publication-type="journal"><string-name><surname>Rodrigues</surname> <given-names>MK</given-names></string-name>, <string-name><surname>Marques</surname> <given-names>A</given-names></string-name>, <string-name><surname>Lobo</surname> <given-names>DML</given-names></string-name>, <string-name><surname>Umeda</surname> <given-names>IIK</given-names></string-name>, <string-name><surname>Oliveira</surname> <given-names>MF</given-names></string-name>. <article-title>Pre-Frailty Increases the Risk of Adverse Events in Older Patients Undergoing Cardiovascular Surgery</article-title>. <source>Arq Bras Cardiol</source>. <year>2017</year> <month>Oct</month>;<volume>109</volume>(<issue>4</issue>):<fpage>299</fpage>&#x2013;<lpage>306</lpage>. <pub-id pub-id-type="doi">10.5935/abc20170131</pub-id>.</mixed-citation></ref><ref id="ref-4"><label>4</label><mixed-citation publication-type="journal"><string-name><surname>Chen</surname> <given-names>C-L</given-names></string-name>, <string-name><surname>Chen</surname> <given-names>C-M</given-names></string-name>, <string-name><surname>Wang</surname> <given-names>C-Y</given-names></string-name>, <string-name><surname>Ko</surname> <given-names>P-W</given-names></string-name>, <string-name><surname>Chen</surname> <given-names>C-H</given-names></string-name>, <string-name><surname>Hsieh</surname> <given-names>C-P</given-names></string-name>, <etal>et al</etal>. <article-title>Frailty is Associated with an Increased Risk of Major Adverse Outcomes in Elderly Patients Following Surgical Treatment of Hip Fracture</article-title>. <source>Sci Rep</source>. <year>2019</year> <month>Dec</month>;<volume>9</volume>(<issue>1</issue>):<fpage>19135</fpage>. <pub-id pub-id-type="doi">10.1038/s41598-019-55459-2</pub-id>.</mixed-citation></ref><ref id="ref-5"><label>5</label><mixed-citation publication-type="journal"><string-name><surname>Crocker</surname> <given-names>TF</given-names></string-name>, <string-name><surname>Brown</surname> <given-names>L</given-names></string-name>, <string-name><surname>Clegg</surname> <given-names>A</given-names></string-name>, <string-name><surname>Farley</surname> <given-names>K</given-names></string-name>, <string-name><surname>Franklin</surname> <given-names>M</given-names></string-name>, <string-name><surname>Simpkins</surname> <given-names>S</given-names></string-name>, <etal>et al</etal>. <article-title>Quality of life is substantially worse for community-dwelling older people living with frailty: systematic review and meta-analysis</article-title>. <source>Qual Life Res</source>. <year>2019</year> <month>Aug</month> <day>1</day>;<volume>28</volume>(<issue>8</issue>):<fpage>2041</fpage>&#x2013;<lpage>56</lpage>. <pub-id pub-id-type="doi">10.1007/s11136-019-02149-1</pub-id>.</mixed-citation></ref><ref id="ref-6"><label>6</label><mixed-citation publication-type="journal"><string-name><surname>Oldenkamp</surname> <given-names>M</given-names></string-name>, <string-name><surname>Hagedoorn</surname> <given-names>M</given-names></string-name>, <string-name><surname>Wittek</surname> <given-names>R</given-names></string-name>, <string-name><surname>Stolk</surname> <given-names>R</given-names></string-name>, <string-name><surname>Smidt</surname> <given-names>N</given-names></string-name>. <article-title>The impact of older person&#x2019;s frailty on the care-related quality of life of their informal caregiver over time: results from the TOPICS-MDS project</article-title>. <source>Qual Life Res</source>. <year>2017</year> <month>Oct</month> <day>1</day>;<volume>26</volume>(<issue>10</issue>):<fpage>2705</fpage>&#x2013;<lpage>16</lpage>. <pub-id pub-id-type="doi">10.1007/s11136-017-1606-5</pub-id>.</mixed-citation></ref><ref id="ref-7"><label>7</label><mixed-citation publication-type="website"><collab>Frailty Matters [Internet]</collab>. <article-title>Canadian Frailty Network</article-title>. [cited <year>2020</year> <month>Dec</month> <day>6</day>]. Available from: <uri>https://www.cfn-nce.ca/frailty-matters/</uri>.</mixed-citation></ref><ref id="ref-8"><label>8</label><mixed-citation publication-type="journal"><string-name><surname>Travers</surname> <given-names>J</given-names></string-name>, <string-name><surname>Romero-Ortuno</surname> <given-names>R</given-names></string-name>, <string-name><surname>Bailey</surname> <given-names>J</given-names></string-name>, <etal>Cooney M-T</etal>. <article-title>Delaying and reversing frailty: a systematic review of primary care interventions</article-title>. <source>Br J Gen Pract</source>. <year>2019</year> <month>Jan</month> <day>1</day>;<volume>69</volume>(<issue>678</issue>):<fpage>e61</fpage>&#x2013;<lpage>9</lpage>. <pub-id pub-id-type="doi">10.3399/bjgp18X700241</pub-id>.</mixed-citation></ref><ref id="ref-9"><label>9</label><mixed-citation publication-type="journal"><string-name><surname>Lacas</surname> <given-names>A</given-names></string-name>, <string-name><surname>Rockwood</surname> <given-names>K</given-names></string-name>. <article-title>Frailty in primary care: a review of its conceptualization and implications for practice</article-title>. <source>BMC Med</source>. <year>2012</year> <month>Jan</month> <day>11</day>;<volume>10</volume>(<issue>1</issue>):<fpage>4</fpage>. <pub-id pub-id-type="doi">10.1186/1741-7015-10-4</pub-id>.</mixed-citation></ref><ref id="ref-10"><label>10</label><mixed-citation publication-type="journal"><string-name><surname>Braithwaite</surname> <given-names>RS</given-names></string-name>, <string-name><surname>Fiellin</surname> <given-names>D</given-names></string-name>, <string-name><surname>Justice</surname> <given-names>AC</given-names></string-name>. <article-title>The Payoff Time</article-title>. <source>Med Care</source>. <year>2009</year> <month>Jun</month>;<volume>47</volume>(<issue>6</issue>):<fpage>610</fpage>&#x2013;<lpage>7</lpage>. <pub-id pub-id-type="doi">10.1097/MLR.0b013e31819748d5</pub-id>.</mixed-citation></ref><ref id="ref-11"><label>11</label><mixed-citation publication-type="journal"><string-name><surname>Collard</surname> <given-names>RM</given-names></string-name>, <string-name><surname>Boter</surname> <given-names>H</given-names></string-name>, <string-name><surname>Schoevers</surname> <given-names>RA</given-names></string-name>, <string-name><surname>Voshaar</surname> <given-names>RCO</given-names></string-name>. <article-title>Prevalence of Frailty in Community-Dwelling Older Persons: A Systematic Review</article-title>. <source>J Am Geriatr Soc</source>. <year>2012</year>;<volume>60</volume>(<issue>8</issue>):<fpage>1487</fpage>&#x2013;<lpage>92</lpage>. <pub-id pub-id-type="doi">10.1111/j.1532-5415.2012.04054.x</pub-id>.</mixed-citation></ref><ref id="ref-12"><label>12</label><mixed-citation publication-type="website"><string-name><surname>Lethebe</surname> <given-names>BC</given-names></string-name>. <article-title>Using machine learning methods to improve chronic disease case definitions in primary care electronic medical records</article-title>. <year>2018</year> <month>Apr</month> <day>23</day> [cited <year>2019</year> <month>Oct</month> <day>18</day>]; Available from: <uri>https://prism.ucalgary.ca/handle/1880/106538</uri>. <pub-id pub-id-type="doi">10.11575/PRISM/31824</pub-id>.</mixed-citation></ref><ref id="ref-13"><label>13</label><mixed-citation publication-type="journal"><string-name><surname>Williamson</surname> <given-names>T</given-names></string-name>, <string-name><surname>Aponte-Hao</surname> <given-names>S</given-names></string-name>, <string-name><surname>Mele</surname> <given-names>B</given-names></string-name>, <string-name><surname>Lethebe</surname> <given-names>BC</given-names></string-name>, <string-name><surname>Leduc</surname> <given-names>C</given-names></string-name>, <string-name><surname>Thandi</surname> <given-names>M</given-names></string-name>, <etal>et al</etal>. <article-title>Developing and validating a primary care EMR-based frailty definition using machine learning</article-title>. <source>Int J Popul Data Sci</source>. <year>2020</year> <month>Sep</month> <day>1</day>;<volume>5</volume>(<issue>1</issue>):<fpage>1344</fpage>. <pub-id pub-id-type="doi">10.23889/ijpds.v5i1.1344</pub-id>.</mixed-citation></ref><ref id="ref-14"><label>14</label><mixed-citation publication-type="journal"><string-name><surname>Rockwood</surname> <given-names>K</given-names></string-name>, <string-name><surname>Song</surname> <given-names>X</given-names></string-name>, <string-name><surname>MacKnight</surname> <given-names>C</given-names></string-name>, <string-name><surname>Bergman</surname> <given-names>H</given-names></string-name>, <string-name><surname>Hogan</surname> <given-names>DB</given-names></string-name>, <string-name><surname>McDowell</surname> <given-names>I</given-names></string-name>, <etal>et al</etal>. <article-title>A global clinical measure of fitness and frailty in elderly people</article-title>. <source>CMAJ</source>. <year>2005</year> <month>Aug</month> <day>30</day>;<volume>173</volume>(<issue>5</issue>):<fpage>489</fpage>&#x2013;<lpage>95</lpage>. <pub-id pub-id-type="doi">10.1503/cmaj.050051</pub-id>.</mixed-citation></ref><ref id="ref-15"><label>15</label><mixed-citation publication-type="journal"><string-name><surname>Fried</surname> <given-names>LP</given-names></string-name>, <string-name><surname>Tangen</surname> <given-names>CM</given-names></string-name>, <string-name><surname>Walston</surname> <given-names>J</given-names></string-name>, <string-name><surname>Newman</surname> <given-names>AB</given-names></string-name>, <string-name><surname>Hirsch</surname> <given-names>C</given-names></string-name>, <string-name><surname>Gottdiener</surname> <given-names>J</given-names></string-name>, <etal>et al</etal>. <article-title>Frailty in Older Adults: Evidence for a Phenotype</article-title>. <source>J Gerontol A Biol Sci Med Sci</source>. <year>2001</year> <month>Mar</month> <day>1</day>;<volume>56</volume>(<issue>3</issue>):<fpage>M146</fpage>&#x2013;<lpage>57</lpage>. <pub-id pub-id-type="doi">10.1093/gerona/56.3.m146</pub-id>.</mixed-citation></ref><ref id="ref-16"><label>16</label><mixed-citation publication-type="journal"><string-name><surname>Hassler</surname> <given-names>AP</given-names></string-name>, <string-name><surname>Menasalvas</surname> <given-names>E</given-names></string-name>, <string-name><surname>Garc&#x00ED;a-Garc&#x00ED;a</surname> <given-names>FJ</given-names></string-name>, <string-name><surname>Rodr&#x00ED;guez-Ma&#x00F1;as</surname> <given-names>L</given-names></string-name>, <string-name><surname>Holzinger</surname> <given-names>A</given-names></string-name>. <article-title>Importance of medical data preprocessing in predictive modeling and risk factor discovery for the frailty syndrome</article-title>. <source>BMC Med Inform Decis Mak</source>. <year>2019</year> <month>Feb</month> <day>18</day>;<volume>19</volume>(<issue>1</issue>):<fpage>33</fpage>. <pub-id pub-id-type="doi">10.1186/s12911-019-0747-6</pub-id>.</mixed-citation></ref><ref id="ref-17"><label>17</label><mixed-citation publication-type="journal"><string-name><surname>Clegg</surname> <given-names>A</given-names></string-name>, <string-name><surname>Bates</surname> <given-names>C</given-names></string-name>, <string-name><surname>Young</surname> <given-names>J</given-names></string-name>, <string-name><surname>Ryan</surname> <given-names>R</given-names></string-name>, <string-name><surname>Nichols</surname> <given-names>L</given-names></string-name>, <etal>Ann Teale E, et al</etal>. <article-title>Development and validation of an electronic frailty index using routine primary care electronic health record data</article-title>. <source>Age Ageing</source>. <year>2016</year> <month>May</month> <day>1</day>;<volume>45</volume>(<issue>3</issue>):<fpage>353</fpage>&#x2013;<lpage>60</lpage>. <pub-id pub-id-type="doi">10.1093/ageing/afw039</pub-id>.</mixed-citation></ref><ref id="ref-18"><label>18</label><mixed-citation publication-type="journal"><string-name><surname>Ambagtsheer</surname> <given-names>RC</given-names></string-name>, <string-name><surname>Shafiabady</surname> <given-names>N</given-names></string-name>, <string-name><surname>Dent</surname> <given-names>E</given-names></string-name>, <string-name><surname>Seiboth</surname> <given-names>C</given-names></string-name>, <string-name><surname>Beilby</surname> <given-names>J</given-names></string-name>. <article-title>The application of artificial intelligence (AI) techniques to identify frailty within a residential aged care administrative data set</article-title>. <source>Int J Med Inf</source>. <year>2020</year> <month>Apr</month> <day>1</day>;<volume>136</volume>:<fpage>104094</fpage>. <pub-id pub-id-type="doi">10.1016/j.ijmedinf.2020.104094</pub-id>.</mixed-citation></ref><ref id="ref-19"><label>19</label><mixed-citation publication-type="journal"><string-name><surname>Garies</surname> <given-names>S</given-names></string-name>, <string-name><surname>Birtwhistle</surname> <given-names>R</given-names></string-name>, <string-name><surname>Drummond</surname> <given-names>N</given-names></string-name>, <string-name><surname>Queenan</surname> <given-names>J</given-names></string-name>, <string-name><surname>Williamson</surname> <given-names>T</given-names></string-name>. <article-title>Data Resource Profile: National electronic medical record data from the Canadian Primary Care Sentinel Surveillance Network (CPCSSN)</article-title>. <source>Int J Epidemiol</source>. <year>2017</year> <month>Aug</month> <day>1</day>;<volume>46</volume>(<issue>4</issue>):<fpage>1091</fpage>&#x2013;<lpage>1092f</lpage>. <pub-id pub-id-type="doi">10.1093/ije/dyw248</pub-id>.</mixed-citation></ref><ref id="ref-20"><label>20</label><mixed-citation publication-type="journal"><string-name><surname>Kadhim-Saleh</surname> <given-names>A</given-names></string-name>, <string-name><surname>Green</surname> <given-names>M</given-names></string-name>, <string-name><surname>Williamson</surname> <given-names>T</given-names></string-name>, <string-name><surname>Hunter</surname> <given-names>D</given-names></string-name>, <string-name><surname>Birtwhistle</surname> <given-names>R</given-names></string-name>. <article-title>Validation of the Diagnostic Algorithms for 5 Chronic Conditions in the Canadian Primary Care Sentinel Surveillance Network (CPCSSN): A Kingston Practice-based Research Network (PBRN) Report</article-title>. <source>J Am Board Fam Med</source>. <year>2013</year> <month>Mar</month> <day>1</day>;<volume>26</volume>(<issue>2</issue>):<fpage>159</fpage>&#x2013;<lpage>67</lpage>. <pub-id pub-id-type="doi">10.3122/jabfm.2013.02.120183</pub-id>.</mixed-citation></ref><ref id="ref-21"><label>21</label><mixed-citation publication-type="journal"><string-name><surname>Azur</surname> <given-names>MJ</given-names></string-name>, <string-name><surname>Stuart</surname> <given-names>EA</given-names></string-name>, <string-name><surname>Frangakis</surname> <given-names>C</given-names></string-name>, <string-name><surname>Leaf</surname> <given-names>PJ</given-names></string-name>. <article-title>Multiple Imputation by Chained Equations: What is it and how does it work?</article-title> <source>Int J Methods Psychiatr Res</source>. <year>2011</year> <month>Mar</month> <day>1</day>;<volume>20</volume>(<issue>1</issue>):<fpage>40</fpage>&#x2013;<lpage>9</lpage>. <pub-id pub-id-type="doi">10.1002/mpr.329</pub-id>.</mixed-citation></ref><ref id="ref-22"><label>22</label><mixed-citation publication-type="journal"><string-name><surname>Chawla</surname> <given-names>NV</given-names></string-name>, <string-name><surname>Bowyer</surname> <given-names>KW</given-names></string-name>, <string-name><surname>Hall</surname> <given-names>LO</given-names></string-name>, <string-name><surname>Kegelmeyer</surname> <given-names>WP</given-names></string-name>. <article-title>SMOTE: Synthetic Minority Over-sampling Technique</article-title>. <source>J Artif Intell Res</source>. <year>2002</year> <month>Jun</month> <day>1</day>;<volume>16</volume>:<fpage>321</fpage>&#x2013;<lpage>57</lpage>. <pub-id pub-id-type="doi">10.1613/jair.953</pub-id>.</mixed-citation></ref><ref id="ref-23"><label>23</label><mixed-citation publication-type="journal"><string-name><surname>Zou</surname> <given-names>H</given-names></string-name>, <string-name><surname>Hastie</surname> <given-names>T</given-names></string-name>. <article-title>Regularization and variable selection via the elastic net</article-title>. <source>J R Stat Soc Ser B Stat Methodol</source>. <year>2005</year>;<volume>67</volume>(<issue>2</issue>):<fpage>301</fpage>&#x2013;<lpage>20</lpage>. <pub-id pub-id-type="doi">10.1111/j.1467-9868.2005.00503.x</pub-id>.</mixed-citation></ref><ref id="ref-24"><label>24</label><mixed-citation publication-type="journal"><string-name><surname>Metz</surname> <given-names>CE</given-names></string-name>. <article-title>Basic principles of ROC analysis</article-title>. <source>Semin Nucl Med</source>. <year>1978</year> <month>Oct</month> <day>1</day>;<volume>8</volume>(<issue>4</issue>):<fpage>283</fpage>&#x2013;<lpage>98</lpage>. <pub-id pub-id-type="doi">10.1016/s0001-2998(78)80014-2</pub-id>.</mixed-citation></ref><ref id="ref-25"><label>25</label><mixed-citation publication-type="website"><article-title>The REporting of studies Conducted using Observational Routinely-collected health Data (RECORD) Statement [Internet]</article-title>. [cited <year>2020</year> <month>Dec</month> <day>6</day>]. Available from: <uri>https://journals.plos.org/plosmedicine/article?id=10.1371/journal.pmed.1001885</uri>. <pub-id pub-id-type="doi">10.1371/journal.pmed.1001885</pub-id>.</mixed-citation></ref><ref id="ref-26"><label>26</label><mixed-citation publication-type="journal"><string-name><surname>Church</surname> <given-names>S</given-names></string-name>, <string-name><surname>Rogers</surname> <given-names>E</given-names></string-name>, <string-name><surname>Rockwood</surname> <given-names>K</given-names></string-name>, <string-name><surname>Theou</surname> <given-names>O</given-names></string-name>. <article-title>A scoping review of the Clinical Frailty Scale</article-title>. <source>BMC Geriatr</source>. <year>2020</year> <month>Oct</month> <day>7</day>;<volume>20</volume>(<issue>1</issue>):<fpage>393</fpage>. <pub-id pub-id-type="doi">10.1186/s12877-020-01801-7</pub-id>.</mixed-citation></ref><ref id="ref-27"><label>27</label><mixed-citation publication-type="journal"><string-name><surname>Kuhn</surname> <given-names>M</given-names></string-name>. <article-title>caret: Classification and Regression Training</article-title>. <source>ascl</source>. <year>2015</year> <month>May</month>;<volume>ascl</volume>:<fpage>1505.003</fpage>.</mixed-citation></ref><ref id="ref-28"><label>28</label><mixed-citation publication-type="website"><string-name><surname>LeDell</surname> <given-names>E</given-names></string-name>, <string-name><surname>Gill</surname> <given-names>N</given-names></string-name>, <string-name><surname>Aiello</surname> <given-names>S</given-names></string-name>, <string-name><surname>Fu</surname> <given-names>A</given-names></string-name>, <string-name><surname>Candel</surname> <given-names>A</given-names></string-name>, <string-name><surname>Click</surname> <given-names>F</given-names></string-name>, <etal>et al</etal>. <article-title>h2o: R Interface for the &#x2019;H2O&#x2019; Scalable Machine Learning Platform</article-title>. <source>R package version. 3.32.1.3</source>. Available from: <uri>httsp://CRAN.R-project.org/package=h2o</uri>.</mixed-citation></ref><ref id="ref-29"><label>29</label><mixed-citation publication-type="website"><string-name><surname>Ushey</surname> <given-names>K</given-names></string-name>, <string-name><surname>Allaire</surname> <given-names>JJ</given-names></string-name>, <string-name><surname>Tang</surname> <given-names>Y</given-names></string-name>. <article-title>reticulate: Interface to &#x201C;Python&#x201D;</article-title>. <source>R package version 1.20</source>. Available from: <uri>https://CRAN.R-project.org/package=reticulate</uri>.</mixed-citation></ref><ref id="ref-30"><label>30</label><mixed-citation publication-type="journal"><string-name><surname>Kehler</surname> <given-names>DS</given-names></string-name>, <string-name><surname>Ferguson</surname> <given-names>T</given-names></string-name>, <string-name><surname>Stammers</surname> <given-names>AN</given-names></string-name>, <string-name><surname>Bohm</surname> <given-names>C</given-names></string-name>, <string-name><surname>Arora</surname> <given-names>RC</given-names></string-name>, <string-name><surname>Duhamel</surname> <given-names>TA</given-names></string-name>, <etal>et al</etal>. <article-title>Prevalence of frailty in Canadians 18&#x2013;79 years old in the Canadian Health Measures Survey</article-title>. <source>BMC Geriatr</source>. <year>2017</year> <month>Jan</month> <day>21</day>;<volume>17</volume>(<issue>1</issue>):<fpage>28</fpage>. <pub-id pub-id-type="doi">10.1186/s12877-017-0423-6</pub-id>.</mixed-citation></ref><ref id="ref-31"><label>31</label><mixed-citation publication-type="journal"><string-name><surname>Lo</surname> <given-names>AX</given-names></string-name>, <string-name><surname>Heinemann</surname> <given-names>AW</given-names></string-name>, <string-name><surname>Gray</surname> <given-names>E</given-names></string-name>, <string-name><surname>Lindquist</surname> <given-names>LA</given-names></string-name>, <string-name><surname>Kocherginsky</surname> <given-names>M</given-names></string-name>, <string-name><surname>Post</surname> <given-names>LA</given-names></string-name>, <etal>et al</etal>. <article-title>Inter-rater Reliability of Clinical Frailty Scores for Older Patients in the Emergency Department</article-title>. <source>Acad Emerg Med</source>. <year>2021</year>;<volume>28</volume>(<issue>1</issue>):<fpage>110</fpage>&#x2013;<lpage>3</lpage>. <pub-id pub-id-type="doi">10.1111/acem.13953</pub-id>.</mixed-citation></ref><ref id="ref-32"><label>32</label><mixed-citation publication-type="journal"><string-name><surname>&#x00D6;zs&#x00FC;rekci</surname> <given-names>C</given-names></string-name>, <string-name><surname>Balc&#x0131;</surname> <given-names>C</given-names></string-name>, <string-name><surname>K&#x0131;z&#x0131;larslano&#x011F;lu</surname> <given-names>MC</given-names></string-name>, <string-name><surname>&#x00C7;al&#x0131;&#x015F;kan</surname> <given-names>H</given-names></string-name>, <string-name><surname>Tuna Do&#x011F;rul</surname> <given-names>R</given-names></string-name>, <string-name><surname>Ay&#x00E7;i&#x00E7;ek</surname> <given-names>G&#x015E;</given-names></string-name>, <etal>et al</etal>. <article-title>An important problem in an aging country: identifying the frailty via 9 Point Clinical Frailty Scale-</article-title>. <source>Acta Clin Belg</source>. <year>2020</year> <month>May</month> <day>3</day>;<volume>75</volume>(<issue>3</issue>):<fpage>200</fpage>&#x2013;<lpage>4</lpage>. <pub-id pub-id-type="doi">10.1080/17843286.2019.1597457</pub-id>.</mixed-citation></ref><ref id="ref-33"><label>33</label><mixed-citation publication-type="journal"><string-name><surname>Kumar</surname> <given-names>S</given-names></string-name>, <string-name><surname>Aldrich</surname> <given-names>K</given-names></string-name>. <article-title>Overcoming barriers to electronic medical record (EMR) implementation in the US healthcare system: A comparative study</article-title>. <source>Health Informatics J</source>. <year>2010</year> <month>Dec</month> <day>1</day>;<volume>16</volume>(<issue>4</issue>):<fpage>306</fpage>&#x2013;<lpage>18</lpage>. <pub-id pub-id-type="doi">10.1177/1460458210380523</pub-id>.</mixed-citation></ref><ref id="ref-34"><label>34</label><mixed-citation publication-type="journal"><string-name><surname>Sachdeva</surname> <given-names>S</given-names></string-name>, <string-name><surname>Bhalla</surname> <given-names>S</given-names></string-name>. <article-title>Semantic interoperability in standardized electronic health record databases</article-title>. <source>J Data Inf Qual</source>. <year>2012</year> <month>May</month> <day>7</day>;<volume>3</volume>(<issue>1</issue>):<fpage>1:1</fpage>-<lpage>1:37</lpage>. <pub-id pub-id-type="doi">10.1145/2166788.2166789</pub-id>.</mixed-citation></ref><ref id="ref-35"><label>35</label><mixed-citation publication-type="journal"><string-name><surname>Ford</surname> <given-names>E</given-names></string-name>, <string-name><surname>Nicholson</surname> <given-names>A</given-names></string-name>, <string-name><surname>Koeling</surname> <given-names>R</given-names></string-name>, <string-name><surname>Tate</surname> <given-names>AR</given-names></string-name>, <string-name><surname>Carroll</surname> <given-names>J</given-names></string-name>, <string-name><surname>Axelrod</surname> <given-names>L</given-names></string-name>, <etal>et al</etal>. <article-title>Optimising the use of electronic health records to estimate the incidence of rheumatoid arthritis in primary care: what information is hidden in free text?</article-title> <source>BMC Med Res Methodol</source>. <year>2013</year> <month>Aug</month> <day>21</day>;<volume>13</volume>(<issue>1</issue>):<fpage>105</fpage>. <pub-id pub-id-type="doi">10.1186/1471-2288-13-105</pub-id>.</mixed-citation></ref><ref id="ref-36"><label>36</label><mixed-citation publication-type="book"><string-name><surname>Koeling</surname> <given-names>R</given-names></string-name>, <string-name><surname>Tate</surname> <given-names>AR</given-names></string-name>, <string-name><surname>Carroll</surname> <given-names>JA</given-names></string-name>. <chapter-title>Automatically estimating the incidence of symptoms recorded in GP free text notes</chapter-title>. In: <source>Proceedings of the first international workshop on Managing interoperability and complexity in health systems [Internet]</source>. <publisher-loc>New York, NY, USA</publisher-loc>: <publisher-name>Association for Computing Machinery</publisher-name>; <year>2011</year> [cited <year>2021</year> <month>Feb</month> <day>20</day>]. p. <fpage>43</fpage>&#x2013;<lpage>50</lpage>. (MIXHS &#x2019;11). <pub-id pub-id-type="doi">10.1145/2064747.2064757</pub-id>.</mixed-citation></ref><ref id="ref-37"><label>37</label><mixed-citation publication-type="journal"><string-name><surname>Kharrazi</surname> <given-names>H</given-names></string-name>, <string-name><surname>Anzaldi</surname> <given-names>LJ</given-names></string-name>, <string-name><surname>Hernandez</surname> <given-names>L</given-names></string-name>, <string-name><surname>Davison</surname> <given-names>A</given-names></string-name>, <string-name><surname>Boyd</surname> <given-names>CM</given-names></string-name>, <string-name><surname>Leff</surname> <given-names>B</given-names></string-name>, <etal>et al</etal>. <article-title>The Value of Unstructured Electronic Health Record Data in Geriatric Syndrome Case Identification</article-title>. <source>J Am Geriatr Soc</source>. <year>2018</year>;<volume>66</volume>(<issue>8</issue>):<fpage>1499</fpage>&#x2013;<lpage>507</lpage>. <pub-id pub-id-type="doi">10.1111/jgs.15411</pub-id>.</mixed-citation></ref></ref-list><glossary><title>Abbreviations</title><array><tbody><tr><td>CPCSSN</td><td>Canadian Primary Care Sentinel Surveillance Network</td></tr><tr><td>AUC</td><td>Area Under Receiver Operating Characteristic Curve</td></tr><tr><td>CaRT</td><td>Classification and Regression Tree</td></tr><tr><td>CFS</td><td>Clinical Frailty Score</td></tr><tr><td>COPD</td><td>Chronic Obstructive Pulmonary Disease</td></tr><tr><td>EMR</td><td>Electronic Medical Record</td></tr><tr><td>KNN</td><td>K-Nearest Neighbours</td></tr><tr><td>NPV</td><td>Negative Predictive Value</td></tr><tr><td>PPV</td><td>Positive Predictive Value</td></tr><tr><td>ReLU</td><td>Rectified Linear Unit</td></tr><tr><td>ROC</td><td>Receiver Operating Characteristic</td></tr><tr><td>SMOTE</td><td>Synthetic Minority Over-sampling Technique</td></tr><tr><td>SMOTE-NC</td><td>Synthetic Minority Over-sampling Technique-Nominal Continuous</td></tr><tr><td>SVM</td><td>Support Vector Machines</td></tr><tr><td>XGBoost</td><td>Extreme Gradient Boosting</td></tr></tbody></array></glossary></back></article>