Authors: Maureen Nechesa Murambi, Daniel Khaoya Muyobo, Richard Rono
Abstract: Traditional meteorological models often face challenges in processing large volumes of real-time data and capturing complex nonlinear atmospheric relationships. Recent advances in Machine Learning (ML) have provided powerful tools for analysing weather patterns and improving forecasting accuracy. The paper discusses relevant literature on machine learning algorithms suitable for weather pattern analysis, identifies research gaps and proposes future research directions involving deep learning and hybrid forecasting systems. This paper presents an integrated Internet of Things (IoT) and Machine Learning (ML) model for analysing weather patterns in Bungoma County, Kenya. Historical weather data (2006–2025) from the Nzoia Sugar Factory Weather Station and simulated real-time IoT sensor observations were analysed using Random Forest (RF) and K-Nearest Neighbours (KNN). Data preprocessing included outlier detection using the IQR method, polynomial interpolation for missing values, Min-Max normalization, and feature engineering. The model was trained and evaluated with an Infinite Random Search hyperparameter optimiser (578 configurations, 3-hour window). Performance was assessed using Mean Absolute Error (MAE), Root Mean Squared Error (RMSE), and the Coefficient of Determination (R²).. The overall average R² across all predicted weather targets was 0.495, with relative humidity at 15:00 achieving R² = 0.836 and maximum temperature achieving R² = 0.629. Comparative evaluation showed that RF consistently outperformed KNN in predictive accuracy, demonstrating the suitability of ensemble learning for nonlinear meteorological datasets. The integration of IoT enabled continuous monitoring and improved decision support for agriculture and disaster preparedness. These findings contribute to the growing body of knowledge on ML applications in meteorology and provide a foundation for developing localized weather forecasting systems in regions with similar climatic conditions.