Background and Objective. Adenovirus pneumonia is a severe disease in children. Constructing a prognostic model contributes to individualized treatment of children with adenovirus pneumonia. Thus, a machine learning model was constructed in this study to explore the clinical and baseline characteristics of pneumonia and predict the type of pneumonia. Methods. Children with bacterial pneumonia (41 cases) and adenovirus pneumonia (179 cases) hospitalized in Tianjin Children’s Hospital from January to October 2020 were selected. The differences in baseline and clinical characteristics between children with two pneumonias, respectively, were compared via the chi-square test and Wilcox test. The Least Absolute Shrinkage and Selection Operator (LASSO) model was applied to screen the pneumonia type-related characteristics. Patients were randomly divided into the training set (n = 154) and test set (n = 66). The logistic model was constructed using the screened characteristics in the training set to predict whether the cases are bacterial pneumonia or adenovirus pneumonia. Finally, the model was validated by receiver operating characteristic (ROC) curve and area under curve (AUC) in the test set. Results. The age (
p
<
0.001
), hospital stay (
p
<
0.001
), tonsil condition (
p
<
0.001
), interleukin-6 (IL-6;
p
=
0.033
), and lactate dehydrogenase (LDH;
p
<
0.001
) between children with bacterial pneumonia and adenovirus pneumonia were significantly different. Sex, tonsil condition, age, hospital stay, r-glutamyltransferase (r-GT), and LDH levels were the factors associated with the types of pneumonia. Compared with bacterial pneumonia, children with adenovirus pneumonia were younger (OR = 0.207, 95% CI: 0.041–0.475), with longer hospital stay (OR = 7.974, 95% CI: 2.626–74.354) and higher LDH expression level (OR = 1.025, 95% CI: 1.006–1.060). 92.4% types of pneumonia were correctly predicted, and the AUC value of the model was 0.981. Conclusion. The LDH level was the associated factor to predict the types of pneumonia. Adenovirus pneumonia was associated with earlier age and longer hospital stay than bacterial pneumonia. The established model can well predict the types of pneumonia in children and provide clinical basis for guiding the individualized treatment of children.