Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

22 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Sales Forecasting Description

Overview

The Sales Forecasting Description project is part of the Self-Paced Elevvo Machine Learning Internship Level 3.

This project focuses on analyzing and predicting sales trends using Walmart’s historical retail data. Sales forecasting is essential in retail for inventory management, staffing, financial planning, and demand prediction. By leveraging machine learning techniques, the project demonstrates how data-driven models can improve decision-making and optimize resources.

The workflow includes data preprocessing, feature engineering, exploratory data analysis (EDA), and implementation of advanced models such as XGBoost and LightGBM, with performance comparisons across different feature selection strategies.


Table of Contents


Features

  • Data preprocessing and cleaning
  • Feature engineering and selection (manual, k-best, recursive feature elimination (RFE), full set)
  • Exploratory data analysis (EDA) with Jupyter Notebook & interactive HTML export
  • Implementation and comparison of XGBoost and LightGBM models
  • Evaluation using , RMSE, and R² drop (to check generalization and overfitting)
  • Visualization of sales trends and model performance

Technologies Used

  • Python
  • Jupyter Notebook
  • ydata-profiling
  • Pandas, NumPy
  • Scikit-learn
  • Matplotlib, Seaborn
  • XGBoost, LightGBM

Usage

  1. Open Jupyter Notebook:

    jupyter notebook
  2. Run the notebooks in order:

    • Data Analysis & Visualization.ipynb → Perform EDA and visualize sales trends
    • Data Preprocessing & Feature Engineering.ipynb → Prepare and clean the dataset
    • Feature Selection & Model Development.ipynb → Apply feature selection, train models, and compare results
  3. Alternatively, explore SalesForecastingDescriptionEDA.html for a static, interactive version of the EDA results.


Data Sources

Dataset: Walmart Sales Forecasting Dataset (Kaggle)

Raw data files include:

  • features.csv → Economic & seasonal features (CPI, unemployment, fuel price, etc.)
  • stores.csv → Store metadata
  • train.csv → Training dataset with historical weekly sales
  • test.csv → Test dataset for evaluation and prediction

Project Structure

Sales-Forecasting-Description/
│
├── Data/
│   ├── Raw Data/
│   │   ├── features.csv
│   │   ├── stores.csv
│   │   ├── train.csv
│   │   └── test.csv
│
├── Predictions/
│   ├── Weekly_Sales_Prediction.xlsx   # Model output predictions
│
├── Notebooks/
│   ├── Data Analysis & Visualization.ipynb
│   ├── Data Preprocessing & Feature Engineering.ipynb
│   ├── Feature Selection & Model Development.ipynb
│
├── SalesForecastingDescriptionEDA.html
└── README.md

Results & Visualizations

LightGBM – Actual vs Predicted

LightGBM Predictions

XGBoost – Actual vs Predicted

XGBoost Predictions

Model Comparison – Validation R²

Validation R²

Model Comparison – Validation RMSE

Validation RMSE

Model Comparison Summary

Feature Set XGB Val R² LGBM Val R² XGB Val RMSE LGBM Val RMSE XGB R² Drop LGBM R² Drop
Manual 0.9301 0.9597 5804.13 4406.48 -0.0085 0.0077
K-best 0.9217 0.9362 6139.64 5544.41 -0.0262 0.0015
RFE 0.9170 0.9567 6321.51 4568.02 -0.0144 0.0065
All 0.9309 0.9603 5769.54 4371.43 -0.0107 0.0088

Key Insights:

  • LightGBM consistently outperforms XGBoost across all feature sets.
  • Manual and All feature sets yield the best results.
  • Small R² drop values → Both models generalize well with only minor overfitting.

About

Elevvo Machine Learning Internship Level 3 Project

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages