question: Background Machine learning can assist clinicians in forecasting patients with COVID-19 who develop respiratory failure requiring mechanical ventilation. This analysis aimed to determine a 48 hours prediction of moderate to severe respiratory failure, as assessed with PaO2/FiO2 < 150 mmHg, in hospitalized patients with COVID-19 pneumonia. Methods This was an observational study that comprised all consecutive adult patients with COVID-19 pneumonia admitted to the Infectious Diseases Clinic of the University Hospital of Modena, Italy from 21 February to 6 April 2020. COVID-19 was confirmed with PCR positive nasopharyngeal swabs while the presence of pneumonia was radiologically confirmed. Patients received standard of care according to national guidelines for clinical management of SARS-CoV-2 infection. The patients' full medical history, demographic and epidemiological features, clinical data, complete blood count, coagulation, inflammatory and biochemical markers were routinely collected and aggregated in a clinically-oriented logical framework in order to build different datasets. The dataset was used to train a learning framework relying on Microsoft LightGBM and leveraging a hybrid approach, where clinical expertise is applied alongside a data-driven analysis. Shapley Additive exPlanations (SHAP) values were used to quantify the positive or negative impact of each variable included in the model on the predicted outcome. The study outcome was the onset of moderate to severe respiratory failure defined as PaO2/FiO2 ratio < 150 mmHg ([≥] 13.3 kPa) in at least one of two consecutive arterial blood gas analyses in the following 48 hours. Results A total of 198 patients contributed to generate 1068 valuable observations which allowed to build 3 prediction models based respectively on 31-variables signs and symptoms, 39-variables laboratory biomarkers and 91-variables as a composition of the two. A fourth boosted mixed model which included 20 variables was selected from the model 3, achieved the best predictive performance (AUC=0.84). Its clinical performance was applied in a narrative case report as an example. Conclusion This study developed a machine learning algorithm, with a 84% prediction accuracy, which is potentially able to assist clinicians in decision making process with therapeutic implications.