## 4 Discussion  
Ontology adjustment can increase the statistical power of the analysis by aggregating rare ICD codes into broader and more frequent groupings. If conditions with less than 100 observations are considered rare, 50.6% of diagnoses were affected by our adjustments. These data suggest that nearly half of conditions in the medical history of the patient are rare, even in massive databases such as ours. When there are many rare situations in the data, the overall accuracy of analysis is affected. If we drop these rare conditions from the analysis, nearly 50% of cases are affected. With so many rare diagnoses, the overall impact of these rare events is large. Rare events in the data cause overfitting, meaning that they increase the gap between AROC in training and test sets. This paper demonstrated that ontological adjustments can reduce the gap by 9.0%, leading to better parameter estimates from the training set. Although OA did not improve accuracy of the overall models, it reduced the gap between training and test AROCs. This means that the OA reduced the frequency of modeling noise in the training set. Therefore, the parameters estimated in these training model may be more accurate. In addition, OA increased the sample size for each parameter (especially for rare events) in the training model. Increasing sample size reduced modeling noise in \begin{table}
\begin{tabular}{c c c c c c c} \hline \hline \multirow{2}{*}{**Antidepressant**} & \multicolumn{4}{c}{**Threshold 1 (No Adjustment)**} & \multicolumn{4}{c}{**Threshold 100 (Adjusted Data)**} \\ \cline{2-7}  & **Training** & **Test** & **Gap** & **Training** & **Test** & **Gap** \\ \hline AMITRIPTYLINE & 80.2\% & 68.4\% & 11.9\% & 72.3\% & 68.0\% & 4.4\% \\ BUPROPION & 73.9\% & 67.3\% & 6.6\% & 69.8\% & 67.3\% & 2.5\% \\ CITALOPRAM & 65.4\% & 63.2\% & 2.2\% & 63.9\% & 63.3\% & 0.7\% \\ DESVENLAFAXINE & 76.5\% & 68.9\% & 7.5\% & 70.2\% & 69.2\% & 1.0\% \\ DOXEPIN & 79.9\% & 64.6\% & 15.4\% & 67.4\% & 64.2\% & 3.2\% \\ DULOCETINE & 67.3\% & 61.9\% & 5.3\% & 64.0\% & 62.3\% & 1.6\% \\ ESCITALOPRAM & 63.7\% & 60.5\% & 3.2\% & 61.5\% & 60.3\% & 1.2\% \\ FLUOXETINE & 66.2\% & 64.8\% & 1.4\% & 65.3\% & 64.8\% & 0.5\% \\ FLUVOXAMINE & 89.2\% & 63.5\% & **25.7\%** & 69.3\% & 62.1\% & **7.2\%** \\ IMPRAMINE & 94.7\% & 64.9\% & **29.8\%** & 77.9\% & 67.8\% & **10.2\%** \\ MIRTAZAPINE & 72.0\% & 59.6\% & 12.4\% & 63.6\% & 59.6\% & 4.0\% \\ NEFAZODONE & 88.7\% & 58.4\% & **30.3\%** & 68.1\% & 59.9\% & **8.2\%** \\ NORTRIPYLINE & 85.1\% & 63.9\% & **21.2\%** & 70.9\% & 65.4\% & **5.5\%** \\ PAROXETINE & 65.0\% & 62.1\% & 2.9\% & 62.9\% & 62.1\% & 0.8\% \\ PRAMIPEXOLE & 76.0\% & 58.6\% & 17.4\% & 64.0\% & 58.9\% & 5.0\% \\ ROPINIROLE & 77.1\% & 58.4\% & 18.7\% & 64.4\% & 59.0\% & 5.4\% \\ SERTRALINE & 65.6\% & 64.2\% & 1.4\% & 64.7\% & 64.2\% & 0.5\% \\ TRAZODONE & 84.3\% & 72.5\% & 11.8\% & 78.1\% & 73.7\% & 4.4\% \\ VENLAFAXINE & 67.8\% & 64.2\% & 3.6\% & 65.4\% & 64.4\% & 1.1\% \\ VORTIOXETINE & 85.6\% & 66.2\% & **19.4\%** & 70.3\% & 68.9\% & **1.3\%** \\ \hline \hline \end{tabular}
\end{table} 
Table 1: AROC gaps for predicted effectiveness between the training and test sets. the estimation of the parameter, and modeling less noise led to AROCs that were more similar to test AROCs. Six models improved AROC on the test data, eleven had the same performance, and three performed worse. While this method did not improve quality for a majority of the models, the goal was to show a reduction in overfitting. Other algorithms to fit the data may show better performance. The use of ontology to improve predictions is not new. In the past, investigators have combined diagnostic codes into broad categories such as Clinical Classification Software [29], Charlson Comorbidity Index [30], and Elixhauser [31]. [PERSON] et al. [19] and [PERSON] et al. [20] evaluated the value of grouping disease codes into broad categories. Their results showed that ICD codes were typically too detailed, while classification categories were often not granular enough.