Git Product home page Git Product logo

food-amenities-ordered-quantity-predictions's Introduction

Food-amenities-ordered-quantity-predictions

A comprehensive repository containing the step by step approach to increasing the predictive accuracy of ordered quantities.

Business Problem

We need to accurately forecast the quantity of different SKUs (food amenities) that will be ordered by customers in the future based on the past data.

Approach 1

Data Definition

  1. Data variables and definition

$ AvgSP - Average Selling price time series avgsp vs time

$ Wholesale - Wholesale price time series wholesale trend

$ RetailPrice - Retail Price time series retailprice trend

$ FinalGRN - Aggregated cost price time series finalgrn trend

$ TotalGTOrders - Time series of the total customers across all SKUs totalgtorders trend

  1. Time period considered

$ Train data - Mar 9th, 2017 - May 7th, 2017

$ Test data - May 8th, 2017 - May 19th, 2017

  1. Derived variables considered - Ordered Quantity for the SKU Carrot (local)

Data Understanding and Processing

  1. Dealing with outliers

$ Heavy outliers were spotted in the Ordered Quantity of Carrot (local).

$ The values below 250 were converted to 250 and the values above 900 were converted to 900 for easing the model build up and testing

  1. Summary statistics summary stats

  2. Training and Test Dataset

$ Train - 9th Mar, 2017 - 7th May, 2017 $ Test - 8th May, 2017 - 19th May, 2017

  1. Seasonal Effect

$ Seasonal effect is very clear from the visualizations

$ It is scaled down performing 1st degree differencing on the data

  1. Functions to create data input to model

$ Input required: AvgSP, Wholesale, RetailPrice, FinalGRN, TotalGTOrders

$ The training data is divided into 5 different time series for every input variable.

$ ARIMA is used to forecast the test values for all the inputs based on the training data time series.

$ Note: The forecasting is done on logarithmic scale

$ Accuracy metric used - rmse; Obtained rmse values (original scale) - AvgSP: 2.3, Wholesale: 4.3, RetailPrice: 4.2, FinalGRN: 3.86, TotalGTOrders: 15.4

avgsp predictions finalgrn predictions retailprice predictions totalgtorders prediction wholesale predictions

Data Modelling

  1. Model name

$ Gradient Boosting Regressor

$ It is an ensemble model which initially performs normal regression (using 'n_estimators' number of regression trees).

$ Then it improves the model by regressing over the errors and adding an extra variable (error term) to the initial regression equation.

  1. Model Accuracy on training and test dataset

$ Accuracy metric - RMSE

$ Training data - 0.009

$ Test data - 235.6

$ The model clearly overfitted the training data. The reason being heavy multicollinearity. Principal Component Analysis or other feature decomposition techniques needed.

orderedqty predictions orderedqty trend

  1. Comparison study of model

$ At this position, the model performs poorly as compared to the existing technique based on Seasonal Naiive Bayes method. The hidden patterns haven't been completely detected and processed.

  1. How model will take care of customer addition input?

$ At this point, the model hasn't been calibrated to include customer addition input.

food-amenities-ordered-quantity-predictions's People

Contributors

ankushr785 avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar

Forkers

adarsh2111

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.