Skip to content

Diparna/Sales_Forecasting

Repository files navigation

Retail Analytics Suite

Table of Contents

  1. Project Overview
  2. Data Sources
  3. Features
  4. Modeling Approach
  5. Installation & Setup
  6. Usage Guide
  7. Real-World Applications
  8. Educational Applications
  9. App Breakdown

Project Overview

The Retail Analytics Suite is a comprehensive data analysis and visualization platform that combines sales data from multiple retail sources to provide actionable insights and predictive analytics. The application analyzes Walmart sales data, Amazon sales data, and Amazon customer sentiment data to deliver a holistic view of retail performance and customer satisfaction.

Data Sources

Walmart Sales Data

  • Source: Walmart store sales records
  • Period: 2020-2021
  • Format: CSV
  • Update Frequency: Weekly
  • Key Metrics: Weekly sales, store information, and economic indicators
  • Link: Walmart Dataset on Kaggle

Amazon Sales Data FY2020-21

  • Source: Amazon sales records
  • Period: 2020-2021 fiscal year
  • Format: CSV
  • Update Frequency: Daily
  • Key Metrics: Order details, product information, and pricing data
  • Link: Amazon Sales Dataset on Kaggle

Amazon Customer Reviews

  • Source: Amazon customer feedback
  • Period: 2020-2021
  • Format: CSV
  • Update Frequency: Daily
  • Key Metrics: Review content, ratings, and customer sentiment
  • Link: Amazon Reviews Dataset on Kaggle

Features

  1. Sales Analysis

    • Time series visualization
    • Seasonal trend analysis
    • Store performance comparison
    • Revenue forecasting
  2. Customer Sentiment Analysis

    • Review sentiment scoring
    • Word cloud visualization
    • Category-wise sentiment analysis
    • Trend analysis of customer satisfaction
  3. Price Analytics

    • Price distribution analysis
    • Discount impact assessment
    • Category-wise pricing strategies
    • Competitive pricing analysis
  4. Interactive Dashboards

    • Dynamic filtering
    • Real-time calculations
    • Custom date range selection
    • Multiple visualization options

Modeling Approach

Sales Forecasting Models

Prophet Model

  • Purpose: Long-term sales forecasting with seasonal decomposition
  • Implementation:
    • Multiplicative seasonality model
    • Yearly, weekly, and daily seasonality components
    • Holiday effects incorporation
    • Automatic changepoint detection

Advantages:

  • Handles missing data effectively
  • Captures multiple seasonality patterns
  • Robust to outliers
  • Automatic trend changepoint detection

SARIMA Model

  • Purpose: Short to medium-term sales forecasting
  • Implementation:
    • Order selection: (1,1,1) for trend
    • Seasonal order: (1,1,1,7) for weekly patterns
    • Rolling validation approach

Advantages:

  • Captures both trend and seasonality
  • Provides confidence intervals
  • Strong statistical foundation
  • Good for short-term predictions

Random Forest Regressor

  • Purpose: Feature-based sales prediction
  • Implementation:
    • 200 trees with max depth of 15
    • Minimum samples split: 5
    • Minimum samples leaf: 2

Advantages:

  • Handles non-linear relationships
  • Feature importance ranking
  • Robust to outliers
  • Good for complex pattern recognition

Sentiment Analysis Model

NLTK Sentiment Analyzer

  • Purpose: Customer review sentiment scoring
  • Implementation:
    • VADER sentiment scoring
    • Custom text preprocessing
    • Weighted sentence analysis

Advantages:

  • Specifically tuned for social media text
  • Handles emoji and punctuation
  • Multiple sentiment dimensions

Installation & Setup

# Clone the repository
git clone 'https://github.com/Diparna/Sales_Forecasting/'

# Install required packages
pip install -r requirements.txt

# Run the Streamlit app
streamlit run app.py

Usage Guide

Data Upload

  • Format Requirements: Specify CSV format
  • Supported File Types: CSV files only

Making Predictions

  • Step-by-step guide for selecting data and running models
  • Input parameters explanation

Interpreting Results

  • Understanding the visualizations
  • Reading the forecasts

Real-World Applications

Retail and E-Commerce

  • Predict demand for products to optimize inventory and avoid stockouts or overstocking
  • Plan promotional campaigns based on forecasted sales trends

Supply Chain Management

  • Anticipate demand spikes to adjust production schedules and logistics planning
  • Improve supplier relations by sharing accurate demand forecasts

Finance and Budgeting

  • Help businesses allocate budgets effectively by forecasting revenue streams
  • Aid in financial planning for startups or small businesses

Hospitality and Tourism

  • Predict seasonal trends in bookings, helping with staff planning and resource allocation
  • Forecast customer preferences for targeted marketing

Food and Beverage Industry

  • Assist restaurants and cafes in purchasing raw materials by forecasting sales volumes
  • Predict trends in customer dining habits for menu optimization

Manufacturing

  • Plan production schedules based on sales forecasting to reduce waste
  • Align resources with expected demand for better cost management

Educational Applications

Teaching Data Science Concepts

  • Demonstrate time-series analysis, ARIMA models, and machine learning applications in forecasting
  • Visualize the impact of data preprocessing and model selection on predictive accuracy

Interactive Learning for Students

  • Allow students to upload their datasets to practice forecasting in real-world scenarios
  • Provide hands-on experience with sales datasets for project-based learning

Museum or Science Fair Exhibits

  • Illustrate the power of predictive analytics in a simple, user-friendly manner
  • Engage visitors by allowing them to tweak parameters and see how forecasts change

Business School Case Studies

  • Use the app as a sandbox environment for students to explore retail analytics
  • Simulate scenarios to teach resource allocation based on demand predictions

Coding Workshops

  • Serve as a tool for teaching Streamlit, Python, and data visualization techniques
  • Show how to integrate data science with app development to build impactful tools

App Breakdown

Home Page

  • Default landing page with an overview of the three main analyses

Walmart Sales Analysis Pages:

  1. Store Timeline
  2. Sales Forecasting
  3. Original Dataset Overview
  4. Engineered Features Overview
  5. Feature Distribution
  6. Correlation Analysis
  7. Seasonal Sales Analysis
  8. ARIMA Forecasting
  9. Summary

Amazon Sales Prediction Pages:

  1. Sales Prediction
  2. IDA (Initial Data Assessment)
  3. Data Transformation
  4. Product Overview
  5. Pricing Analysis
  6. Rating Analysis

Amazon Sentiment Analysis Pages:

  1. Product Recommendations
  2. Sentiment Distribution Tab:
    • Distribution analysis
    • Summary statistics
  3. Detailed Analysis Tab:
    • Sentiment score distribution
  4. Rating Analysis Tab:
    • Sentiment vs rating visualization
    • Correlation metrics
  5. Word Clouds Tab:
    • Word clouds for positive, neutral, and negative reviews

About

Sales forecasting app for sales data, sentiment analysis using the reviews and timeline forecasting!

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages