This project applies machine learning techniques to predict agricultural trade flows between Nigeria and its trading partners, identifying key trade drivers and evaluating model performance to support data-driven trade analysis.
# 🌾 Leveraging Machine Learning for Predicting Agricultural Trade Flows
## 📌 Overview
This project applies machine learning techniques to predict agricultural trade flows between Nigeria and its trading partners. Using economic, demographic, and geographic indicators, it identifies the key drivers of trade and evaluates the performance of multiple predictive models to support data-driven trade analysis.
The project demonstrates an end-to-end machine learning workflow, from data preparation and exploratory analysis to model development, evaluation, and interpretation.
---
## 📂 Dataset
The analysis uses a comprehensive agricultural trade dataset containing economic, demographic, and geographic variables influencing bilateral trade between Nigeria and its trading partners.
### Dataset Includes
- Import and export values (USD)
- GDP of Nigeria and partner countries
- Exchange rates
- Population statistics
- Distance between trading partners
- Shared language indicators
- Landlocked status and other geographic variables
### Dataset Summary
- **Study Period:** 1996–2021
- **Country:** Nigeria and its agricultural trading partners
- **Target Variables:** Import and Export Trade Values
- **Features:** Economic, demographic, and geographic indicators
---
## 🤖 Machine Learning Models
The project compares the performance of several machine learning algorithms:
- Linear Regression
- Ridge Regression
- Lasso Regression
- Random Forest Regressor
- Gradient Boosting Regressor
- Multi-Layer Perceptron (MLP)
### Model Evaluation Metrics
- R² (Coefficient of Determination)
- Mean Squared Error (MSE)
- Root Mean Squared Error (RMSE)
---
## 📊 Results & Insights
### Best Performing Model
**Random Forest Regressor**
- **R²:** 0.75
- **MSE:** 3.61 × 10¹⁵
### Key Drivers of Agricultural Trade
- GDP of trading partners
- Population size
- Exchange rates
- Geographic distance
### Key Findings
- Ran …