Code Monkey home page Code Monkey logo

delelinus / supermarket-sales-prediction Goto Github PK

View Code? Open in Web Editor NEW
3.0 1.0 0.0 2.04 MB

This is a reviewed notebook to the DSN AI+ OAU July 2020 challenge where I took the first position. The project demonstrate proper Exploratory Data Analysis, categorical data handling, Data visualization, feature selection and engineering, Model selection and hyperparameter tuning of various regression algorithms.

Jupyter Notebook 100.00%
kaggle-competition keras machine-learning-algorithms mysql-database python regression-models sales-predictions seaborn xgboost-regression

supermarket-sales-prediction's Introduction

Python Pandas scikit-learn SciPy keras mySQL Jupyter

Product Supermarket Sales Prediction

Abstract

A stage of a business life cycle that requires strategic and careful measures to be put in place is the growth stage. Growth stage comes after the Business has been launched, and part of a business growth can be expansion into more locations.

It however requires proper and critical analysis to know what location and product type is best for a specific location. For example, a tin of milk which sells for N100 in one supermarket branch may also be sold at N110 at another supermarket within the same chain of supermarkets. Hence, there's a need to understand what type of product, market clusters and supermarket type (location, age, size) will give more margin as business is expanded to more locations.

In this analysis, a predictive model is developed using machine learning algorithms to improve and accurately forecasts product sales. The proposed model is especially targeted to identify key characteristics of products and supermarkets driving sales so as to be better informed on an optimal template for expansion of Chuwkwudi Supermarket to other states in Nigeria. The model is not intended to change current subjective forecasting methods. A model based on real supermarket store's data is developed in order to validate the use of the various machine learning algorithms

Introduction

This is an in house kaggle competition organized by AI+ OAU where the task is to predict product supermarket sales to help identify key characteristics of products and supermarkets driving sales so as to be better informed on an optimal template for expansion of Chukwudi Supermarket to other states in Nigeria.

For this particular problem, I have analyzed the data as a supervised learning problem. In order to forecasts the sales, I have compared different regression models like Linear Regression, Decision Tree, ExtraTreeRegressor, Gradient Boosting, Random Forest, XgBoost and Neural Network.

The data comes in the shape of multiple files BUT to demonstrate my SQL proficiency had to load the data into a MySQL database. First, the train table essentially contains the sales by supermarket, product and so on. The test table contains the same features without the product supermarket sales information, which I am tasked to predict.

Data Sources

The data has can be seen here comes in the shape of multiple files BUT to demonstrate my SQL proficiency had to load the data into a MySQL database. The file containing the mysql scripts that created the database and the data is saved as chukwudi_supermarket.sql in the db and data scripts folder. The database contain the following tables:

  • train contains the sales by supermarket, product and so on.
  • test contains the same features as train but without the product supermarket sales information
  • sample_submission contains Supermarket id and dummy product supermarket sales values. This serve as a submission template

Installation

Install all requirements by running the following command

pip install requirements.txt

Issues

Incase you have any difficulties or issues while trying to run the app you can raise it on the issues section.

Pull Requests

If you have something to add or new idea to implement, you are welcome to create a pull requests.

Give it a Star

If you find this repo useful , give it a star so as many people can get to know it.

Credits

supermarket-sales-prediction's People

Contributors

delelinus avatar

Stargazers

 avatar  avatar  avatar

Watchers

 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.