BACKGROUND: Mental disorders are increasingly prevalent, leading to increased medical expenditures. To refine the reimbursement of medical costs for inpatients with mental disorders by health insurance, an accurate prediction model is essential. Per-diem payment is a common internationally implemented payment method for medical insurance of inpatients with mental disorders, necessitating the exploration of advanced machine learning methods for predicting the average daily hospitalization costs (ADHC) based on the characteristics of inpatients with mental disorders. METHODS: We used data including demographic information, clinical/functional characteristics, institutional features, and cost information of 5070 hospitalized patients with mental disorders in Jinhua, China, and employed six algorithms to predict ADHC. Performance of these six algorithms was evaluated through 5- old cross-validation combined with bootstrap method to select the most suitable algorithm and identify key factors influencing ADHC. RESULTS: The random forest (RF) model demonstrated better performance (R-squared (R CONCLUSIONS: Machine learning algorithms, particularly RF algorithm, enhance accuracy of predicting ADHC for mental health patients. The findings of this study provide evidence for setting up more reasonable insurance payment standards for inpatients with mental disorders and support resource allocation in clinical practice.