7. Results and Discussion
In the tuning process for the Random Forest model aimed at predicting PM2.5 levels, a structured approach was utilized to explore a well-defined grid of parameters. Specifically, the number of trees and the minimum leaf size were varied to determine the optimal configuration. The number of trees considered were from the set [50, 100, 300, 500, 600, 700], providing a range from a moderately small to a large forest size, allowing for an assessment of how model complexity influenced performance as more trees can capture more complex patterns and reduce overfitting through averaging. The minimum leaf sizes tested were [1, 3, 5, 10], which explored a spectrum from very fine-grained (potentially high variance) to more generalized leaf configurations. This range was intended to see how much detail the model needed to capture to effectively predict PM2.5 levels, balancing between underfitting and overfitting.
The best parameters obtained from this grid were 500 trees and a minimum leaf size of 1. This outcome indicates that a high level of model complexity (many trees) combined with very detailed splits (small leaf size) provided the best performance, achieving an R2 value of 0.82764. Such a result suggests that the PM2.5 levels in this dataset are influenced by complex interactions among pollutants that require a dense model to capture accurately without overfitting, despite the granularity allowed by the smallest leaf size. This approach highlights the importance of rigorous parameter tuning in building effective predictive models, especially in environmental science where interactions can be highly non-linear and influenced by numerous factors.
Achieving an R2 score of 0.827640 with a Random Forest model using 500 trees and a minimum leaf size of 1 for predicting PM2.5 levels based on seven other pollutants is a strong result. This score indicates that the model explains about 82.76% of the variance in PM2.5 levels from the predictors used, which suggests that the model is highly effective for this task.
Using 500 trees in the Random Forest contributed significantly to capturing the complex relationships and interactions among the input variables. This high number of trees helps in averaging out the biases and reducing variance, leading to a robust model.
The minimum leaf size of 1 means that the model can potentially grow very deep, allowing very detailed segmentations of the input space. While this can lead to very accurate fits to the training data, there's also a heightened risk of overfitting.
Random Forest models provide insights into which variables are most important for predicting the response. In the context of air quality, understanding which pollutants most strongly predict PM2.5 levels can inform public health advisories and pollution control policies. We further examine the feature importance scores generated by the model to prioritize which pollutants need stricter monitoring and control.
An R2 value of over 0.8 is excellent for environmental data, which often contains a lot of noise and influencing factors that are not included in the model. This high R2 value suggests that the selected features (pollutants) have a strong and consistent relationship with PM2.5 levels.
Comparing the performance of the Random Forest, Gradient Boosting Machine (GBM), and Support Vector Regression (SVR) models on predicting PM2.5 levels from seven pollutants reveals notable differences in effectiveness and suitability for this specific problem (
Figure 6). The Random Forest model, with an R
2 score of 0.82764, outperforms both the Gradient Boosting Machine, which achieved an R
2 score of 0.71755, and the Support Vector Regression, which had a much lower R
2 score of 0.47955. The superior performance of the Random Forest model suggests that its method of using ensemble learning with a large number of decision trees (500 trees in this case) and allowing them to grow deep (minLeafSize of 1) effectively captures the complex nonlinear relationships and interactions among the various pollutants more robustly than the other models.
The GBM, with its parameters of 200 trees, a learning rate of 0.05, and maximum splits of 20 per tree, also employs an ensemble strategy but constructs trees sequentially to correct previous errors, which in this scenario appears slightly less effective than the Random Forest approach. The lower performance of the SVR model, even with optimized parameters (linear kernel, BoxConstraint of 10, and Epsilon of 10), indicates that the linear kernel used may be too simplistic to model the complexities of the relationships in the data effectively. This comparison highlights the importance of selecting the right machine learning strategy and tuning the model parameters according to the specific characteristics and complexity of the data, with Random Forest providing a more flexible and powerful approach for handling this particular air quality prediction task.
The feature importance graph for the Random Forest model,
Figure 7, provides insightful data on how different pollutants contribute to predicting PM2.5 levels. Each bar represents the relative importance of each feature, indicating how much each pollutant influences the PM2.5 prediction when all variables are considered together. The prominence of NO in the model suggests a strong link between nitric oxide emissions and PM2.5 concentrations. Given that NO is primarily emitted from combustion processes, particularly from vehicles, its significant impact indicates a major source of particulate matter in the area studied. This highlights the need for strategies aimed at reducing vehicular emissions or improving combustion efficiency. Ozone's notable importance in the model may seem counterintuitive given its negative correlation with PM2.5 observed in earlier analysis. However, this importance reflects ozone's role in atmospheric chemistry, where it can react with other pollutants and potentially lead to the formation or transformation of particulate matter. This underscores the complexity of air pollution dynamics and the necessity of considering secondary pollutant formation in air quality management. Similar to NO, NO2 is closely associated with traffic and industrial emissions. Its significant feature importance supports the inference that areas with high traffic or industrial activity might experience elevated PM2.5 levels, pointing to another crucial target for environmental control measures. CO's moderate importance is indicative of its sources, typically incomplete combustion, being somewhat influential in PM2.5 dynamics. Strategies that improve combustion efficiency, promote cleaner fuel usage, or enhance vehicular emissions standards could effectively lower PM2.5 levels. The role of SO2, often a product of industrial processes, especially in areas dependent on fossil fuels, highlights industrial activities' impact on air quality. Its importance suggests that industrial emissions controls could be effective in reducing PM2.5 pollution. While meteorological factors like humidity and temperature do influence air quality, their lower relative importance in this predictive model suggests that direct pollutant emissions play a more crucial role in determining PM2.5 levels. However, these factors are still important to consider for comprehensive air quality models, especially in climate-sensitive regions.
The feature importance graph illustrates the critical role that both pollutant emissions and certain meteorological conditions play in affecting PM2.5 levels. The dominance of NO, O3, and NO2, in particular, emphasizes the need for targeted air quality control measures that address both vehicular and industrial emissions. Understanding these relationships helps in crafting more effective environmental policies and interventions that can significantly improve air quality and public health outcomes. Moreover, this analysis supports ongoing efforts to refine predictive models for air quality, ensuring they are robust and capable of informing real-time and proactive air quality management strategies.
Figure 8 displays the impact of the number of trees (`numTrees`) on the performance of a Random Forest model across different settings for the minimum leaf size (`minLeafSize`). Each graph presents the trend of R
2 scores as the number of trees in the model increases, grouped by four different minimum leaf size settings: 1, 3, 5, and 10.
The
Figure 8 demonstrate a clear trend where models with smaller minimum leaf sizes start with higher R
2 scores and show significant improvement as the number of trees increases.
For practical implementation, the choice between `minLeafSize` and `numTrees` will depend on computational resources and the specific characteristics of the data. Smaller `minLeafSize` and higher `numTrees` typically yield better performance but at a computational cost. If computational resources are not a constraint, models with `minLeafSize = 1` and a high number of trees (around 500) are likely to perform best, as indicated by the highest R2 scores across all graphs.
This analysis provides critical insights into how Random Forest hyperparameters were tuned to balance model accuracy with computational efficiency, considering both the complexity of the model and the nature of the data being analyzed.
The histogram of residuals from
Figure 9 provides a distribution of the errors between the predicted and actual values from the Random Forest model, aimed at predicting PM2.5 levels. The residuals are skewed to the right, indicating that the model tends to underpredict PM2.5 levels more frequently than overpredict. Most residuals cluster around 0, suggesting that the model's predictions are generally accurate, but there are notable instances where the model predictions deviate significantly from the actual values, as seen in the long tail towards higher positive values. This skewness and the presence of large residuals could imply that while the model is effective for typical scenarios, it struggles with accurately predicting higher levels of PM2.5, possibly during unusual pollution events or under specific environmental conditions not well-represented in the training data. Addressing this might require refining the model further, perhaps by incorporating more data points under extreme conditions or adjusting the model's sensitivity to outliers.