# Forecasting Nigeria's Inflation: A Machine Learning Approach to Economic Insights
## Table of Contents
- Projecct overview
- Dataset
- Tools Used
- Libraries
- Methodology
- Exploratory Data Analysis (EDA)
- Modeling
- Evaluation
- Key Findings of the Project
## Project Overview
This project aims to forecast inflation rates in Nigeria using machine learning techniques and historical economic data. We analyze the relationships between various economic indicators such as crude oil prices, CPI (Consumer Price Index) categories, and inflation rates. The goal is to develop a predictive model that provides actionable insights for economic policymakers and businesses operating in Nigeria.
---
## Dataset
The dataset consists of monthly economic data from Nigeria, with features like:
- **Inflation Rate** (target variable)
- **Crude Oil Price**
- **CPI categories**: Food, Energy, Health, Transport, Communication, and Education
- **Oil Production and Exports**
The dataset contains 198 entries and 12 columns, This specific dataset can be found on Kaggle
## Tools Used
This project leverages the following tools for data analysis and visualization:
Programming Language: Python 3
### Libraries:
1. ### Data Handling and Manipulation
- pandas
- NumPy
2.### Data Visualization
- Matplotlib
- Seaborn
3.### Machine Learning
- sci-kit-learn
- 4. ### Model Interpretability:
SHAP (Shapley Additive exPlanations)
6. ### Other
IPython and Jupyter
# Methodology
## Data Preprocessing
### 1. Loading the Data
```python
import pandas as pd
# Load the dataset
df = pd.read_csv('path_to_dataset.csv')
# Preview the data
df.head()
```
### 2. Handling Missing Values and Outliers
- Missing values are imputed with the mean or median for continuous variables.
- Outliers are removed using the Z-score method.
```python
# Filling missing values with median
df.fillna(df.median(), inplace=True)
# Removing outliers using Z-score
from scipy import stats
df_no_outliers = df[(np.abs(stats.zsco …