The study analyzed data from 582 hospitalized children aged 1 month to 5 years with community-acquired pneumonia from January 2022 to June 2025, where an unfavorable prognosis (hospitalization >7 days, ICU admission, or death) affected 20.8% (121 children). Patients were divided into training (407) and validation (175) sets, XGBoost, Random Forest and logistic regression models were used. The XGBoost model was the best with an AUC of 0.84 (95% CI: 0.78-0.90), accuracy of 81.1%, sensitivity of 78.6% and specificity of 82.3%. The main predictors were procalcitonin (PCT), C-reactive protein (CRP), respiratory rate, age <6 months, and oxygen saturation; PCT >2 ng/ml (OR=3.95) and CRP >40 mg/l (OR=3.52) significantly increased the risk. Etiology was known in 58.8% of cases (viral 58.5%, bacterial 32.2%, mixed 9.3%, including 12 COVID-19). The model provides a tool for risk stratification and personalized management.