Logo Lanfrica
  • Home
  • Atlas
  • Insights
  • Docs
  • Sign in

© 2026 Lanfrica. All rights reserved. All copyrights of the resources shown on the Lanfrica website belong to the original copyright holders, unless explicitly stated otherwise.

randyn-hub/kenya-climate-regression

Domain:

climateagriculture

Record type:

project
Creator:
ran
Host:
Linear regression analysis on Kenya long climate data # Kenya Climate Regression Project ## Goal & business context This project predicts Kenya's Long Rains (March–April–May) seasonal rainfall totals using historical climate data. The Long Rains season is critical for Kenya’s agriculture, water security, and food supply. Accurate seasonal forecasts can support: - Early farming & planting decisions - Drought & flood risk mitigation - Agricultural advisory & water resource planning - Policy-making & early warning systems ## Dataset This project uses Kenya climate data for 1991–2016 from openAFRICA. - Dataset: Kenya Climate Data | 1991–2016 - Source attribution: World Bank Climate Change Knowledge Portal ## Key result The best-performing model in this notebook was Polynomial Regression (degree 2) with: - Test R² = 0.645 - MAE = 18.50 mm - RMSE = 23.68 mm ## Methodology overview 1. Loaded rainfall and temperature CSV files 2. Merged them by year and month 3. Filtered the data to the MAM season (March, April, May) 4. Built seasonal and lag-based features 5. Split the data into train and test sets 6. Trained and compared several models: - Linear Regression - Polynomial Regression - Random Forest Regressor - Gradient Boosting Regressor 7. Evaluated performance using **MAE, RMSE, R²**, cross-validation, and residual analysis

Visit

github.com

Tags

climate-datadata-sciencelinear-regressionmachine-learningpython