Neonatal mortality is an important public health problem that reflects the development of a country, as well as the quality of care provided to the newborn. This article presents the development and comparison of classical models and machine learning models for time series forecasting, applied to the forecast of monthly neonatal mortality rates in the metropolitan region of Paraiba River Valley and North Coast - Sao Paulo State - Brazil. The database used comprised the monthly rates from January 2000 to December 2020. The models compared were Seasonal Autoregressive Integrated Moving Average, random forest, support vector machine (SVM), light gradient boosting machine, categorical boosting (CatBoost), gradient boosting (GB), extreme gradient boosting, and multilayer perceptron. The best parameters and hyperparameters of the models tested were adjusted through an exhaustive computational search. The results showed that the CatBoost, SVM, and GB models presented the lowest values in the error metrics evaluated, and the SVM model presented better precision. The forecasts of the SVM model showed a behavior very close to the actual rates, which was confirmed by the application of the paired t-test. These results corroborate that time series forecasting models can significantly contribute as a decision support tool for public health problems.