Rainfall Prediction System Using Machine Learning

Author

D. Esther, J. Steffi


Abstract

       Forecasting rain is one of the main reasons people use weather data and machine learning. Accurate rainfall forecasts help farmers plan, manage water supplies, run transportation systems, and support other weather-dependent activities. This project uses machine learning to predict if rain is coming and how much measured in centimeters. The system depends on four main weather factors: temperature, humidity, pressure, and wind speed. The dataset gets cleaned up—filling in missing bits, removing duplicates, and building the weather features we need. We evaluate classification and regression tasks using machine learning methods like Decision Tree, Random Forest, and XGBoost. Random Forest scored the highest accuracy at 82.44%. For predicting rainfall amounts, the Random Forest Regressor scored an MAE of 0.2454, RMSE of 0.6045, and an R² of 0.2693 among the best results. The system pulls in real-time weather and forecasts using the OpenWeather API, tailored to the user’s state and city. The three-day forecast is made by crunching current weather data through trained machine learning models. The results show up in a live Streamlit web app with weather cards, predictions, graphs, and forecast details. MySQL holds the prediction results for easy future reference and analysis.


Keywords

Rainfall Prediction, Machine Learning, Random Forest, Classification, Regression, OpenWeather API, Streamlit, MySQL, Weather Forecasting, Data Analysis.



Full Text:

Download Paper PDF


References


  1. Khan, M. S. Khan, M. A. Khan, S. M. Khan, and A. Ahmad, “Comparative analysis of different rainfall prediction models: A case study of Aligarh City, India,” Results in Engineering, vol. 22, art. 102093, 2024, doi: 10.1016/j.rineng.2024.102093.
  2. Y. Barrera-Animas, L. O. Oyedele, M. Bilal, T. D. Akinosho, J. M. Davila Delgado, and L. A. Akanbi, “Rainfall prediction: A comparative analysis of modern machine learning algorithms for time-series forecasting,” Machine Learning with Applications, vol. 7, art. 100204, 2022, doi: 10.1016/j.mlwa.2021.100204.
  3. A. Azeem and S. Dev, “A performance and interpretability assessment of machine learning models for rainfall prediction in the Republic of Ireland,” Decision Analytics Journal, vol. 12, art. 100515, 2024, doi: 10.1016/j.dajour.2024.100515
  4. Mishra, A. M. G. Al Khatib, S. Yadav, S. Ray, A. Lama, B. Kumari, D. Sharma, and R. Yadav, “Modeling and forecasting rainfall patterns in India: a time series analysis with XGBoost algorithm,” Environmental Earth Sciences, vol. 83, art. 163, 2024, doi: 10.1007/s12665-024-11481-w.
  5. S. Yu, T. C. Yang, S. Y. Chen, C. M. Kuo, and H. W. Tseng, “Comparison of random forests and support vector machine for real-time radar-derived rainfall forecasting,” Journal of Hydrology, vol. 552, pp. 92–104, 2017, doi: 10.1016/j.jhydrol.2017.06.020.
  6. Waghere, A. Biradar, R. Zambre, A. Golande, A. Hingmire, and V. Bhutnal, “A Flask-Integrated Machine Learning Framework for Regional Rainfall Prediction in Indian Districts,” in Smart Trends in Computing and Communications (SmartCom 2026), Lecture Notes in Networks and Systems, vol. 1995, pp. 130–140, 2026, doi: 10.1007/978-3-032-27163-1_12.
  7. Pham, L. M. Le, T.-T. Le, K.-T. T. Bui, V. M. Le, H.-B. Ly, and I. Prakash, “Development of advanced artificial intelligence models for daily rainfall prediction,” Atmospheric Research, vol. 237, art. 104845, 2020, doi: 10.1016/j.atmosres.2020.104845.
  8. Talan, “Machine learning-based rainfall prediction across temporal scales: model benchmarking and explainability analysis,” Stochastic Environmental Research and Risk Assessment, vol. 40, art. 100, 2026, doi: 10.1007/s00477-026-03245-8.
  9. Geethalakshmi, S. Kokilavani, S. P. Ramanathan, G. A. Dheebakaran, N. K. Sathyamoorthy, and N. Maragatham, “Monthly rainfall hind-cast using machine learning algorithms for Coimbatore, Tamil Nadu,” MAUSAM, vol. 73, no. 1, 2022, doi: 10.54302/mausam.v73i1.5077.
  10. Z. Teoh and Y. L. Loo, “A Fundamental Framework for Analysis of Rainfall Prediction Features Significance,” Journal of Informatics and Web Engineering, vol. 4, no. 2, pp. 36–52, 2025, doi: 10.33093/jiwe.2025.4.2.3.

 

 

Share your valuable work from Social Media Buttons