How to forecast number of Pizza which will be sold in Pizza Hut in next week?

Question

Assume things but come up with an approach 🙂

in progress 0
TheDataMonk 4 years 2 Answers 1462 views Grand Master 0

Answers ( 2 )

  1. This problem can be solved by using Linear Regression and Time Series Analysis
    as we will be having data related to the no of pizzas sold in last few days,months etc.

    1) To solve by Linear Regression, we need to do some feature engineering and create some
    predictor variables from the date value. We can create some binary variables like summer,
    winter,rainy,weekday,weekend and some continuous variables like month and no of working days
    in a month. Then we go with our usual approach of training the model on train set and testing it on test
    data. We can also get to know about the variables which are very significant in the model from their p-values.
    We can then predict the future values by providing input for the created variables.

    2) This is a classic time series problem.
    i) so first we need to visualize our time series and try to get an idea about the
    trend, seasonality, whether its constant over time or not.
    ii) To predict future values, we need to have our time series stationary over time, that
    means we need to have constant mean and variance over time.
    iii)To check stationary , we make use of Augmented Dicky Fuller Test (ADF), whose null hypothesis is
    that the time series is not stationary. so depending upon the p-value, you can choose to reject the
    null hypothesis or fail to reject the null hypothesis.
    iv) If its not stationary, we need to do differencing to make it stationary that means [t-(t-1)].
    If first order differencing doesn’t make it stationary then you need to do one or couple of more times.
    Generally, you don’t need to do more than 3.
    v) we need to make use of ARIMA model which has parametres p,d and q (ARIMA(p,d,q))
    p refers to autoregressive component, d refers to the amount of differencing and q is the
    moving average component. we can find the values from the autocorrelation function plot
    and the partial autocorrelation function plot.
    vi) once you build model using these parametres, you can use the model.predict() to predict future values.

  2. If we have the data related to number of pizzas sold in previous weeks, then this can be considered a time series problem. Time series is a specific type of dataset where each data points depends on the previous ones. Also the trend (increasing/decreasing) and seasonality exist in such data.

    To forecast the number of pizzas sold in next week, we can apply ARIMA, which is the most widely used model for forecasting time series. We need to follow below steps to solve it.
    1. Load the sales data from previous weeks.
    2. Apply transformations such as changing the data type of week column, and removing all the columns except Sales. This is done because time series requires to have a single variable.
    3. Check if the series is stationary. A series is called stationary if the mean and standard deviation remains constant over time.
    4. If no stationary, we need to apply techniques like log transformation or differencing to make the series stationary.
    5. Find the parameters p,q and d for ARIMA. Here p is number of previous terms to be considered while predicting each team, q is the number of moving averarges to consider and d is the number of times difference is perfomed.
    6. fir the ARIMA model using the sales data and all three parameters.
    7. Use predict() method on the fitted model to forecast the sales for the future weeks.

Leave an answer

Browse
Browse