From a macro-perspective, based on machine learning and data-driven approach, this paper utilizes multi-featured data from 31 provinces and regions in China to build a Bayesian network (BN) analysis model for predicting air quality index and warning the air pollution risk at the city level. Further, a two-layer BN for analyzing influencing factors of various air pollutants is developed. Subsequently, the model is applied to forecast the trends of temporal and spatial changes in the form of probabilistic inference and to investigate the degree of impact incurred from individual influencing factors. From the comparisons with the results obtained from other machine learning approaches and algorithms such as neural networks, it is concluded that by comprehensively using the established BN, one can not only reach a monitoring and early warning accuracy rate of 90% but also scrutinize and diagnose the main cause of air pollution risk changes from the perspective of probability.