Enhancing forecast accuracy in Tangier, Morocco: A comparative analysis of regression models using meteorological data
The Mediterranean region, characterized by its unique climatic and ecological conditions, is experiencing significant impacts from climate change. Rising temperatures and altered precipitation patterns are exacerbating environmental stresses, this exploratory study aimed to investigate the potential of machine learning to improve the accuracy of temperature forecasts for Tangier, Morocco, using a comprehensive meteorological dataset from Visual Crossing, we assessed the performance of seven regression models: Decision Tree, Extra Trees, Random Forest, AdaBoost, Gradient Boosting, XGBoost, and LightGBM over a 13-year period from January 1st, 2010 to December 31st, 2022. The models were trained and validated on separate time periods after rigorous data preprocessing, which addressed missing values, outliers, extracted temporal features, and normalization. The results indicated that the Random Forest MSE = 0.0404, XGBoost MSE = 0.2515, and LightGBM MSE = 0.3708 models achieved superior accuracy, demonstrated by favourable Mean Squared Error (MSE), Mean Absolute Error (MAE) (MAE = 0.0377, MAE = 0.1484, MAE = 0.2276) respectively, and R² scores (R² = 0.9987, R² = 0.9918, R²= 0.9879). This study demonstrates that machine learning models, particularly tree-based regressors, improve temperature forecasting accuracy by capturing complex, nonlinear patterns in historical weather data. It highlights how sophisticated algorithms, such as ensemble methods and deep learning architectures, are increasingly capable of capturing complex atmospheric patterns and improving predictive performance. Additionally, it emphasizes the critical importance of meticulous data preprocessing, an essential step that involves cleaning, normalizing, and augmenting meteorological data.
Authors
- Ben Allal Laïla
- Ammari Mohammed
- EL BARRAA Ayoub
- BOUGRINE Omar
- MOUNIR Manal
- BEN HSAIEN Nezha
- EL AZHARI Hamza
Institutions
- Abdelmalek Essaâdi University (MA)
- École Nationale de Commerce et de Gestion de Tanger (MA)
Publication Details
- Journal
- Journal of Applied and Natural Science
- Published
- 2025-12-20
- DOI
- https://doi.org/10.31018/jans.v17i4.6903
- Primary Topic
- Hydrological Forecasting Using AI
- Type
- article
- Field-Weighted Citation Impact
- 0.00