Skip to content

BhaveshBhakta/Walmart-Sales-Prediction-Using-ML

Folders and files

NameName
Last commit message
Last commit date

Latest commit

545c1ad · Jan 14, 2025

History

3 Commits
Jan 14, 2025
Dec 26, 2024
Dec 26, 2024

Repository files navigation

Walmart-Sales-Prediction

Project Overview

This project is focused on predicting Walmart weekly sales based on several factors such as temperature, fuel price, CPI (Consumer Price Index), and unemployment rate, with the goal of aiding Walmart and other retail organizations in inventory planning, sales forecasting, and market analysis. The dataset used in this project contains sales data over several weeks, for various stores, along with external factors like holidays, weather conditions, and economic indicators.

Technical Highlights

  • Data Loading: The dataset is loaded using Pandas from a CSV file, containing 6,435 entries and 8 columns, including features like weekly sales, temperature, fuel price, and unemployment rate.
  • Data Preprocessing: The dataset undergoes several preprocessing steps including date parsing, feature engineering (extracting month and year from the Date), and scaling using MinMaxScaler.
  • Exploratory Data Analysis (EDA): Visualizations such as line plots, scatter plots, heatmaps, and histograms are created to analyze the relationships between variables and trends over time.
  • Model Training: A variety of regression models, including Linear Regression, Ridge Regression, XGBoost, Random Forest, AdaBoost, Gradient Boosting, and Bagging, are used to predict weekly sales.
  • Evaluation: The models are evaluated using R2 score and Mean Squared Error (MSE), with XGBoost achieving the highest R2 score of 0.96.

Purpose and Applications

  • Retail Sales Forecasting: By predicting sales trends based on external factors, businesses can optimize inventory management, reduce stockouts, and improve customer satisfaction.
  • Economic Analysis: Understanding the impact of economic indicators such as CPI and unemployment on retail sales can help companies adjust pricing strategies and promotions.
  • Holiday and Seasonal Planning: Accurate sales predictions during holidays and peak seasons can support better staffing and promotional efforts.

Installation

To run this project locally, follow these steps:

  1. Clone the repository:

    git clone https://github.com/BhaveshBhakta/Walmart-Sales-Prediction-Using-ML.git
    cd Walmart-Sales-Prediction-Using-ML
  2. Run the Jupyter notebook:

Collaboration

Contributions are welcome! Feel free to fork the repository, make improvements, and submit a pull request.