Abstract
There is a lot of rivalry among stores in this day and age of technology. Predicting future demand or sales is one of their biggest obstacles. The aim of this work is to forecast department-wide sales for Walmart stores using machine learning models, specifically focusing on improving forecast accuracy. This study sought to evaluate an XGBoost ML model’s ability to estimate supply chain demand. The researchers used sales data from several departments at 45 Walmart outlets in the United States. Making the data ready for ML by dealing with missing values and converting the categorical features. Data was then splitted into training and testing sets for performance evaluation. The XGBoost model produced promising results .When comparing the results of XGBoost with other models, such as decision tree regression or linear regression, XGBoost was found to provide better results by a noticeable margin in all three metrics (MAE, MSE, and RMSE). Thus, it can be concluded that XGBoost is an effective approach for enhancing the precision of demand prediction in a supply chain.
Transcript
This transcript was autogenerated. To make changes, submit a PR.
Hello everyone.
I'm Juin Thomas.
I work as a technical architect at Signe Jewelers.
I have 15 plus years of experience in supply chain and retail, and
I'm also a senior member of IEE.
Having said that, I want to thank Mark for inviting me as a speaker
for machine learning conference 2025.
Today, I would like to present on forecasting using machine learning.
We will deep dive into models and basically understand.
Different type of models in doing the forecasting and why?
XT Boost, in other words called as xtb.
Regressor is superior to the other models, which we have used.
So now there are two kind of forecasting what we have in the
world of retail and supply chain.
One is called the demand forecasting.
It is the forecasting of a store and item combination.
So it basically helps.
It's a process of using historical data to estimate the future customer demand, and
it helps in the planning of the inventory.
It reduces stockouts and it helps in optimizing the supply chain,
enhancing the customer satisfaction.
I. Moving forward to understand what is sales forecasting.
Sales forecasting is a technique which is used to estimate the future sales
based on the historical data market trends, seasonality and external factors.
It helps the retail business in understanding the informed
inventory and staffing decisions.
It helps in planning the budgets and marketing efforts.
Optimizing the supply chain and operations and anticipating the demand fluctuations.
So in this presentation I have four different objectives.
First one is we will evaluate the data, what we have.
It's also called as the training data.
So in that data is basically we are gonna predict the weekly sales
using the machine learning models.
Second one is explore.
We are going to explore the data, trends and relationship.
And thirdly, we will evaluate and compare the different models what
we will see in this presentation.
And finally.
Identifying why XE Boosto perform better than the other models.
Moving on to the data set.
We have a Walmart data set, which basically has certain features
like store data, weekly sales, holiday flag, and temperature.
And now it has 45 stores Walmart stores with the data.
And this data is online available.
And in this we will see that how.
We have the additional economic indicators like the fuel price and CPI unemployment,
which plays an important role to analyze a specific model to to basically figure
out the forecasting of this dataset.
And now finally, we will have the target variable, which is the weekly sales.
So this is the Walmart data set, what we have, and as we see that these are
the stores, we have 45 stores in this data set, and then we have the date
and the weekly sales for that week.
And then the holiday flag zero stands for, it was not a holiday, and one is basically
that it was a holiday on that day.
And then we have, temperature that week or the weather that week.
Then we have a fuel price and CPI customer pricing index.
And then we have the employ an unemployment ratio.
The models, which we have evaluated as part of this test or presentation
is basically linear regression, rich regression, polynomial regression,
10 years neighbor decision tree, random forest, and XG boost.
So these are all out of the box model provided in the Python framework itself,
which does the work of forecasting.
And we will evaluate.
How to work on these models and what are the results which these models produced.
Moving on to understand the linear regression model.
So this is also known as a regression model, and here we basically
see that the polynomial feature degree is three, which was given.
To build this model.
And this model gave an accuracy rate of 97.7 for this test.
This data set, what we had, and the test accuracy is 95.8 percentage.
The second model is the rich regression model.
And this is also a regression model.
And we see here.
That the paranormal feature degree was given as three, and the accuracy
rate given by the model is 97.7 with the test accuracy as 95.8 percentage.
The next model is the KNN model.
KNN is also known as K nearest neighbor.
The way how it works is it tries to fetch the three ne nearest neighbor
for the given combination or the given input, which is provided to the model.
So here, in this case, the N neighbors is basically three.
That means it basically searches for the three nearest neighbor
for the given combination.
KN gave the accuracy rate of a hundred percent and the
test accuracy rate of 91.9%.
The next model we evaluated is a decision tree model, and
it is again, a decision tree.
So it basically decides based on the max depth what we have.
So it gave a training set accuracy of 97.3 and the test accuracy of 93.3.
The next model, which I evaluated is the random forest model.
And as the name says, it is a forest model.
It basically creates a set of decision tree or also known as a forest.
So here, in this case, n estimator is one of the parameter
what we passed to the forest.
Model and we see that the, an estimator given as 75 basically
creates a seven 75 decision trees.
And based on that, we see that the training set accuracy
is 99.1, which is good.
And then test set accuracy is 95.6 percentage.
Moving on to the final model, which I evaluated is the XGB REGRESSOR model.
Out of all the models we have evaluated xg XGB stands the best for the test
data, what we have we see here so in the XGB, the training set accuracy is
99.9, and the test accuracy has given us 97.2%, which is the best out of all
the models, which we have compared.
Trying to understand the correlation metrics.
Now correlation metrics is one of the most important metrics which we analyze
as part of understanding the data.
And as we see that there are some of the columns, which has a very
close relationship to each other, like the weekly sales and holiday
flag, they have a close relationship with either with each other.
Similarly temperature and fuel.
Price has a close relationship with each other.
So once we determine the correlation metrics.
The second thing is the feature importance.
So each model produces its own feature importance.
So this is, I think the feature importance given by the XGB regressor
or the XG B'S XG boost model.
And we see here that the store and CPI, the customer pricing indexes
featured as the most important feature compared to the other features like
the temperature and holiday flag.
Now I would like to talk about why XC Boost or xg B Regressor model
outperformed the other models.
So there are a few reasons.
It uses the gradient boosting with regularization to reduce or fitting,
it handles the missing values and skew distributions effectively.
Or efficiently.
And then finally it is highly at Tuneable with strong cross validation
support, and that is why we have achieved that 97.2 percentage accuracy,
the highest in the experiment,
conclusion, and recommendations, visual analysis and AIDS featuring understanding.
Simple models offer speed, but less accuracy.
XG Boost is recommended for accurate and scalable forecasting.
Consider assembling or hyper parameter tuning for even better results.
So for this experiment or the test, what we have done with the
Walmart data set, we have used the basic parameters for the models.
But if we have a complicated data set, then for sure we can hyper tune
our model to get better results.
Thank you so much for having me.
I hope you have a good day and a great conference.
Thank you.