Purpose: We used a machine learning approach to identify the combinations of factors that contribute to lower adherence and high emergency department (ED) utilization. Methods: Using Medicaid claims, we identified adherence to anti-seizure medications and the number of ED visits for people with epilepsy in a 2-year follow up period. We used three years of baseline data to identify demographics, disease severity and management, comorbidities, and county-level social factors. Using Classification and Regression Tree (CART) and random forest we identified combinations of baseline factors that predicted lower adherence and ED visits. We further stratified these models by race and ethnicity. Results: From 52,175 people with epilepsy, the CART model identified developmental disabilities, age, race and ethnicity, and utilization as top predictors of adherence. When stratified by race and ethnicity, there was variation in the combinations of comorbidities including developmental disabilities, hypertension, and psychiatric comorbidities. Our CART model for ED utilization included a primary split among those with previous injuries, followed by anxiety and mood disorders, headache, back problems, and urinary tract infections. When stratified by race and ethnicity we saw that for Black individuals headache was a top predictor of future ED utilization although this did not appear in other racial and ethnic groups. Conclusions: ASM adherence differed by race and ethnicity, with different combinations of comorbidities predicting lower adherence across racial and ethnic groups. While there were not differences in ED use across races and ethnicity, we observed different combinations of comorbidities that predicted high ED utilization.