Daily rainfall prediction in Lagos using logistic regression, random forest, and support vector machine with web development
Keywords:
Rainfall prediction, Machine learning, Random forest, Logistic regression, Support vector machineAbstract
Accurate rainfall prediction is critical for agricultural planning, flood-risk management, and urban infrastructure resilience, particularly in tropical coastal cities such as Lagos, Nigeria, where unpredictable rainfall events cause significant socioeconomic disruption. This study evaluates three machine learning (ML) classification models---logistic regression (LR), random forest (RF), and support vector machine (SVM)---for daily binary rainfall prediction using a 22-year meteorological dataset of 8,314 observations sourced from Visual Crossing. Two features were engineered from the raw data: daily temperature range and a seasonal indicator. To address the asymmetric cost of false negatives in a tropical rainfall context, Youden's J statistic was applied to optimise the decision threshold of each model, prioritising sensitivity over the conventional 0.5 default. RF achieved the strongest overall performance, recording an accuracy of 76.28%, sensitivity of 79.27%, F1-score of 76.44%, and area under the receiver operating characteristic curve (AUC-ROC) of 0.8454, outperforming SVM (AUC-ROC: 0.8215) and LR (AUC-ROC: 0.8001). Humidity, cloud cover, dew point, and visibility emerged as the most consistent predictors across models, while moon phase and wind speed showed negligible importance in all three classifiers. All three trained models were deployed in an interactive R Shiny web application, enabling non-technical users, including farmers, planners, and policymakers, to obtain real-time rainfall predictions from meteorological inputs. This study provides an end-to-end rainfall prediction pipeline tailored to the Lagos environment and demonstrates the practical value of coupling ML with accessible deployment frameworks for climate decision-making in developing countries.
Published
How to Cite
Issue
Section
Copyright (c) 2026 Oladimeji Lukman Abiola, Oke Samuel Abayomi, Akinade Oludayo Olugbenga, Oguntola Toyin Omoyeni, Adebayo Azeez Ademola

This work is licensed under a Creative Commons Attribution 4.0 International License.
How to Cite
Similar Articles
- Taiwo Stephen Fayose, Kayode Ayinde, Olatayo Olusegun Alabi, M Robust Weighted Ridge Estimator in Linear Regression Model , African Scientific Reports: Volume 2, Issue 2, August 2023
- Abayomi Ajayi, Olaniyi Olayiwola, Fadeke Apantaku, Idowu Osinuga, Oluwaseun Wale-Orojo, Predicting the needs of people living with a disability using the two-level logit-skewed exponential power model , African Scientific Reports: Volume 3, Issue 2, August 2024
- Aloysius N. Ezaka, Henry O. Adagba, Sunday N. Aloke, Louis O. Omenyi, Theresa E. Efor, Okorie Nwite, Chika Agha, Perturbation and bifurcation analysis of a primary-secondary dengue infection transmission model with explicit vector dynamics and optimal control , African Scientific Reports: Volume 5, Issue 2, August 2026
- Taiwo J. Adejumo, Kayode Ayinde, Abayomi A. Akomolafe, Olusola S. Makinde, Adegoke S. Ajiboye, Robust-M new two-parameter estimator for linear regression models: Simulations and applications , African Scientific Reports: Volume 2, Issue 3, December 2023
- Louis Tersoo Abiem, Tertsea Igbawua, Jacob Tersugh Adawa, Investigation of direct normal irradiance and total cloud cover connection over Nigeria using satellite data , African Scientific Reports: Volume 4, Issue 3, December 2025
- RETRACTION NOTICE: Transformative approach in Lassa fever diagnostics: an innovative integrative strategy for early detection and outcome prediction , African Scientific Reports: Volume 5, Issue 1, April 2026
- Ignatius Nwoyibe Ogbaga, Henry Friday Nweke, Juliana Ngozi Ndunagu, Deploying persuasive technology-based model in the prevention and control of malaria in Nigeria to reduce incidence of deaths , African Scientific Reports: Volume 2, Issue 3, December 2023
- Hassan Ibrahim, Deborah Abolape Akwu, Reza Sharafdini, On topological indices and QSPR analysis of some drugs used for treating Coronavirus patients , African Scientific Reports: Volume 3, Issue 2, August 2024
- Ahmad M. Shuaibu, Kizito O. Musa, Ijioma M. Okiyi, Groundwater recharge modelling using SWAT analysis for groundwater reserve quantification of Ka watershed catchment area part of Sokoto-Rima Basin, North West Nigeria , African Scientific Reports: Volume 4, Issue 1, April 2025
- Surajo Muhammed Gwio, Ibrahim Ayuba, Umar Faruk Aminua, Development of 3D flow diagnostic numerical simulator and rock property modelling for a homogeneous faulted reservoir , African Scientific Reports: Volume 3, Issue 1, April 2024
You may also start an advanced similarity search for this article.