Predicting 24-hour peak and average intraocular pressure (IOP) is essential for the diagnosis and management of glaucoma. This study aimed to develop and assess a machine learning model for predicting 24-hour peak and average IOP, leveraging advanced techniques to enhance prediction accuracy. We also aimed to identify relevant features and provide insights into the prediction results to better inform clinical practice. In this retrospective study, electronic medical records from January 2014 to May 2024 were analyzed, incorporating 24-hour IOP monitoring data and patient characteristics. Predictive models based on five machine learning algorithms were trained and evaluated. Five time points (10:00 AM, 12:00 PM, 2:00 PM, 4:00 PM, and 6:00 PM) were tested to optimize prediction accuracy using their combinations. The model with the highest performance was selected, and feature importance was assessed using Shapley Additive Explanations. This study included data from 517 patients (1,034 eyes). For predicting 24-hour peak IOP, the Random Forest Regression (RFR) model utilizing IOP values at 10:00 AM, 12:00 PM, 2:00 PM, and 4:00 PM achieved optimal performance: MSE 5.248, RMSE 2.291, MAE 1.694, and R2 0.823. For predicting 24-hour average IOP, the RFR model using IOP values at 10:00 AM, 12:00 PM, 4:00 PM, and 6:00 PM performed best: MSE 1.374, RMSE 1.172, MAE 0.869, and R2 0.918. The study developed machine learning models that predict 24-hour peak and average IOP. Specific time point combinations and the RFR algorithm were identified, which improved the accuracy of predicting 24-hour peak and average intraocular pressure. These findings provide the potential for more effective management and treatment strategies for glaucoma patients.