Coder Social home page Coder Social logo

shahrukh2016 / retail_sales_prediction Goto Github PK

View Code? Open in Web Editor NEW
4.0 2.0 0.0 114.15 MB

Revolutionize sales forecasting for Rossmann stores with our high-accuracy XGBoost model, leveraging data analysis, feature engineering, and machine learning to predict sales up to six weeks in advance.

Home Page: https://linktr.ee/shahrukh2016

Jupyter Notebook 100.00%
data-analysis data-cleaning data-gathering data-preprocessing decision-trees exploratory-data-analysis feature-engineering lightgbm machine-learning model-evaluation

retail_sales_prediction's Introduction

Rossman Sales Prediction

This repository contains the code and documentation for the Rossman Sales Prediction project. The goal of this project is to forecast the daily sales of Rossmann stores for up to six weeks in advance. By accurately predicting sales, store managers can make informed decisions regarding promotions, competition, holidays, and other factors that influence sales performance.

Problem Statement

Rossmann operates over 3,000 drug stores across 7 European countries. Currently, store managers rely on their own predictions for daily sales, leading to varying levels of accuracy. The objective of this project is to develop a machine learning model that can forecast the "Sales" column for the test set. The dataset provided includes historical sales data for 1,115 Rossmann stores, taking into account factors such as promotions, competition, school and state holidays, seasonality, and store locality. It is worth noting that some stores in the dataset were temporarily closed for refurbishment.

Project Summary

The Rossman Sales Prediction project involved extensive data analysis, feature engineering, and model selection to accurately forecast sales. Here is a brief overview of the project steps and key findings:

  1. Data Gathering and Cleaning:

    • Collected historical sales data for Rossmann stores, including competitor details, holidays, customer count, and daily sales.
    • Performed data cleaning to handle missing values and ensure data consistency.
    • Merged relevant datasets to enhance the feature set.
  2. Exploratory Data Analysis (EDA):

    • Conducted in-depth EDA by exploring univariate, bivariate, and multivariate relationships.
    • Generated insightful visualizations to uncover patterns and trends in the data.
    • Extracted meaningful insights to inform future decision-making in the machine learning pipeline.
  3. Feature Engineering and Preprocessing:

    • Created additional features such as PromoDuration and CompetitionDuration to capture relevant information.
    • Addressed multicollinearity among independent variables using variance inflation factor (VIF) analysis.
    • Detected and treated outliers using the Interquartile Range (IQR) technique.
    • Encoded categorical variables using One-Hot Encoding for compatibility with machine learning algorithms.
    • Applied various transformation techniques to achieve normal distribution of data.
  4. Model Selection and Training:

    • Split the preprocessed data into training and testing sets.
    • Utilized a variety of machine learning algorithms, including linear regression, decision trees, random forests, LightGBM, and XGBoost.
    • Evaluated model performance using metrics such as R-squared score, accuracy, and mean absolute percentage error (MAPE).
    • Employed regularization techniques (e.g., Lasso, Ridge, Elastic Net) for improved model performance.
    • Identified XGBoost as the optimal model due to its high accuracy, with an MAPE of only 2% and an R-squared score of 0.94.
  5. Model Deployment and Conclusion:

    • Finalized the XGBoost model for deployment, as it demonstrated the highest accuracy and the least error.
    • Developed a comprehensive machine learning pipeline that combines data processing, feature engineering, and model evaluation.
    • Successfully created a model capable of accurately predicting sales for Rossmann stores up to six weeks in advance.

This project showcases the effective utilization of data analysis, feature engineering, and machine learning techniques to solve a real-world forecasting problem. The insights gained from the analysis provide valuable information for decision-making within the retail industry.


For complete project video explaination and to downoad the dataset: Click here

Feel free to explore the code and documentation provided in this repository to gain a deeper understanding of the project and replicate the results and if you have any questions or suggestions, please don't hesitate to reach out.

You can check out my Linkedin for more projects and information.

Happy forecasting!


retail_sales_prediction's People

Contributors

shahrukh2016 avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.