BACKGROUND Hospitals are struggling in predicting, evaluating and managing various cost-affecting parameters pertaining to any given patient and their treatments. Accuracy in cost prediction is a challenge and is further affected if a patient suffers from other health issues which complicate their primary diagnosis and negatively impact prognosis. The inability to appropriately predict the cost of care can lead to an unavoidable deficit in the operational revenue of medical centers. OBJECTIVE This study aims to determine whether machine learning (ML) algorithms can predict the cost of care in patients undergoing bariatric and metabolic surgery as well as to develop and validate a predictive model for bariatric and metabolic surgery that allows for better management and optimization of cost analysis faced by hospital administration. METHODS A total of 602 patients are included in our study. This includes all patients from Wetzikon hospital that underwent bariatric and metabolic surgery from 2013-2019. Multiple variables, including patient factors, surgical factors, and post-operative complications were tested using a number of predictive modeling strategies to deliver on a tool that may be helpful for hospitals in forecasting and managing costs associated with the delivery of care. The registry data was approved by an institutional review board, where the patients’ informed consent was waived. The study was registered under Req 2022-00659. The overall cost to the hospital is defined as the sum of all the costs incurred during the stay in hospital for surgery, expressed in CHF (Swiss Francs). This data was collected from the financial administrative system of Wetzikon Hospital. After preprocessing, the cost is randomly split into two sets. 80% of the data is put into a training set to build the models and 20% is utilized for a test set to validate the models and assess their performance. Hyperparameters are tuned, and the final model is selected based on the mean absolute percentage error (MAPE). RESULTS Out of the six tested models, the results obtained based on analysis showed that the Random Forest model is the most accurate at predicting overall cost associated with bariatric and metabolic surgery. With a mean absolute percentage error of 12.7 – 26.3, we have demonstrated a model with reasonable prediction to be validated in real-world scenarios. CONCLUSIONS This model may therefore be considered by hospitals to help with financial calculations and balancing the budget, however, further research should be undertaken to improve its accuracy. This model can ultimately lead to cost-efficient operation and administration of hospitals. The proof of principle demonstrated here will lay the groundwork for an efficient ML-based prediction tool to be tested on multicenter data from a range of international centers in the subsequent phases of the study.