ObjectivesBuprenorphine is an effective evidence-based medication for opioid use disorder (OUD). Yet premature discontinuation undermines treatment effectiveness, increasing risk of mortality and overdose. We developed and evaluated a machine learning (ML) framework for predicting buprenorphine care discontinuity within 1-year following treatment initiation.MethodsThis retrospective study used United States 2018-2021 MarketScan commercial claims data of insured individuals aged 18-64 who initiated buprenorphine between July 2018 and December 2020 with no buprenorphine prescriptions in the previous six months. We measured buprenorphine prescription discontinuation gaps of ≥30 days within the first year of initiating treatment. We developed predictive models employing logistic regression, decision tree classifier, random forest, XGBoost, Adaboost, and random forest-XGBoost ensemble. We applied recursive feature elimination with cross-validation to reduce dimensionality and identify the most predictive features while maintaining model robustness. We focused on two distinct treatment stages: at the time of treatment initiation and one and three months after treatment initiation. We employed SHapley Additive exPlanations (SHAP) analysis that helped us explain the contributions of different features in predicting buprenorphine discontinuation. We stratified patients into risk subgroups based on their predicted likelihood of treatment discontinuation, dividing them into decile subgroups. Additionally, we used a calibration plot to analyze the reliability of the models.ResultsA total of 30,373 patients initiated buprenorphine and 14.98% (4,551) discontinued treatment. C-statistic varied between 0.56 and 0.76 for the first-stage models including patient-level demographic and clinical variables. Inclusion of proportion of days covered (PDC) measured at one-month and three-month following treatment initiation significantly increased the models’ discriminative power (C-statistics: 0.60 to 0.82). Random forest (C-statistics: 0.76, 0.79 and 0.82 with baseline predictors, one-month PDC and three-month PDC, respectively) outperformed other ML models in discriminative performance in all stages (C-statistics: 0.56 to 0.77). Most influential risk factors of discontinuation included early stage medication adherence, age, and initial days of supply.ConclusionML algorithms demonstrated a good discriminative power in identifying patients at higher risk of buprenorphine care discontinuity. The proposed framework may help healthcare providers optimize treatment strategies and deliver targeted interventions to improve buprenorphine care continuity.