This repository contains the complete Python source code developed for the study entitled "Predicting Petrol Prices in Zambia Using Machine Learning and Explainable Artificial Intelligence under a Regulated Cost-Plus Pricing Framework"
The code implements the complete analytical workflow presented in the manuscript, including:
Data preprocessing and cleaning
Feature engineering
Temporal train-validation-test data partitioning
Development and evaluation of Ridge Regression, Random Forest, Support Vector Regression (SVR), and Long Short-Term Memory (LSTM) models
Model performance evaluation using MAE, RMSE, R², and the Diebold–Mariano (DM) test
Explainable Artificial Intelligence (XAI) techniques including Ridge coefficient analysis, SHAP (SHapley Additive Explanations), Partial Dependence Plots (PDPs), and temporal SHAP diagnostics
Exploratory Data Analysis (EDA)
Residual diagnostics
Interactive Streamlit decision-support dashboard for petrol price prediction and model interpretation
The implementation accompanies the processed research dataset archived separately on Zenodo and is provided to promote transparency, reproducibility, and future research.
The software is intended for academic research, educational purposes, and methodological replication.