Weather Forecasting Using a PCA-Based Optimized Random Forest Classification Technique
Abstract
Accurate weather prediction is essential for agriculture, aviation, transportation and disaster management, yet conventional statistical and physics-based forecasting models struggle to capture the non-linear and highly correlated relationships that exist among meteorological variables such as temperature, humidity, wind speed and atmospheric pressure. This paper reports an experimental study of a classification-based weather forecasting system built around a Principal Component Analysis–optimized Random Forest (PCA-ORF) model. The raw meteorological records are first normalized and cleaned, after which Principal Component Analysis (PCA) is used to compress the correlated input attributes into a smaller set of uncorrelated components. These components are then supplied to an optimized Random Forest classifier, whose hyperparameters are tuned through cross-validation, to predict the precipitation category. The model is trained and evaluated on the publicly available "Weather in Szeged 2006–2016" dataset comprising 96,453 hourly observations across twelve attributes. PCA-ORF model reaches 99.67% accuracy (a 0.33% error rate), 100% precision, 88.84% recall and an F1 value of 94.09%, outperforming a previously reported ensemble-based forecasting approach that achieved 95.00% accuracy and a 5.00% error rate on a comparable task. The results confirm that combining PCA-based dimensionality reduction with an optimized Random Forest classifier yields a forecasting model that is markedly more accurate and reliable than the conventional ensemble baseline.