This paper aims to further enhance the understanding of forest fire risk s in Pengzhou, accurately predict the forest fire risk meteorological grades, and improve the service capability of the local meteorological department. Using hourly observation data from the Pengzhou National Basic Meteorological Station and 49 regional meteorological stations from 2014 to 2023, this paper analyzes the spatial and temporal distribution of forest fire danger in Pengzhou and predicts the forest fire risk meteorological rating based on the KNN and Random Forest algorithms. The results indicate that the forest fire risk meteorological index is significantly influenced by meteorological factors, with larger values showing no clear periodicity. Its values are positively correlated to altitude. The mountainous areas require a longer time of prevention compared to hilly areas in spring, autumn and winter. The overall trend of the prediction results by machine learning algorithm models is consistent with actual observations, with a high reliability, monthly index root mean square error < 6. 2, and average absolute error < 4. 52, which has essentially no impact on the prediction of forest fire risk meteorological rating. Among the two algorithms, the KNN algorithm performs better in mountainous areas, while the Random Forest algorithm performs better in hilly areas. This study has revealed the spatio - temporal distribution characteristics of the forest fire risk meteorological rating in Pengzhou, demonstrating the excellent effectiveness of machine learning in predicting local forest fire risk meteorological rating, and laying a scientific foundation for strengthening local meteorological service capabilities.