Walmart's Supply Chain & ML Forecasting
Walmart's Supply Chain & ML Forecasting
ACKNOWLEDGEMENTS
For the beginning, we would like to send our warmest thank you to all the faculty
from University of Information and Technology for providing us all the fundamental
knowledge to implement this project.
Nevertheless, for us to develop this project, it is impossible not to mention
[Link] Van Hai Trieu. Thank you for your devotional lessons and valuable sharing to
help us gain more knowledge about Supply Chain Management.
We had done this project in more than a month, and from the bottom of our heart,
that was a precious moment in our student life. This project helped us to engage
ouranalysis, development, processing abilities and especially collaboration skills. We
have had a clearer aspect about our future career path. This is also contributing to our
life experience package that will always go alongside us until the end of our life.
Based on all the fundamental studies combined with enthusiastic support from
the instructors, we have completed this project successfully. However, since this is our
very first project, it is impossible to avoid some minor mistakes.
We are looking forward to receiving valuable comments and advice from all
lecturers to improve our wider scale project soon.
Once again, we would like to sincerely send to you a huge thanks from the
bottom of our heart.
2
Supply Chain - Demand Forecasting with Machine Learning Group 1
LECTURER’S FEEDBACK
.........................................................................................................................................
.........................................................................................................................................
.........................................................................................................................................
.........................................................................................................................................
.........................................................................................................................................
.........................................................................................................................................
.........................................................................................................................................
.........................................................................................................................................
.........................................................................................................................................
.........................................................................................................................................
.........................................................................................................................................
.........................................................................................................................................
.........................................................................................................................................
.........................................................................................................................................
.........................................................................................................................................
.........................................................................................................................................
.........................................................................................................................................
.........................................................................................................................................
.........................................................................................................................................
.........................................................................................................................................
.........................................................................................................................................
.........................................................................................................................................
.........................................................................................................................................
.........................................................................................................................................
.........................................................................................................................................
.........................................................................................................................................
.........................................................................................................................................
3
Supply Chain - Demand Forecasting with Machine Learning Group 1
TABLE OF CONTENTS
ACKNOWLEDGEMENTS ................................................................................. 2
LECTURER’S FEEDBACK ............................................................................... 3
TABLE OF CONTENTS .................................................................................... 4
LIST OF FIGURES ............................................................................................ 8
LIST OF TABLES ............................................................................................... 9
I. GENERAL INTRODUCTION: ................................................................. 10
1. Supply chain project overview: ............................................................ 10
2. Project scope:.......................................................................................... 10
3. Project objectives: .................................................................................. 10
4. Master data:............................................................................................ 11
II. RELATED WORDS: ............................................................................... 22
III. BUSINESS PROCESS SYSTEM: .......................................................... 23
1. Overview of Walmart: ........................................................................... 23
2. Introduction to the supply chain strategy of Walmart:...................... 23
3. Business strategy: ................................................................................... 24
4. Supply Chain Management ................................................................... 26
4.1. Global sourcing, in-store warehousing and cross-docking: ........... 26
4.2. Technology and Automation Integrated: ......................................... 27
4.3. Workforce Management as third largest employer: ....................... 28
4.4. Conclusion: ......................................................................................... 28
5. Competitive Advantage: ........................................................................ 29
6. Value Created:........................................................................................ 31
7. Customer segments: ............................................................................... 31
8. Sales Channel: ........................................................................................ 34
8.1. Physical Stores: ................................................................................... 34
8.2. E-commerce: .................................................................................... 34
8.3. Marketplace: .................................................................................... 35
8.4. Mobile Sales: .................................................................................... 35
8.5. Membership Program: ................................................................... 35
8.6. Direct Sales: ..................................................................................... 35
8.7. Omnichanel:..................................................................................... 35
IV. MODELING:........................................................................................... 36
4
Supply Chain - Demand Forecasting with Machine Learning Group 1
5
Supply Chain - Demand Forecasting with Machine Learning Group 1
• Preprocessing data.
• Run models to predict future.
Huynh Thi Ha
21522021 • Do the report. 100%
Giang
• Do the PowerPoint.
• Presenter.
6
Supply Chain - Demand Forecasting with Machine Learning Group 1
• Presenter.
7
Supply Chain - Demand Forecasting with Machine Learning Group 1
LIST OF FIGURES
8
Supply Chain - Demand Forecasting with Machine Learning Group 1
LIST OF TABLES
Table 1: Data description ................................................................................... 11
Table 2: Customer segments .............................................................................. 32
Table 3: Result for exogenous(external) variables ............................................. 40
Table 4: Result for internal variables ................................................................. 41
Table 5: Result for all variables ......................................................................... 41
9
Supply Chain - Demand Forecasting with Machine Learning Group 1
I. GENERAL INTRODUCTION:
In this first chapter, we will discuss about the project overview, reason to
choose this topic, scopes, objectives, and master data.
Forecasting demand for Walmart products is a critical task that can significantly
impact the retailer's supply chain efficiency, inventory management, and overall
profitability. By accurately predicting future demand, Walmart can optimize its
inventory levels, reduce stockouts and overstock, and improve customer satisfaction.
2. Project scope:
3. Project objectives:
10
Supply Chain - Demand Forecasting with Machine Learning Group 1
4. Master data:1
Dataset: Historical sales data for 45 Walmart stores located in different regions are
available in US from 5-2-2010 to 26-10-2012.
Case study:
One of the leading retail stores in the US, Walmart, would like to predict the
sales and demand accurately. There are certain events and holidays which impact
sales on each day. There are sales data available for 45 stores of Walmart. The
business is facing a challenge due to unforeseen demands and runs out of stock some
times, due to the inappropriate machine learning algorithm. An ideal ML algorithm
will predict demand accurately and ingest factors like economic conditions
including CPI, Unemployment Index, etc.
Datasets describe:
Data consists of 421570 records of weekly sales from stores spanning between
‘05-Feb-2010’ to ’26-Oct-2012’. This comprises of 143 Weeks of sales data. Within
this file you will find the following fields:
1
H, M. Y. (2021, December 26). Walmart dataset. Kaggle. [Link]
dataset
11
Supply Chain - Demand Forecasting with Machine Learning Group 1
Several approach way to get data insight are finding the reasonable answer or the
convince hypothesis for these questions below:
Is there any difference between normal day with holiday weeks their overall sales
volume across different regions?
We may get the insights here that can help decide if more resources need to
be allocated to specific regions or stores during holiday periods.
What is the fuel price changes, CPI, temperature appear in here? Is there a significant
correlation between these factors and sales volumes?
Holiday? Everybody knows the super-massive demand in this period of time but
what is the ROI (Return on investment) of holiday-related promotions, and how can
it be optimized?
By analyzing sales growth around holidays, you can calculate the ROI and
optimize promotional efforts for future holiday seasons.
45 Stores distributed on whole US so there are required a large chain of supply and
provide on time this make us consider What are the inventory turnover rates by store
12
Supply Chain - Demand Forecasting with Machine Learning Group 1
and season? and how does temperature affect sales across different geographic
regions?
All considerations above are good way to approach, let's see what about our team
solutions.
Data insight:
• This histogram is right-skewed, indicating that most stores have weekly sales
in the lower range, with a few instances of high sales.
• A large proportion of weekly sales values fall under 1 million, while sales
above 2 million are rare.
13
Supply Chain - Demand Forecasting with Machine Learning Group 1
• This distribution has multiple peaks, indicating variability in fuel prices over
time.
• A large number of fuel prices cluster around 3.5 dollar/gallon, but there are
notable groups at other prices, suggesting fluctuation.
• The CPI distribution shows a bimodal pattern with two main clusters: one
around 130–140 and another around 200–220.
• This indicates that CPI has varied over the period covered by the dataset,
potentially due to economic shifts.
These insights suggest different ranges and distributions for each feature, which could
impact how they relate to weekly sales in further analysis, such as through correlation
or regression.
14
Supply Chain - Demand Forecasting with Machine Learning Group 1
The boxplots provide insights into the distribution, spread, and presence of
outliers for each feature in the dataset. We are going to detailed insights for each plot:
• The boxplot shows that the majority of weekly sales are below 1.5 million,
with the median slightly above 1 million.
• There are several outliers on the higher end, with weekly sales exceeding 2
million, which indicates that while most sales are within a common range, a
few stores have notably high weekly sales.
• The boxplot for the Holiday Flag is binary, with values of either 0 or 1.
• The temperature distribution is fairly centered, with most values between 40-
and 80-degrees Fahrenheit.
• There are some outliers on both lower and upper ends, representing instances
of extreme temperatures.
• The median temperature is around 60 degrees, with a relatively symmetrical
spread around this point.
15
Supply Chain - Demand Forecasting with Machine Learning Group 1
• The fuel price data has a moderately widespread, with most values ranging
from approximately 2.75 to 4.00.
• There are no significant outliers, suggesting that fuel prices remained within a
consistent range over the recorded period.
• The median fuel price is close to 3.25, and the distribution appears relatively
balanced.
• The CPI values are distributed with a slight skew, with most values around the
median, approximately 180.
• There are a few outliers below 140 and above 220, which indicate extreme CPI
values during the period covered by the dataset, possibly due to economic
events.
• The middle 50% of values are spread over a broad range, showing variability
in CPI over time.
6. Unemployment:
In summary, these boxplots reveal the central tendencies and variability of each
feature, along with the presence of outliers that may indicate unique events or
conditions, such as high sales weeks, holiday effects, extreme temperatures, or
economic shifts. These outliers could be points of interest for further analysis or
modeling, as they might have a unique impact on weekly sales patterns.
The heatmap shows the correlation matrix for various features in the dataset,
indicating how each variable is linearly related to the others:
16
Supply Chain - Demand Forecasting with Machine Learning Group 1
• Weekly Sales: Has a weak negative correlation with Store (-0.34), meaning
stores with higher IDs tend to have slightly lower weekly sales; Very weak
correlations with other variables, suggesting sales aren’t strongly affected by
factors like holiday weeks, fuel price, temperature, CPI, or unemployment.
• Holiday Flag: Has weak negative correlations with Temperature (-0.16) and
Fuel Price (-0.078), indicating that holiday weeks may slightly coincide with
lower temperatures and fuel prices.
• Temperature: Shows weak positive correlations with Fuel Price (0.14) and
CPI (0.18), possibly reflecting seasonal effects.
Overall, the correlations are weak, indicating that these variables are mostly
independent or have minimal linear relationships.
17
Supply Chain - Demand Forecasting with Machine Learning Group 1
• The plot for the Holiday Flag is binary, with values of either 0 or 1.
18
Supply Chain - Demand Forecasting with Machine Learning Group 1
• The box plot shows that the median weekly sales are around 0.4. The box
indicates the interquartile range (IQR), which is the range of the middle 50%
of the data. The whiskers extend to the minimum and maximum values within
a certain range (usually 1.5 times the IQR). The dots beyond the whiskers
represent outliers. This suggests that there are a few stores with significantly
higher weekly sales compared to the majority.
19
Supply Chain - Demand Forecasting with Machine Learning Group 1
• The boxplot for the Holiday Flag is binary, with values of either 0 or 1.
• The box plot shows that the median temperature is around 0.6. The box
indicates the interquartile range (IQR). The whiskers extend to the minimum
and maximum values within a certain range. The dots beyond the whiskers
represent outliers. This suggests that there are a few stores with significantly
higher or lower temperatures compared to the majority.
• The box plot shows that the median fuel price is around 0.4. The box indicates
the interquartile range (IQR). The whiskers extend to the minimum and
maximum values within a certain range. There are no outliers visible in this
box plot.
• The box plot shows that the median CPI is around 0.4. The box indicates the
interquartile range (IQR). The whiskers extend to the minimum and maximum
values within a certain range. There are no outliers visible in this box plot.
• The box plot shows that the median unemployment rate is around 0.4. The box
indicates the interquartile range (IQR). The whiskers extend to the minimum
and maximum values within a certain range. The dots beyond the whiskers
represent outliers. This suggests that there are a few stores with significantly
higher unemployment rates compared to the majority.
20
Supply Chain - Demand Forecasting with Machine Learning Group 1
• Store and Fuel Price: This indicates that stores with higher fuel prices tend to
have higher overall sales.
• Store and CPI: This suggests that stores in areas with higher Consumer Price
Index (CPI) generally have higher sales.
21
Supply Chain - Demand Forecasting with Machine Learning Group 1
• Store and Holiday Flag: This suggests that stores might see slightly lower sales
during holidays, possibly due to reduced business hours or customer
preferences.
• Store and Weekly Sales: This indicates a very weak negative correlation,
which might not be practically significant.
No Significant Correlations:
• Store and Unemployment: This suggests that unemployment rates in the area
don't have a strong impact on store sales.
2
Aldahmani, E., Alzubi, A., & Iyiola, K. (2024). Demand Forecasting in Supply Chain Using Uni-Regression
Deep Approximate Forecasting Model. Applied Sciences, 14(18), 8110. [Link]
3
Feizabadi, J. (2020). Machine learning demand forecasting and supply chain performance. International
Journal of Logistics Research and Applications, 25(2), 1–24.
22
Supply Chain - Demand Forecasting with Machine Learning Group 1
4
Carbonneau, R., Vahidov, R., & Laframboise, K. (2007). Machine Learning-Based Demand Forecasting in
Supply Chains. International Journal of Intelligent Information Technologies, 3(4), 40–57.
[Link]
5
GlobalData. (2022). Company Profile. GlobalData. [Link]
inc/
6
Rickerby, M. (2020, January 4). Walmart supply chain: Winning at inventory logistics. Extensiv.
[Link]
23
Supply Chain - Demand Forecasting with Machine Learning Group 1
costs, more in-store diversity and selection, and extremely competitive customer
pricing.
3. Business strategy7:
• Pricing Strategy
o Walmart is well-known for their EDLP as Everyday Low Prices, this is not
only the slogan to attract the consumers, but the commitment to affordability
is the cornerstone of Walmart’s marketing methods to shape consumers’
perceptions to directly driving foot to their stores.
o At this approach, Walmart did make a big step to a transition to an Omni
Chanel Marketplace. They are not only offer low prices almost every day
for consumers but continuously monitor competitors’ prices then provide a
dynamic pricing to remain their competitivity.
7
Choo, J. (2024, January 5). Walmart business strategy: A comprehensive analysis. THE STRATEGY
JOURNEY. [Link]
business-strategy-
24
Supply Chain - Demand Forecasting with Machine Learning Group 1
• Product Strategy
o Walmart provides a wide range of products which ensure that customer only
need to visit their place to purchase everything. The diversity in their
product range helps them to ensure the commitment rate of customers and
enhance the sustainability.
• Global Expansion
• Digital Transformation
25
Supply Chain - Demand Forecasting with Machine Learning Group 1
Walmart utilizes a global sourcing strategy that allows it to source products from
a wide range of suppliers around the world. This extensive supply chain enables the
company to offer competitive prices across a diverse product portfolio that includes
over 18 categories, ranging from groceries to electronics.
8
Lövenich, A. (2024, September 23). The amazing supply chain of Walmart. All Things Supply Chain - Supply
Chain Trends, Best Practices, News and Much More!; All Things Supply Chain.
[Link]
26
Supply Chain - Demand Forecasting with Machine Learning Group 1
Walmart has also adopted new delivery methods to improve efficiency and cost-
effectiveness. A key technique is cross-docking, which eliminates the need for
traditional warehousing by allowing goods to move directly from inbound to outbound
shipments. Suppliers deliver pre-packaged products to distribution centers, where they
are quickly loaded onto trucks that are ready to deliver to stores. This process minimizes
unloading and loading times, ensuring that products reach store shelves more quickly.
By utilizing centralized distribution centers that automatically allocate goods to stores,
Walmart streamlines its operations and reduces overall costs.
Walmart's supply chain management strategy highlights its focus on efficiency and
cost control. The global sourcing approach not only allows Walmart to keep prices
low but also enhances its ability to offer a vast array of products to consumers. The
incorporation of in-store warehousing optimizes inventory management and
improves customer satisfaction by ensuring product availability.
27
Supply Chain - Demand Forecasting with Machine Learning Group 1
supplier relationships, reduces excess inventory, and ensures that shelves remain
stocked. This collaborative strategy not only drives down costs but also enhances
customer satisfaction by ensuring product availability.
The app's features, such as shift visibility and mobile clock-in, illustrate
Walmart's understanding of modern workforce dynamics, where flexibility and ease of
communication are paramount. This technological investment not only streamlines
operations but also empowers employees to take control of their schedules and work
environment.
Furthermore, the emphasis on communication through the app can lead to a more
engaged workforce. When employees can easily connect with one another, it fosters a
sense of community and teamwork, which is essential for maintaining high levels of
service in retail operations.
9
Thi Thu Ha, N. (2017). Wal-Mart’s Successfully Integrated Supply Chain and the Necessity of Establishing the
Triple-A Supply Chain in the 21st Century. ResearchGate.
[Link]
28
Supply Chain - Demand Forecasting with Machine Learning Group 1
5. Competitive Advantage:
Walmart's primary competitive advantage stems from its vision of offering low-
cost goods. In addition to this core strategy, several other factors contribute to Walmart's
competitive edge, which are outlined below:
• Selling Low-Priced Goods
Walmart's central competitive advantage lies in its ability to sell products
at prices lower than those of its competitors. The company operates under the
philosophy of “Everyday low prices,” with the slogan, “We save people’s money
so that they can live better.” Since its inception, Walmart has consistently fulfilled
29
Supply Chain - Demand Forecasting with Machine Learning Group 1
this promise by providing essential retail goods at more affordable prices than
other market players.
• Cost Leadership
Walmart can sell goods at such low prices while still making a profit. The
key answer lies in its ability to keep costs low through various resources, including
human capital, knowledge, and large-scale operations. Walmart invests
significantly in technology, which helps reduce expenses. Strategic store
locations, effective management, and technology utilization enable Walmart to
achieve economies of scale and maintain cost leadership in the retail sector.
• Global Expansion
Starting with just one store, Walmart has expanded its operations to 28
countries, with approximately 11,700 stores worldwide. The company’s rapid
penetration into various markets is unmatched, giving it a global presence that
competitors find difficult to replicate.
30
Supply Chain - Demand Forecasting with Machine Learning Group 1
In summary, Walmart's ability to offer low prices, exceptional customer service, cost
leadership, superior supply chain management, global expansion, and market
dominance in smaller communities collectively contribute to its strong competitive
position in the retail industry.
6. Value Created:
By improve and remain to these core values, Walmart not only aims to be the
preferred shopping destination for customers but also seeks to build strong, lasting
relationships based on trust and respect. The organization goes above and beyond to
ensure it does the right thing, demonstrating a commitment to justice and sincerity
in all its engagements.
7. Customer segments:
31
Supply Chain - Demand Forecasting with Machine Learning Group 1
Positioning refers to the selection of the marketing mix the most suitable for
the target customer segment.
32
Supply Chain - Demand Forecasting with Machine Learning Group 1
33
Supply Chain - Demand Forecasting with Machine Learning Group 1
8. Sales Channel:
• Store Formats: Walmart has different types of stores to meet various shopping
needs. They have Supercenters, which offer a full range of groceries along with
general merchandise. Then there are Discount Stores, which focus on providing
lower-priced goods, and Neighborhood Markets, which are smaller grocery-focused
stores. This variety helps Walmart cater to different customers and their preferences.
• Store Experiences: When you walk into a Walmart, you’ll notice that they
prioritize a friendly shopping experience. The stores have wide aisles, clear signs,
and well-organized product displays. This layout is designed to make it easy for
customers to browse and find what they need, often leading to those impulse buys!
8.2. E-commerce:
• Website and App: Walmart’s website and mobile app are user-friendly, making it
simple to search for products, read customer reviews, and get personalized
recommendations. The app even lets you scan barcodes to check prices and create
shopping lists, which is super handy.
• Home Delivery: For those busy days, Walmart offers home delivery services,
bringing groceries and other products right to your door. This is especially great for
families or anyone who might not have time to go shopping.
34
Supply Chain - Demand Forecasting with Machine Learning Group 1
• Same-day Delivery: In some areas, Walmart even provides same-day delivery for
groceries and other items, putting them in direct competition with services like
Amazon Fresh.
8.3. Marketplace:
• Third-parties seller: Walmart’s online marketplace allows other sellers to list their
products alongside Walmart’s own inventory. This means a wider selection for
customers and helps Walmart compete with bigger online retailers.
• Quality Control: Walmart keeps a close eye on the quality of products sold by
third-party sellers to ensure that customers have a good shopping experience and
that the Walmart brand remains strong.
• Walmart Mobile Application: The Walmart app isn’t just for shopping; it also
helps you track your orders, find digital coupons, and use Walmart Pay for secure
transactions. It makes the whole shopping process smoother.
• Picking up services: If you prefer not to go inside the store, Walmart offers curbside
pickup. You can place your order online and have it brought right to your car, which
is especially convenient and contactless.
• Walmart+: This membership program gives you perks like free shipping on online
orders, discounts on fuel at Walmart gas stations, and early access to special
promotions. It’s designed to keep customers loyal and compete with services like
Amazon Prime.
• Online direct sale: When you shop on Walmart’s website; you can buy a wide range
of products directly from them. This straightforward approach makes it easy and
convenient for customers to find what they need without dealing with third parties.
8.7. Omnichanel:
• Integration: Walmart’s strategy is all about making sure customers can easily
switch between shopping online and in-store. Whether you want to order something
online and pick it up at the store or return an online purchase in person, Walmart
aims to make the experience as smooth as possible.
35
Supply Chain - Demand Forecasting with Machine Learning Group 1
In summary, Walmart uses a mix of physical stores and online options to meet the
needs of its customers
IV. MODELING:
1. Decision Tree:
A Decision Tree10 is a non-parametric supervised learning model used for
classification and regression. For this sales prediction model, it works by recursively
splitting the data into subsets to predict a continuous output – weekly sales – based on
features such as store type, holiday flag, temperature, fuel price, CPI, and
unemployment data. For instance, temperature could impact weekly sales of seasonal
items, while the unemployment rate might affect overall purchasing behavior in
different regions. Decision nodes could split based on thresholds of temperature or
employment figures to form subsets that align with sales patterns. The tree structure is
made up of nodes:
- Root Node: Contains all training data.
- Decision Nodes: Points where data is split based on features like store.
- Leaf Nodes: Contain the final predicted sales values.
The model selects splits based on metrics like Gini Impurity or Information Gain
(entropy-based) to reduce uncertainty and increase purity at each step. Decision Trees
are intuitive and easy to visualize, but they can be prone to overfitting, especially with
deep trees. Techniques like pruning and ensemble methods (e.g., Random Forests) are
often used to improve their generalization ability.
• Strengths:
10
Scikit-learn. (n.d.). [Link]. Scikit-learn
36
Supply Chain - Demand Forecasting with Machine Learning Group 1
The Support Vector Machine (SVM11) model, while commonly associated with
classification, can also be adapted for regression tasks, known as Support Vector
Regression (SVR). The goal of SVR is to find a hyperplane that fits the data points
while keeping prediction errors within a specified tolerance (epsilon). The model
maximizes the margin around this hyperplane, focusing only on data points outside the
margin to refine the prediction.
SVR12 utilizes kernel functions, such as polynomial and radial basis function
(RBF) kernels, to map the data into higher-dimensional spaces, enabling it to capture
complex, nonlinear relationships. While SVR excels in high-dimensional data and
generalizes well, it can be computationally intensive for large datasets, and selecting
the appropriate kernel function is key to its success.
11
Scikit-learn. (n.d.). Support vector machines. Scikit-learn.
12
Scikit-learn. (n.d.). Support vector machine regression example. Scikit-learn
37
Supply Chain - Demand Forecasting with Machine Learning Group 1
• Strengths:
- Effective for high-dimensional data: Can handle complex datasets with many
features.
- Good generalization performance: Often performs well on unseen data.
• Weaknesses:
- Can be computationally expensive, especially for large datasets.
- Choice of kernel function is crucial: The choice of kernel can significantly
impact performance.
3. Random Forest:
Random Forest13 are a popular supervised machine learning algorithm that can
handle both regression and classification tasks. They are particularly well-suited for
business applications like sales forecasting, where multiple features (e.g., fuel price,
unemployment, temperature, etc.) interactly impact the target outcome. Random
forests operate as an ensemble of decision trees, where each tree is trained on a
random subset of data and features, providing a combined prediction that improves
accuracy and reduces overfitting.
• Strengths:
- Scalability: Works efficiently with large datasets and can be parallelized for
faster processing.
• Weaknesses:
13
Scikit-learn. (n.d.). [Link]. Scikit-learn.
38
Supply Chain - Demand Forecasting with Machine Learning Group 1
V. EVALUATION METRICS:
1. R-squared 14(R²):
R², or the coefficient of determination, measures the proportion of the variance
in the dependent variable that is predictable from the independent variables. It indicates
how well the model’s predictions match the actual data.
• Formula:
2
∑𝑛𝑖=1(𝑦𝑖 − 𝑦̂𝑖 )2
𝑅 =1− 𝑛
∑𝑖=1(𝑦𝑖 − 𝑦̅𝑖 )2
Where:
𝑦𝑖 = actual values,
𝑦̂𝑖 = predicted values,
𝑦̅𝑖 = mean of actual values.
• Formula:
14
Newcastle University. (n.d.). Coefficient of determination: R-squared. Newcastle University.
15
Statistics How To. (n.d.). Absolute error. Statistics How To
39
Supply Chain - Demand Forecasting with Machine Learning Group 1
𝑛
1
𝑀𝐴𝐸 = ∑|𝑦𝑖 − 𝑦̂𝑖 |
𝑛
𝑖=1
• Formula:
𝑛
1
𝑀𝑆𝐸 = ∑(𝑦𝑖 − 𝑦̂𝑖 )2
𝑛
𝑖=1
• Formula:
𝑛
1
𝑅𝑀𝑆𝐸 = √𝑀𝑆𝐸 = √ ∑(𝑦𝑖 − 𝑦̂𝑖 )2
𝑛
𝑖=1
VI. RESULT:
• Result for exogenous (external) variables:
16
Frost, J. (n.d.). Mean squared error (MSE): Definition and interpretation. Statistics By Jim
17
Frost, J. (n.d.). Root mean square error (RMSE): Definition and interpretation. Statistics By Jim
40
Supply Chain - Demand Forecasting with Machine Learning Group 1
MSE, and RMSE). This suggests that external factors alone are insufficient for
capturing the underlying patterns in the data.
Both Random Forest and Support Vector Regression show similar results with a
relatively low R-squared, indicating that the models have limited ability to explain
the variation in the data for exogenous variables. Random Forest outperforms SVR
in terms of MAE and RMSE, suggesting that it makes more accurate predictions.
All models show high R-squared values (around 0.93), indicating excellent
predictive performance for internal variables. Decision Tree and Random Forest
perform similarly, with close MAE and MSE values, and low RMSE, pointing to
accurate predictions. However, Random Forest shows slightly better performance
in terms of MAE and RMSE.
• Result for all variables:
41
Supply Chain - Demand Forecasting with Machine Learning Group 1
The best performance is achieved when both internal and external variables are
used together. When using all variables, Random Forest indicates the best results
with the highest R-squared value (0.9379) and the lowest MAE, MSE, and RMSE
among all models. This suggests that Random Forest is the most capable model for
combining information from both sets of variables and making the most exact
predictions. While the Decision Tree also works well, it does not achieve the
performance of the Random Forest.
In conclusion, the results demonstrate that internal variables play a more crucial
role in accurate model predictions than external ones. Combining both internal and
external variables deliver the most reliable outcomes, enhancing model performance
across all metrics. In particular, the Random Forest shows superior performance in
terms of prediction accuracy across all three groups of variables, especially when
using all variables. It also minimizes error better than the other models. While
Decision Tree and SVR have certain limitations, particularly when handling
exogenous variables, but they still solve well with internal variables. However,
Random Forest clearly outperforms them in overall accuracy and error reduction.
As we saw, the model after run dataset have external value vs internal value have
large distance with each other, so we can see that the external will affect to the revenue
of that store or business.
So, we can use machine learning to run model, predict the demand of customer
base on the history data to improve supply chain such as:
Supply Chain Suggestion: Regularly monitor and integrate relevant external data into
the forecasting process. This can help Walmart proactively manage stock levels,
optimize distribution schedules, and reduce the risk of overstock or stockouts. For
example, anticipate increased demand for specific products before holidays or during
expected weather changes, and adjust inventory accordingly.
42
Supply Chain - Demand Forecasting with Machine Learning Group 1
Conclusion: Exogenous variables can lead to spikes in demand that standard forecasts
miss. This indicates a need for quick-response capabilities in procurement.
Conclusion: External factors often vary by region (e.g., weather events, local holidays,
regional economic changes), suggesting that a one-size-fits-all approach may not be
effective.
Supply Chain Suggestion: Use regional forecasts with exogenous variables to tailor
inventory and distribution strategies for each location. For example, adjust stock levels
in stores based on regional forecasts of weather or events, ensuring that demand is met
locally without excessive transportation costs.
Conclusion: The difference in forecast accuracy indicates that exogenous factors are
essential to understanding real-world demand patterns. Relying solely on historical
sales may lead to inaccurate predictions.
Supply Chain Suggestion: Invest in demand forecasting models that allow for
continuous integration of exogenous data, like machine learning models that can
dynamically adjust for seasonal or sudden external impacts. Additionally, maintain data
partnerships or external data sources to update models regularly with relevant external
data.
Conclusion: The forecast difference highlights that external events (like economic
changes or competitive promotions) can significantly influence demand elasticity.
43
Supply Chain - Demand Forecasting with Machine Learning Group 1
Supply Chain Suggestion: Develop dynamic pricing and promotional strategies that
respond to anticipated demand changes due to exogenous factors. For instance,
implement region-specific promotions based on economic conditions, or offer discounts
during adverse weather to stimulate demand.
Conclusion:
These insights help Walmart proactively manage stock and distribution, mitigating risks
associated with sudden demand changes due to external influences. Let me know if
you’d like further details on any of these points!
44
Supply Chain - Demand Forecasting with Machine Learning Group 1
REFERENCES
Index Citation
H, M. Y. (2021, December 26). Walmart dataset. Kaggle.
1
[Link]
Aldahmani, E., Alzubi, A., & Iyiola, K. (2024). Demand Forecasting
in Supply Chain Using Uni-Regression Deep Approximate
2
Forecasting Model. Applied Sciences, 14(18), 8110.
[Link]
Feizabadi, J. (2020). Machine learning demand forecasting and
3 supply chain performance. International Journal of Logistics
Research and Applications, 25(2), 1–24.
Carbonneau, R., Vahidov, R., & Laframboise, K. (2007). Machine
4 Learning-Based Demand Forecasting in Supply Chains.
International Journal of Intelligent Information Technologies, 3(4),
40–57. [Link]
GlobalData. (2022). Company Profile. GlobalData.
5
[Link]
Rickerby, M. (2020, January 4). Walmart supply chain: Winning at
6 inventory logistics. Extensiv.
[Link]
Choo, J. (2024, January 5). Walmart business strategy: A
comprehensive analysis. THE STRATEGY JOURNEY.
7
[Link]
comprehensive-analysis/#0-walmart-business-strategy-
Lövenich, A. (2024, September 23). The amazing supply chain of
8 Walmart. All Things Supply Chain - Supply Chain Trends, Best
Practices, News and Much More!; All Things Supply Chain.
45
Supply Chain - Demand Forecasting with Machine Learning Group 1
[Link]
of-walmart/
Thi Thu Ha, N. (2017). Wal-Mart’s Successfully Integrated
Supply Chain and the Necessity of Establishing the Triple-A Supply
9
Chain in the 21st Century. ResearchGate.
[Link]
Scikit-learn. (n.d.). [Link]. Scikit-
10
learn
11 Scikit-learn. (n.d.). Support vector machines. Scikit-learn.
Scikit-learn. (n.d.). Support vector machine regression example.
12
Scikit-learn
Scikit-learn. (n.d.). [Link].
13
Scikit-learn.
Newcastle University. (n.d.). Coefficient of determination: R-
14
squared. Newcastle University.
15 Statistics How To. (n.d.). Absolute error. Statistics How To
Frost, J. (n.d.). Mean squared error (MSE): Definition and
16
interpretation. Statistics By Jim
Frost, J. (n.d.). Root mean square error (RMSE): Definition and
17
interpretation. Statistics By Jim
46