###### Abstract  
For patients with rare comorbidities, there are insufficient observations to accurately estimate the effectiveness of treatment. At the same time, all diagnosis, including rare diagnosis, are part of the International Classification of Disease (ICD). Grouping ICD into broader concepts (i.e., ontology adjustment) can not only increase accuracy of estimating antidepressant effectiveness for patients with rare conditions but also prevent overfitting in big data analysis. In this study, 3,678,082 depressed patients treated with antidepressants were obtained from OptumLabs(r) Data Warehouse (OLDW). For rare diagnoses, adjustments were made by using the likelihood ratio of the immediate broader concept in the ICD hierarchies. The accuracy of models in training (90%) and test (10%) sets was examined using the area under the receiver operating curves (AROC). The gap in training and test AROC shows how much random noise was modeled. If the gap is large, then the parameters of the model, including the reported effectiveness of the antidepressant for patients with rare conditions, are suspect. There was, on average, a 9.0% reduction in the AROC gap after using the ontological adjustment. Therefore, ontology adjustment can reduce model overfitting, leading to better parameter estimates from the training set.  
d 2022 2  
other information readily available in claims data, to predict the effectiveness of antidepressants in different subgroups of patients. We created models to predict remission for the top 20 antidepressants including bupropion, citalopram, escitalopram, fluoxetine, and sertraline.  
Overfitting is a common issue in model development, especially in big data analysis involving thousands of features [12; 13]. Overfitting happens when model parameters predict random noise in the training data. The model looks accurate in the training dataset, but accuracy drops in test data, when the same noise is no longer present. The parameters of rare events are especially suspect. There are too few observations of these events to accurately set these parameters, leading to a deterioration of model performance in test datasets. If there is little difference in the accuracy of the model predictions in training and validation sets, then the model has not captured random noise, and therefore, its parameters for rare events can be more trustworthy.  
Ontologies have been used in emerging data-driven science, including data mining and machine learning [14; 15]. Ontologies can help to cluster large amounts of data into meaningful and manageable groupings. For example, Gene Ontology is widely used to cluster gene expression data obtained from microarray experiments [16; 17; 18]. Previous studies had also examined the use of International Classification of Disease (ICD) Ontology for more accurate billing [19; 20; 21]. However, few studies investigate the usage of ontology in model overfitting, especially in the big data analysis. Our study focused on filling in this gap. We investigated how to use ontological hierarchies to adjust the sample size of patients with various diagnoses, especially for rare diagnoses. In moving up the ontological hierarchy, one increases the sample size, as broader concepts have more observations. We also discovered that ontological adjustment can be used to overcome model overfitting in the prediction of outcomes for antidepressants using large available claims data.