PurposeThis study aimed to create and validate robust machine-learning-based prediction models for antipsychotic drug (risperidone) continuation in children and teenagers suffering from mania over one year and to discover potential variables for clinical treatment.MethodThe study population was collected from the national claims database in China. A total of 4,532 patients aged 4–18 who began risperidone therapy for mania between September 2013 and October 2019 were identified. The data were randomly divided into two datasets: training (80%) and testing (20%). Five regularly used machine learning methods were employed, in addition to the SuperLearner (SL) algorithm, to develop prediction models for the continuation of atypical antipsychotic therapy. The area under the receiver operating characteristic curve (AUC) with a 95% confidence interval (CI) was utilized.ResultsIn terms of discrimination and robustness in predicting risperidone treatment continuation, the generalized linear model (GLM) performed the best (AUC: 0.823, 95% CI: 0.792–0.854, intercept near 0, slope close to 1.0). The SL model (AUC: 0.823, 95% CI: 0.791–0.853, intercept near 0, slope close to 1.0) also exhibited significant performance. Furthermore, the present findings emphasize the significance of several unique clinical and socioeconomic variables, such as the frequency of emergency room visits for nonmental health disorders.ConclusionsThe GLM and SL models provided accurate predictions regarding risperidone treatment continuation in children and adolescents with episodes of mania and hypomania. Consequently, applying prediction models in atypical antipsychotic medicine may aid in evidence-based decision-making.