A machine learning project that predicts inflation in Kenya using historical economic indicators, time series analysis, and predictive modeling in Python.
# Kenya Inflation Prediction
A machine learning project that predicts Kenya's future inflation rates using historical World Bank inflation data.
## Features
- Data preprocessing and cleaning
- Linear Regression model
- Decision Tree Regressor
- Random Forest Regressor
- Automatic model comparison
- Automatic best model selection
- Saved trained model using Joblib
- Future inflation prediction
- Data visualization with Matplotlib
## Project Structure
```
kenya-inflation-prediction/
│
├── data/
├── models/
│ └── inflation_model.pkl
├── src/
│ ├── data_loader.py
│ ├── preprocess.py
│ ├── train_model.py
│ └── predict.py
├── README.md
└── requirements.txt
```
## Installation
```bash
pip install -r requirements.txt
```
## Train the Model
```bash
py src/train_model.py
```
## Predict Inflation
```bash
py src/predict.py
```
## Models Compared
- Linear Regression
- Decision Tree Regressor
- Random Forest Regressor
The project automatically selects the model with the highest R² score and saves it for future predictions.
## Technologies Used
- Python
- NumPy
- Pandas
- Scikit-learn
- Matplotlib
- Joblib
## Author
Brian Mumbi