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
- 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
- Edafe Oghenegangan Emurotu, John Moyegbone, Micheal Ogochukwu Otutu, Ezekiel Uba Nwose, Epidemiology of binocular vision anomalies in children: a narrative review , African Scientific Reports: Volume 5, Issue 1, April 2026
- C. Andrew, S. W. Ngbo, L. O. Edmund, P. S. Moses, P. Y. Olekwu, A. I. Onen, Spectrophotometric and voltammetric assessment of totalflavonoid and phenolic content of Cucurbita species and theirantioxidant activity , African Scientific Reports: Volume 5, Issue 2, August 2026
- Wato Nathan Fundji, Kitenge Marie Ngoie, Kabamba Arthur Makenda, John Kabuba, Bioelectrochemical transformation of synthetic waste from the Vaal region: effects of acetic acid, sugar, and salt on biogas production and electricity generation using a microbial fuel cell , African Scientific Reports: Volume 5, Issue 2, August 2026
- 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
- Ayomide Oluwaseyi Agunloye, A Low-cost Optocoupler-Based Isolator System for IoT-Based Voltage Measurement in Low and High voltage DC Applications , African Scientific Reports: Volume 2, Issue 1, April 2023
- M. A. Aliu, A. M. Junaid, A. Ibraheem, A. Ishaq, A. Lawal, K. E. Ayeni, A. R. Lawal, L. B. Abdulrauf, Dispersive liquid-liquid microextraction/HPLC techniques for determination of oxytetracycline and doxycycline residues in beef samples: method developments and statistical analysis , African Scientific Reports: Volume 2, Issue 1, April 2023
- E. S. Okonofua, N. Kayode-Ojo, Urban Flooding Vulnerability Analysis Using Weighted Linear Method With Geospatial Information System , African Scientific Reports: Volume 2, Issue 3, December 2023
- Anthony Ugbedeojo Atumeyi, A. U. Itodo, R. Sha'Ato, R. A. Wuana, Physicochemical analysis and dissolution kinetics of Itakpe iron ore in acid, base and aqueous media , 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.