The utilization of mechanical ventilation is of utmost importance in the management of individuals afflicted with severe pulmonary conditions. During periods of a pandemic, it becomes imperative to build ventilators that possess the capability to autonomously adapt parameters over the course of treatment. In order to fulfil this requirement, a research investigation was undertaken with the aim of forecasting the magnitude of pressure applied on the patient by the ventilator. The aforementioned forecast was derived from a comprehensive analysis of many variables, including the ventilator's characteristics and the patient's medical state. This analysis was conducted utilizing a sophisticated computational model referred to as Long Short-Term Memory (LSTM). To enhance the predictive accuracy of the LSTM model, the researchers utilized the Chimp Optimization method (ChoA) method. The integration of LSTM and ChoA led to the development of the LSTM-ChoA model, which successfully tackled the issue of hyperparameter selection for the LSTM model. The experimental results revealed that the LSTM-ChoA model exhibited superior performance compared to alternative optimization algorithms, namely whale grey wolf optimizer (GWO), optimization algorithm (WOA), and particle swarm optimization (PSO). Additionally, the LSTM-ChoA model outperformed regression models, including K-nearest neighbor (KNN) Regressor, Random and Forest (RF) Regressor, and Support Vector Machine (SVM) Regressor, in accurately predicting ventilator pressure. The findings indicate that the suggested predictive model, LSTM-ChoA, demonstrates a reduced mean square error (MSE) value. Specifically, when comparing ChoA with GWO, the MSE fell by around 14.8%. Furthermore, when comparing ChoA with PSO and WOA, the MSE decreased by approximately 60%. Additionally, the analysis of variance (ANOVA) findings revealed that the p-value for the LSTM-ChoA model was 0.000, which is less than the predetermined significance level of 0.05. This indicates that the results of the LSTM-ChoA model are statistically significant.