Food Price Prediction and Visualization Using Python & Power BI
By Muheto Hodal | 29049
Introduction: Revolutionizing Food Price Prediction
Our objective is to predict food prices in Rwanda to enable better decision-making for stakeholders, from farmers to consumers. This project establishes a complete data pipeline, transforming raw data into interactive dashboards. We leverage Python for data processing and predictive modeling, specifically with Jupyter Notebooks and the Prophet library, and Power BI for dynamic visualization.
Clear Objectives
Predict food prices in Rwanda for informed decisions.
Full Data Pipeline
From data acquisition to interactive dashboards.
Core Technologies
Python (Jupyter, Prophet) and Power BI.
Step 1: Data Acquisition from WFP
The foundational step involved acquiring a comprehensive dataset from the World Food Programme (WFP). This vital resource provides historical food price records, crucial for building an accurate prediction model.
  • Source: World Food Programme (WFP)
  • Format: CSV with multiple fields
  • Size: 200,000+ records spanning several years
  • Location: Stored in the /data directory
Step 2: Data Cleaning and Preparation
Raw data often contains inconsistencies. Our cleaning process ensures data quality and prepares it for analysis, removing null values and standardizing formats.
Key Cleaning Steps: From Raw to Ready

Handling Missing & Inconsistent Data

Identified and dropped rows with null or irrelevant values in key columns (e.g., price, commodity, date). Unified column naming (e.g., province, district, market) for consistency. Removed duplicates to ensure data quality.

Standardizing Formats

Converted date fields to datetime objects for time-series operations. Normalized price to numeric format, fixing any non-numeric entries. Standardized text columns (e.g., title-cased commodity, province names).

Filtering for Relevance

Kept only necessary columns for analysis and prediction. Filtered for valid price ranges to exclude outliers. Created a cleaned dataset ready for modeling and Power BI integration.

Step 3: Data Visualization & EDA
Exploratory Data Analysis (EDA) and visualization revealed key trends and patterns in food prices across Rwanda. This step uses Python libraries like Matplotlib and Seaborn to visualize time-series data.
This line chart illustrates the historical maize price trends in Rwanda, highlighting seasonal fluctuations and overall price increases, critical for prediction modeling.
Step 4: Price Prediction with Facebook Prophet
For accurate time-series forecasting, we utilized Facebook Prophet, a robust model known for handling seasonality and trends effectively.
Model Selection
Leveraged Facebook Prophet, ideal for time-series data with strong seasonality.
Individual Models
Trained separate Prophet models for each commodity to capture specific patterns.
Future Price Prediction
Predicted future price values, capturing trends and cyclical changes.
Output Storage
Results saved in all_commodity_predictions.csv.
Script: 2_train_model_to_predict_all_commodities.py
Sample Prediction Output
The prediction model generates a clear, structured output, providing future food price estimates essential for downstream visualizations in Power BI.
This structured format ensures seamless integration with Power BI for interactive dashboard creation.
Step 5: Power BI Visualization
Power BI transforms our predicted data into intuitive, interactive dashboards. This allows users to explore market and commodity trends with ease.
The interactive dashboard facilitates deep dives into specific market dynamics or commodity price fluctuations, empowering data-driven decisions.
  • Loaded: Prediction data into Power BI
  • Features: Interactive filters by market, commodity, and date
  • Visuals: Trend lines for each commodity
  • File: MuhetoHodal_Powerbi_Exam_Report.pbix
Project Folder Structure
A well-organized project structure ensures clarity and reproducibility, making it easy to navigate through various stages of the food price prediction pipeline.
This systematic organization underpins professional documentation and facilitates collaborative development and future enhancements.
Key Milestones
Our project successfully achieved critical milestones, establishing a robust and reproducible workflow for food price prediction.
100%
Acquired and cleaned real-world data
100%
Built automated models for commodity-level prediction
100%
Integrated Python output with Power BI
100%
Maintained professional documentation via GitHub
Submission Summary & Concluding Remarks
Key Deliverables
  • GitHub Repository
  • Features a structured folder organization
  • Includes a well-documented README file
  • Presents a full Jupyter Notebook workflow
  • Contains all prediction scripts and output files
  • Python Project Scope
  • Comprehensive data cleaning and processing
  • Robust time-series modeling using Facebook Prophet
  • Essential visualizations created with Matplotlib & Seaborn
  • Exported prediction results to a .csv file
  • Power BI Report
  • Interactive dashboard with comprehensive filters
  • Built upon the model's prediction output
  • File: MuhetoHodal_PowerBI_Exam_Report.pbix
  • Dataset Source
  • Data sourced from the World Food Programme (WFP)
  • Cleaned dataset available in the /data/cleaned directory
Made with