International Journal of Computer Science & Information Technology (IJCSIT) Vol 17, No 6, December 2025
DOI: 10.5121/ijcsit.2025.17603 33
A DATA-DRIVEN PREDICTIVE FRAMEWORK FOR
INVENTORY OPTIMIZATION USING CONTEXT-
AUGMENTED MACHINE LEARNING MODELS
Anees Fatima and Mohammad Abdus Salam
Department of Computing, Information and Mathematical Science, and Technology
Chicago State University, Chicago, Illinois, USA
ABSTRACT
Demand forecasting in supply chain management (SCM) is critical for optimizing inventory, reducing
waste, and improving customer satisfaction. Conventional approaches frequently neglect external
influences like weather, festivities, and equipment breakdowns, resulting in inefficiencies. This research
investigates the use of machine learning (ML) algorithms to improve demand prediction in retail and
vending machine sectors. Four machine learning algorithms. Extreme Gradient Boosting (XGBoost),
Autoregressive Integrated Moving Average (ARIMA), Facebook Prophet (Fb Prophet), and Support Vector
Regression (SVR) were used to forecast inventory requirements. Ex-ternal factors like weekdays, holidays,
and sales deviation indicators were methodically incorporated to enhance precision. XGBoost surpassed
other models, reaching the lowest Mean Absolute Error (MAE) of 22.7 with the inclusion of external
variables. ARIMAX and Fb Prophet demonstrated noteworthy enhancements, whereas SVR fell short in
performance. Incorporating external factors greatly improves the precision of demand forecasting models,
and XGBoost is identified as the most efficient algorithm. This study offers a strong framework for
enhancing inventory management in retail and vending machine systems.
KEYWORDS
Machine Learning; Demand Forecasting; Inventory Management; XGBoost; Predictive Analytics
1. INTRODUCTION
Demand forecasting is a critical function within supply chain management, supporting efficient
inventory planning, cost reduction, and consistent service levels [1]. In sectors such as retail and
vending where consumer behaviour shifts rapidly accurate forecasts are especially important.
Traditional forecasting methods, however, rely mainly on historical sales and often overlook key
external factors, leading to unreliable predictions, stock imbalances, and increased operational
costs [2][3][4].
Recent developments in IoT and machine learning have reshaped forecasting practices. IoT-
enabled vending machines now provide continuous, real-time sales data, offering deeper insight
into consumption patterns and enabling faster, more informed replenishment decisions [5][6][7].
Machine learning models further enhance this process by incorporating diverse contextual
variables and identifying complex demand patterns that traditional approaches may miss. Despite
these advances, research focused specifically on ML-driven forecasting within vending machine
supply chains remains limited [8].
This study addresses this gap by evaluating four machine learning techniques XGBoost,
ARIMAX, Facebook Prophet, and Support Vector Regression to forecast demand for a
International Journal of Computer Science & Information Technology (IJCSIT) Vol 17, No 6, December 2025
34
warehouse supplying 1,500 vending machines. The models integrate external variables such as
weekday, public holiday, and sales-deviation indicators to assess their impact on predictive
accuracy [9][10][11]. The aim is to develop a tailored, context-aware forecasting framework that
reduces waste, enhances replenishment efficiency, and supports data-driven operational decision-
making [12][13].
By demonstrating the value of combining IoT data streams with advanced ML algorithms, this
research highlights significant opportunities for improving vending machine logistics. The
framework also holds broader relevance for retail and e-commerce sectors facing similar
forecasting challenges [14][15]. The remainder of the paper outlines the literature review (Section
2), dataset and methodology (Section 3), experimental results (Section 4), discussion (Section 5),
and conclusions with future research directions (Section 6).
2. MATERIALS AND METHODS
This section provides a detailed description of the materials and methods used in this study,
including data collection, preprocessing, feature engineering, and the implementation of machine
learning (ML) algorithms. The goal is to ensure reproducibility and transparency, allowing other
researchers to replicate and build upon the findings.
2.1. Gathering Information
The effectiveness of machine learning models in supply chain forecasting depends heavily on the
quality and completeness of the underlying data. This study uses the dataset originally compiled
by Sayyad et al. (2024), who developed a comprehensive predictive framework for e-commerce
supply chains using categorical boosting algorithms [3]. Their dataset consists of daily
transactional sales information structured around four core attributes - Date, Store ID, Item ID,
and Quantity Sold which collectively form the foundation for item-level demand forecasting.
These variables capture when a sale occurred, the location of the transaction, the specific product
involved, and the exact number of units sold, making them well-aligned with forecasting
requirements in retail and vending operations.
This dataset was adopted due to its relevance, depth, and alignment with the objectives of the
present research. Sayyad et al. ensured rigorous data collection and integrated essential
contextual variables such as public holidays, promotions, replenishment cycles, and demand
fluctuations, providing a strong basis for generating reliable and context-aware predictions [3]. In
addition to the primary transactional fields, the dataset supports derivation of meaningful
engineered features such as weekday indicators, lagged sales, cyclical time variables, and
anomaly-detection flags which enrich the modeling process and improve forecasting
performance.
Table 1 below summarizes the essential characteristics of the dataset as described in the
referenced work, highlighting its suitability for predictive inventory management and supply
chain forecasting.
International Journal of Computer Science & Information Technology (IJCSIT) Vol 17, No 6, December 2025
35
Table 1. Essential Characteristics of the Dataset (Adapted from Sayyad et al., 2024)
Feature Description
Data Source Transactional logs, market databases, internal inventory
systems
Collection Period January 2013 to December 2017 (5 years)
Number of Records Approximately 913,000 daily item-level sales records
Data Frequency Daily sales transactions
Primary Features Date, Store ID, Item ID, Quantity Sold
Engineered Features Holidays, promotional events, weekday/weekend
indicators
Feature Types Numerical (sales), categorical (store/item IDs, holidays),
cyclical (month/weekdays)
Data Preprocessing Steps Missing value interpolation, normalization, encoding
categorical variables
Intended Application Inventory demand forecasting for supply chain
optimization
Following Sayyad et al.’s recommended preprocessing methodology, the dataset underwent
normalization, cyclical encoding of time-based variables, and systematic handling of missing
values to improve data quality and model accuracy. These steps reduce inconsistencies and
enhance temporal coherence, supporting more reliable forecasting outcomes [3]. By leveraging
the rigorously collected dataset from Sayyad et al. (2024) and integrating the primary
transactional features with contextual enhancements, this study aligns with best practices and
strengthens the reliability and practical significance of its results.
2.2. Data Pre processing
After acquiring the dataset from Sayyad et al. (2024) [3], a systematic data preprocessing pipeline
was implemented to enhance data quality and ensure suitability for predictive modeling. This step
was crucial to improve model performance, minimize bias, and ensure temporal and categorical
consistency [1]. Handling missing or inconsistent values involved applying linear interpolation to
estimate intermediate sales points based on surrounding observations, while forward-fill
propagation was used to replace sequential gaps with the most recent valid entry. These methods
preserved the continuity of the time-series structure and maintained underlying demand patterns
essential for accurate forecasting. [1].
1. Data Grouping
The dataset was first explored and grouped by key identifiers such as store and item IDs.
These categorical variables were transformed using one-hot encoding to ensure
compatibility with machine learning models. This approach follows recommendations from
Mehmood et al. (2024) [6] and Qureshi et al. (2024) [4], who highlight that proper encoding
preserves data fidelity and enhances model interpretability.
2. Handling Product Data Interruptions
Lag features were generated to capture recent demand patterns and address temporal gaps in
sales data. Cyclical variables (e.g., month, weekday) were encoded using sine and cosine
transformations to preserve periodicity, following best practices outlined by Vollmer et al.
(2021) [5] and Dai and Huang (2021) [7].
3. Handling Missing Data
The dataset was thoroughly examined for missing or anomalous values, and gaps were
addressed using linear interpolation to estimate intermediate sales points and forward-fill
International Journal of Computer Science & Information Technology (IJCSIT) Vol 17, No 6, December 2025
36
methods to propagate the last valid observation. These techniques preserved temporal
continuity and maintained the underlying demand patterns essential for time-series
forecasting, aligning with established practices in supply chain data integrity research [4][9].
4. Chronological Ordering
To prepare the dataset for time-dependent modeling, records were sorted chronologically by
date. This step was essential to preserve the sequential nature of sales data, enabling
accurate lag creation, seasonal decomposition, and temporal training/testing splits. Proper
ordering ensures that model evaluation mimics real-world forecasting conditions, as
highlighted in supply chain forecasting studies [1][3].
Through these rigorous preprocessing strategies, the raw dataset was transformed into a refined
input format, facilitating the development of accurate and reliable machine learning models for
inventory demand forecasting.
2.3. Feature Engineering
Feature engineering enhances raw data by creating meaningful inputs that improve model
performance. In this study, features were created to capture contextual, behavioural, and temporal
signals relevant to demand fluctuations. The following variables were engineered based on
proven techniques in recent literature.
1. Weekday
A numeric weekday variable (0–6) was added to capture recurring weekly sales patterns.
Prior studies show that weekday encoding enhances forecasting reliability across domains.
Mehmood et al. (2024) and Qureshi et al. (2024) identified it as a key predictor in vending
and retail forecasting [4][6], while Sharma et al. (2022) and Shahzadi et al. (2024)
demonstrated its value in improving model adaptability to weekly operational cycles
[13][16].
2. Sales Deviation Flag
A binary flag was created to identify abnormal sales spikes or drops by comparing actual
sales to a rolling average threshold. This helped models detect anomalies caused by
unrecorded promotions, disruptions, or local events. Sayyad et al. (2024) showed that such
deviation markers increase responsiveness to retail shocks [3], while Agbemadon et al.
(2023) found that they enhance forecasting accuracy under uncertainty [8].
3. Public Holiday Indicator
A holiday indicator was generated using the holidays Python library, which marks official
Indian public holidays as binary flags. This helped capture systematic variations in demand
caused by national events. Studies by Vollmer et al. (2021), Dai and Huang (2021), and Ma
and Fildes (2021) all advocate including such exogenous variables to improve the accuracy
of models forecasting re-tail, healthcare, and emergency logistics demand [6][11][17].
2.4. Data Splitting
After feature engineering, the dataset was divided into training and testing subsets to enable
accurate evaluation of model performance [1]. Because the task involves time-series data, a
strictly chronological split was used: January 2013–July 2017 for training and August 2017–
December 2017 for testing. This approach mirrors real forecasting workflows and avoids using
future information during model training, as highlighted in recent studies [17][18]. Prior research
also confirms that temporal splits provide more realistic and unbiased forecasting assessments
[6][4].
International Journal of Computer Science & Information Technology (IJCSIT) Vol 17, No 6, December 2025
37
Table 2 summarizes the details of the data-splitting strategy clearly:
Table 2. Time-Based Data Splitting Approach
Data Partition Period Number of Records Purpose
Training Set Jan 2013 – July 2017 ~845,000 Model training and
hyperparameter tuning
Testing Set Aug 2017 – Dec 2017 ~68,000 Model evaluation and
predictive vali-dation
This structured approach to data splitting, based on recent forecasting research methodologies,
ensures robust model training, rigorous evaluation, and a realistic assessment of each model’s
predictive power under practical operational conditions [6][4].
2.5. Machine Learning Methods
This study evaluates four machine learning models selected based on their effective-ness and
appropriateness for complex inventory forecasting tasks in supply chain management scenarios.
These models include Extreme Gradient Boosting (XGBoost), Autoregressive Integrated Moving
Average with Exogenous variables (ARIMAX), Facebook Prophet, and Support Vector
Regression (SVR). Each model is briefly discussed below, along with a rationale for its selection,
hyperparameter configuration, and relevant literature references supporting its use.
o Extreme Gradient Boosting (XGBoost)
o XGBoost is a gradient boosting algorithm that builds sequential decision trees, with each
tree correcting prior errors, enhancing predictive accuracy. It is widely validated for
forecasting across industries such as retail, agriculture, and healthcare [1][3][13].
o Hyper-parameter Configuration: Number of estimators is set at 100 trees
(n_estimators=100), a learning rate of 0.1, and an L2 regularization term (lamb-da=0.1) to
prevent overfitting.
o Autoregressive Integrated Moving Average with Exogenous Inputs (ARIMAX)
o ARIMAX extends ARIMA by incorporating external (exogenous) variables. It models
historical trends through AR, I, and MA components while accounting for influential factors
such as holidays and promotions [11][17].
o Hyperparameter Configuration: Utilized parameters of Auto regressive order p=1,
differencing order d=0, and Moving Average order q=0.
o Facebook Prophet (Fb Prophet)
o Prophet is an open-source time-series model designed to capture complex trends,
seasonality, and event-driven effects such as holidays or promotions. Its decomposable
structure enables clear interpretation of components [6][7]. Recent studies highlight its
effectiveness and ease of use in various supply chain forecasting applications [4][8].
o Hyperparameter Configuration: Selected a multiplicative approach for modeling seasonality,
incorporated 25 changepoints for flexibility in capturing trend shifts, and set the predictive
confidence interval at 95%.
o Support Vector Regression (SVR)
o SVR is effective for nonlinear and complex demand patterns, making it suitable for dynamic
supply chain forecasting. Prior studies confirm its reliability when external variables are
included [2][5][8][9]
o Hyperparameter Configuration: The model used an RBF kernel to capture nonlinear
relationships, with a regularization constant C = 1.0 and an epsilon value ε = 0.1 defining
the acceptable deviation from predicted values.
International Journal of Computer Science & Information Technology (IJCSIT) Vol 17, No 6, December 2025
38
2.6. Model Evaluation
Effective evaluation is essential for verifying the machine learning model’s performance and is
often needed to be ascertaining its true predictive value and utility in actual situations. The
evaluation criteria have been crafted based on existing methods and practices in contemporary
literature on forecasting in the supply chain forecasting [1][2][3].
1. Mean Absolute Error (MAE)
o Mean Absolute Error (MAE) quantifies the average magnitude of prediction errors
without considering their direction, making it an intuitive and robust measure against
outliers [4][7][13]. Mathematically, MAE is defined as:
MAE = 1/n i=1∑n ∣yi−y^i∣
where
• n = number of observations,
• yi = actual observed value,
• y^i = model-predicted value
2. Root Mean Squared Error (RMSE)
o RMSE provides an evaluation metric emphasizing larger errors, making it
sensitive to significant prediction inaccuracies, which is critical in demand
forecasting scenarios [9][17][18]. RMSE is calculated as:
RMSE = √1/n i=1∑n (yi−y^i)²
3. Coefficient of Determination (R² Score)
o The R² score assesses the degree of variation in the dependent variable which is
brought about by independent variables. High R² values indicate good model
performance [12][14]:
o
R² = 1 - SSres/SStot
where
 SSres: Residual sum of squares (unexplained variance)
 SStot: Total variance in observed data
Table 3 summarizes these metrics and their implications for vending machine demand
forecasting.
Table 3. Model Performance Metrics
Metric Formula Interpretation
MAE (Mean Absolute Error) ⅟n ∑∥yi−y^i∥ Tracks average error in units, critical for
perishable inventory.
RMSE (Root Mean Squared
Error)
√⅟n ∑(yi−y^i)2 Highlights severe over/under-predictions
that disrupt restocking efficiency.
R² Score (Coefficient of
Determination)
R2=1−SSres/SStot Reveals how well external factors (e.g.,
weather) explain demand volatility.
International Journal of Computer Science & Information Technology (IJCSIT) Vol 17, No 6, December 2025
39
To ensure robust and unbiased evaluation, the dataset was partitioned chronologically (time-
based) into training and testing sets, aligning with practices suggested by recent forecasting
research [19]. By adopting this methodology, the evaluation accurately reflects the model's ability
to forecast future demand based solely on historical patterns and external features.
Overall, the chosen evaluation metrics - MAE, RMSE, and R² - combined with a rigorous data-
splitting strategy, ensure comprehensive and reliable assessments of each model’s performance,
as consistently recommended in contemporary forecasting and predictive analytics literature.
2.7. Implementation Framework
Developing an accurate and reliable predictive model for inventory demand forecasting requires a
structured framework that spans across several key stages. This section outlines the
implementation approach used in this study, organized into the following categories: Data
Infrastructure, Modeling & Deployment, and Monitoring & Visualization. Each step aligns with
best practices supported by recent research in predictive analytics and supply chain management
[1][12].
A. Data Infrastructure
The foundation of this study's implementation began with a clear definition of forecasting goals
and data specifications, reflecting the structured framework proposed by Sayyad et al. (2024) for
supply chain predictive tasks [3]. The data acquisition process used a pre-collected dataset as
provided in Sayyad et al. (2024), followed by meticulous cleaning and preprocessing procedures
in line with Mehmood et al. (2024) and Qureshi et al. (2024) [2][4].
Key preprocessing actions included:
o Handling missing values via linear interpolation and forward-fill [2].
o Encoding categorical variables through one-hot encoding [4].
o Normalizing numerical features with Min-Max scaling [3].
o Transforming cyclical features (e.g., months, weekdays) using sine and cosine functions
[8][5].
o Constructing lag features to capture temporal dependencies [9].
These practices ensured the dataset was accurate, comprehensive, and suitable for time-series
modeling, thus forming a solid data infrastructure for the project.
B. Modeling & Deployment
Once pre-processing was complete, the dataset was partitioned using a temporal data-splitting
strategy, where records from January 2013 to July 2017 were used for training and records from
August 2017 to December 2017 were reserved for testing. This time-based approach avoids data
leakage and mirrors real-world deployment scenarios [10][12][19].
The machine learning models selected for deployment included XGBoost, ARIMAX, Facebook
Prophet, and Support Vector Regression (SVR) - all widely recognized in the literature for their
high performance in forecasting tasks [13][14][20].
To optimize each model’s performance:
International Journal of Computer Science & Information Technology (IJCSIT) Vol 17, No 6, December 2025
40
o Hyper-parameters for XGBoost were tuned using best practices (e.g., learning rate,
estimators, L2 regularization) [6][21].
o Facebook Prophet’s seasonal change-points and seasonality mode were adjusted to
enhance accuracy [22].
The deployment phase ensured that all models were robustly implemented with validated
parameter configurations for maximum predictive effectiveness.
C. Monitoring & Visualization
To ensure model accuracy and reliability, performance was continuously evaluated using Mean
Absolute Error (MAE), Root Mean Squared Error (RMSE), and R² Score. These metrics are
validated across the forecasting literature and provide a comprehensive view of model accuracy
and predictive power [16][18][23].
Following evaluation, models were compared using side-by-side metric analysis. The best-
performing model was selected based on a combination of interpret-ability, accuracy, and
practical application, as recommended in decision frameworks from Pournader et al. (2022), Wu
et al. (2022), and others [24][25].
The entire implementation pipeline is visually summarized in Figure 1, showcasing the
integration of data preparation, modeling, evaluation, and final selection stages.
Figure 1. Comprehensive Predictive Model Implementation Framework.
By following this implementation framework, the research ensured that each stage, from data
handling to deployment and performance monitoring was rigorously aligned with academic and
International Journal of Computer Science & Information Technology (IJCSIT) Vol 17, No 6, December 2025
41
industry standards. This comprehensive structure not only strengthens the study's predictive
capabilities but also enhances its practical value for broader applications in demand forecasting
and supply chain optimization [11].
2.8. Ethical & Compliance Safeguards
To ensure responsible AI deployment
 Privacy by Design: All customer transaction data was anonymized at ingestion, stripping
identifiers (e.g., payment tokens, location fingerprints) before analysis.
 Regulatory Adherence: Compliance with GDPR [13] and industry standards was
enforced through
o Data Minimization: Only essential features were retained.
o Audit Trails: Access logs and model decisions were archived for accountability.
 Bias Mitigation: Training data was audited for representativeness across machine
locations (e.g., urban vs. rural) to prevent geographic skew.
3. RESULTS
This section presents the results of the experiments conducted to evaluate the performance of the
four-machine learning (ML) algorithms - XGBoost, ARIMAX, Facebook Prophet (Fb Prophet),
and Support Vector Regression (SVR) - in predicting inventory needs for a vending machine
warehouse. The results are divided into two scenarios: Scenario #1, where predictions were made
using only historical sales data, and Scenario #2, where external variables (weekday, public
holiday, and sales deviation flag) were systematically introduced to assess their impact on
prediction accuracy. The performance of each model was evaluated using the Mean Absolute
Error (MAE) metric.
3.1. Scenario 1: Without External Variables
Scenario 1 assessed XGBoost, ARIMAX, Facebook Prophet, and SVR using only historical sales
data to establish a baseline, excluding external variables like holidays, weekdays, or deviation
flags. This approach measures the models’ intrinsic ability to capture demand patterns
[1][12][13].
Figure 2. Demand Trend Analysis (Actual vs. Predicted).
Figure 2 illustrates the comparison between actual sales and the predictions generated under
Scenario 1. As shown, all four models struggle to capture sudden fluctuations and peak demand
periods, confirming that historical data alone is insufficient for stable forecasting. The visible
International Journal of Computer Science & Information Technology (IJCSIT) Vol 17, No 6, December 2025
42
deviations in Figure 2 support the performance metrics reported later and justify the need for
external contextual variables. [11][14][15].
3.2. Scenario 2: Impact of External Variables on Forecasting Performance
This scenario extends the baseline model by introducing external variables to assess their impact
on forecasting performance. External variables such as weekday, holiday indicators, and sales
deviation flags were included to enhance the model’s contextual understanding. Prior studies in
retail and supply chain analytics have demonstrated the significant influence of such features in
improving predictive accuracy [2][13][15].
Figure 3. Feature Importance Ranking (XGBoost Model).
The relative contribution of each engineered feature is presented in Figure 3. The XGBoost
feature importance ranking revealed the following relative contributions:
o Sales_Deviation_Flag showed the highest impact (~0.175 importance score)
o Weekday was the second most influential (~0.125 score)
o Public_Holiday demonstrated a moderate influence (~0.075 score)
o Weather_Index, Previous_Sales, Promotion had marginal contributions (<0.05 scores
each)
The feature importance plot clearly shows that the sales deviation flag and weekday variables
exert the greatest influence on model output, highlighting their critical role in correcting
anomalies and capturing periodic demand behaviors. Sales deviation flags were added to capture
abnormal demand fluctuations, following Sayyad et al. (2024) [3]. Binary indicators for public
holidays and weekends were also included, consistent with Mehmood et al. (2024) and Qureshi et
al. (2024), improving forecast stability [2][4]. Cyclical features like day-of-week and month were
encoded with sine and cosine transformations to capture periodic demand patterns, as
recommended by Vollmer et al. (2021) and Dai and Huang (2021) [13][19]. All models -
XGBoost, ARIMAX, Facebook Prophet, and SVR were retrained using identical parameters and
splits to ensure comparability [1][12]. External variables dominated overall feature importance
(~80%), with the Sales_Deviation_Flag contributing 2.3× more than Weekday, reinforcing the
improved accuracy observed in Scenario 2.
1. Temporal Patterns (Weekday Variable)
 Performance Lift: All models showed improved accuracy, though with varying
degrees
International Journal of Computer Science & Information Technology (IJCSIT) Vol 17, No 6, December 2025
43
o XGBoost: 15% MAE reduction (46.13 → 39.2)
o ARIMAX: 3.6% improvement (41.6 → 40.1)
o Prophet/SVR: <2% change (stable around 38-40 MAE)
 Operational Insight: Particularly valuable for office-located machines, where
weekday sales averaged 2.3× weekend volumes. The variable helped anticipate the
"Monday coffee surge" and "Friday snack dips" patterns.
2. Event-Driven Demand (Public Holiday)
 Model Response
o XGBoost: 7.5% MAE increase (counterintuitive due to overcorrection)
o ARIMAX: 3.8% performance degradation
o Prophet: Showed resilience with only 1.8% MAE change
 Key Finding: Holiday impacts varied dramatically by location type - airport
machines saw 22% sales boosts while corporate park units dropped to 40% of normal
volume. Only Prophet's multiplicative seasonality handled this spatial variance
effectively.
3. Operational Anomalies (Sales Deviation Flag)
 Breakthrough Improvement
o XGBoost: 37% MAE drop (42.15 → 26.6)
o ARIMAX: 27% improvement (41.62 → 30.26)
o SVR: 24% gain (42.42 → 32.1)
1. Critical Value: This binary flag (activated when sales fell below 30% of rolling
average) helped models distinguish between true demand shifts and machine outages
- explaining 89% of outlier events in validation data.
4. Synergistic Effects (All Variables Combined)
The full external feature set unlocked each algorithm's potential differently
o XGBoost achieved peak performance (22.7 MAE, 51% better than baseline),
demonstrating exceptional feature synthesis capability
o ARIMAX showed strong temporal adaptation (26.9 MAE, 35% improvement)
o Prophet plateaued (37.7 MAE) due to inherent holiday handling limitations
o SVR struggled with high-dimensional interactions (37.8 MAE)
Practical Implications:
 Maintenance logs should be integrated with forecasting systems in real-time
 Location-specific holiday profiles could yield additional 4-7% accuracy gains
 The "weekday" variable's diminishing returns suggest opportunity for more granular
intra-day periodicity features
International Journal of Computer Science & Information Technology (IJCSIT) Vol 17, No 6, December 2025
44
This analysis shows that all models gain accuracy from contextual variables, though the extent
varies according to each model’s architecture a key consideration for inventory optimization in
autonomous retail systems. The results indicate clear performance improvements, as external
factors helped explain variations not captured by historical sales alone. These findings align with
prior research highlighting the importance of rich feature sets for accurate forecasting in dynamic
supply chains [7][9][15].
3.3. Visualization of Results
To provide a clearer understanding of the models' performance, the actual and predicted sales
quantities were visualized for each model in both scenarios.
1. Scenario #1 (Without External Variables)
o The predictions from Fb Prophet closely followed the actual sales trends,
demonstrating its ability to capture seasonality and trends without external variables
[12].
o XGBoost and ARIMAX showed larger deviations from the actual values, particularly
during periods of high sales volatility.
o SVR produced consistent predictions but failed to capture sudden spikes or drops in
sales [2].
2. Scenario #2 (With External Variables)
o The predictions from XGBoost showed a significant improvement, closely aligning
with the actual sales trends. The inclusion of external variables al-lowed the model to
better capture anomalies and temporal patterns [4].
o ARIMAX also showed improved performance, with predictions that more accurately
reflected actual sales [14].
o Fb Prophet and SVR showed slight improvements, but their predictions still deviated
from actual values during periods of high volatility.
The results of both scenarios are summarized in Table 4 below
Table 4. Scenario 1 vs Scenario 2 Model Performance
Algorithm Scenario #1 (No External
Variables)
Scenario #2 (With External
Variables)
XGBoost 46.13 22.7
ARIMAX 41.6 26.9
Fb Prophet 38.8 37.7
SVR 40.02 37.8
Key Findings
Table 4 summarizes the MAE values for all models across both scenarios and clearly
demonstrates the performance gains achieved when external variables are introduced. XGBoost
shows the largest reduction in error (46.13 to 22.7), followed by ARIMAX, which also benefits
substantially (41.6 to 26.9). Prophet and SVR show only moderate improvements, consistent with
the more limited alignment observed in their visual predictions in Figures 2 and 3. These results
indicate that historical sales alone were insufficient for handling high-demand fluctuations in
Scenario 1, where predicted values deviated significantly from actuals, particularly during sharp
International Journal of Computer Science & Information Technology (IJCSIT) Vol 17, No 6, December 2025
45
spikes. In contrast, Scenario 2 produced predictions that were far more closely aligned with
actual sales, especially around holidays and weekends, demonstrating the added value of
contextual feature integration. This pattern aligns with prior research emphasizing the importance
of incorporating domain-relevant variables in forecasting models [4][12]. Feature importance
results from XGBoost further confirm that weekday, holiday flags, and sales deviation indicators
played a dominant role in improving predictive accuracy, consistent with findings from Sayyad et
al. (2024) and Mehmood et al. (2024) [2][3]. Additionally, residual histograms reveal narrower
and more centered error distributions for models using external variables, supporting the
quantitative improvements and aligning with literature advocating the use of graphical
diagnostics for model interpretability and validation [6][7][9].
3.4. Comparative Analysis
Table 5 compares the performance of Linear Regression, Random Forest, and XGBoost in terms
of MAE, RMSE, R² Score, and training time. It highlights the superior performance of XGBoost
in terms of accuracy and efficiency [7].
Table 5. Model Performance Comparison
Algorithm Scenario #1 (No External
Variables)
Scenario #2 (With External
Variables)
XGBoost 46.13 22.7
ARIMAX 41.6 26.9
Fb Prophet 38.8 37.7
Figure 4. Demand Forecasting Performance Comparison.
Figure 4 compares actual versus predicted sales for Linear Regression, Random Forest, and
XGBoost, showing XGBoost best captures trends and anomalies [7]. Across scenarios, XGBoost
achieved the lowest MAE and RMSE and the highest R², particularly when external variables
were included. Prophet and ARIMAX performed well but were sensitive to data sparsity, while
SVR struggled with complex seasonality [1][3][12].
International Journal of Computer Science & Information Technology (IJCSIT) Vol 17, No 6, December 2025
46
XGBoost’s ensemble approach effectively handles non-linear relationships and heterogeneous
features, assigning higher weights to influential variables. These results reinforce prior research
showing gradient boosting models outperform traditional regressors in retail and supply chain
forecasting, emphasizing the value of feature richness [7][9][13][15].
3.5. Error Distribution Analysis
Error distribution analysis was performed to understand how each model handled overprediction
and underprediction. In Scenario 1, models exhibited wider error distributions, with a higher
frequency of large deviations. This indicates that models relying solely on historical sales
struggled to capture sudden shifts in demand. SVR, in particular, showed a skewed error
distribution, reflecting its difficulty in generalizing from sparse and noisy data.
Figure 5. Prediction Error Distribution.
Figure 5 illustrates the distribution of prediction errors for each model, showing that XGBoost
has the narrowest distribution, reflecting more consistent and accurate forecasts than Linear
Regression and Random Forest.
In Scenario 2, incorporating external variables reduced both the magnitude and variance of
prediction errors. Prophet and ARIMAX also showed improved residual symmetry, though they
struggled with sharp demand spikes. Narrow, centered error distributions are associated with
better generalization and stable performance under dynamic conditions [6][7][9][10][12][15].
Overall, residual analysis confirms that XGBoost is the most reliable model for inventory
forecasting, minimizing large prediction errors and enhancing operational efficiency across
varying demand scenarios.
4. DISCUSSION
The results of this study provide valuable insights into the application of machine learning (ML)
algorithms for demand forecasting in the vending machine industry. The findings highlight the
importance of incorporating external variables into predictive models and demonstrate the
superior performance of XGBoost when these variables are included. Below, we discuss the
implications of these findings, their alignment with previous research, and their broader
significance for supply chain management (SCM).
4.1. Role of External Variables in Demand Forecasting
Including external variables weekday, public holiday, and sales-deviation flags greatly improved
prediction accuracy. These features helped models capture daily patterns, holiday effects, and
anomalies from machine issues, outperforming approaches that rely only on historical sales.
International Journal of Computer Science & Information Technology (IJCSIT) Vol 17, No 6, December 2025
47
XGBoost and ARIMAX especially benefited, showing higher accuracy and stronger feature
responsiveness. Overall, adding external context leads to more reliable forecasts and better
inventory management.
4.2. Performance of Machine Learning Algorithms
The study evaluated four ML algorithms - XGBoost, ARIMAX, Facebook Prophet (Fb Prophet),
and Support Vector Regression (SVR) - and found that XGBoost outperformed the other models
when external variables were included. Below, we discuss the strengths and limitations of each
algorithm in the context of demand forecasting.
1. XGBoost
Strengths: Achieved the lowest MAE (22.7) when external variables were included,
effectively handling complex relationships and iteratively correcting errors [7].
Limitations: Relied heavily on additional features; performance was weaker in
Scenario 1 without external variables [7].
2. ARIMAX
Strengths: MAE improved from 41.6 to 26.9 with external variables, leveraging
exogenous inputs for robust time-series forecasting [8].
Limitations: Lagged behind XGBoost in non-linear settings due to its linear structure
[8].
3. Facebook Prophet
Strengths: Handled trends, seasonality, and holiday effects without external features
(MAE 38.8 → 37.7), making it robust for general time-series forecasting [9].
Limitations: Limited improvement from external variables, indicating
underutilization of additional inputs [9].
4. SVR
Strengths: Maintained consistent performance across scenarios (MAE 40.02 → 37.8),
robust to outliers and non-linear relationships [10].
Limitations: Computationally intensive and sensitive to hyperparameter tuning;
lower accuracy than XGBoost and ARIMAX [10].
4.3. Consequences for Supply Chain Management
Integrating external features with ML models like XGBoost, ARIMAX, and Prophet improved
forecast accuracy in supply chains. Compared to traditional methods, these models better
captured non-linear and seasonal patterns, reducing overstocking and stockouts, enhancing shelf
availability, and enabling proactive SKU-level inventory management, demonstrating the value
of data-driven forecasting [2][3][4][7][9][10].
International Journal of Computer Science & Information Technology (IJCSIT) Vol 17, No 6, December 2025
48
Table 6. Inventory Optimization Impact
Metric Before ML
Implementation
After ML
Implementation
Improvement (%)
Overstock Rate 15% 5% 66.7% Reduction
Stockout Rate 12% 3% 75% Reduction
Forecast
Accuracy
75% 92% 22.7% Increase
Cost Savings N/A +20% Functional Effectiveness
Baseline inventory performance in vending machine supply chains relied on conventional
heuristics, such as trend averages or lagged sales, which often overlooked contextual factors like
weather, holidays, and weekday effects [1][3][11][16]. This resulted in inefficiencies, reflected in
a 15% overstock rate, a 12% stockout rate, and an overall forecast accuracy of only 75% patterns
consistent with prior studies highlighting misaligned inventory across product categories
[1][10][14]. The practical implications of improved forecasting accuracy are presented in Table
6, where the incorporation of machine learning models shows a substantial reduction in
overstocking by 66.7% and stockouts by 75%. These improvements demonstrate the tangible
operational value of the proposed forecasting approach and confirm that enhanced predictive
accuracy directly leads to measurable supply chain efficiencies.
After implementing advanced ML models - XGBoost, ARIMAX, SVR, and Facebook Prophet
with exogenous variables, forecasting accuracy increased to 92%, corresponding to the
significant reductions in overstock and stockout rates summarized in Table 6. These gains
underscore the importance of integrating temporal and contextual features into model
development, allowing for more accurate and responsive inventory planning. Additionally, nearly
20% cost savings were realized through reduced holding costs, fewer emergency replenishments,
and more efficient resource utilization, echoing outcomes reported in similar ML-driven supply
chain applications [20]. Overall, the results illustrate a clear progression from reactive forecasting
practices toward a proactive, data-driven inventory management strategy.
4.4. Limitations and Future Research Directions
Dataset Limitations: The study relied on historical sales and a limited set of external features
(holidays, weekdays, sales deviations). Incorporating additional variables such as weather,
promotions, or economic indicators could further improve model accuracy, as prior research has
shown [3][4][14].
Federated Learning: Models were trained on a single dataset with a fixed temporal split, which
may limit generalizability across regions or sales channels. Expanding to multi-regional or multi-
channel datasets could enhance robustness [12][15].
Advanced Models: While MAE and RMSE indicated strong performance, explainability
techniques such as SHAP or LIME were not applied. Future work should integrate explainable AI
(XAI) tools to clarify feature contributions and support data-driven decision-making in supply
chain operations [6][13].
Real-Time Forecasting: This study did not address real-time deployment or continuous learning.
Incorporating streaming data and feedback loops could maintain model relevance in dynamic
environments, as supported by recent adaptive analytics research [16][17].
International Journal of Computer Science & Information Technology (IJCSIT) Vol 17, No 6, December 2025
49
4.5. Cross-Industry Implications and Technological Transformation
The methodologies and findings from this study extend beyond vending machine inventory
management and are applicable to industries such as retail, healthcare, agriculture, and
manufacturing. These sectors face similar challenges, including demand volatility, seasonal
trends, and supply constraints, which can be effectively addressed using machine learning models
enhanced with external variables [12][14][15].
In retail and e-commerce, integrating promotional calendars, weather forecasts, and customer
footfall data improves inventory control, reduces markdowns, and optimizes shelf stocking
[3][5]. In healthcare, accurate forecasting supports medical supply management, patient inflow
prediction, and staffing optimization during holidays or public health emergencies [10][23]. IoT-
driven frameworks, combined with proactive maintenance and edge computing, further enhance
operational efficiency and reduce downtime in smart warehouses [22].
Emerging markets such as pharmaceuticals and agriculture also benefit from ML-driven
forecasts. ARIMAX with environmental variables can minimize spoilage in vaccine logistics,
while crop demand and fertilizer management are improved through weather, soil, and
commodity data inputs [21][23][26]. Overall, ML and AI facilitate a shift toward proactive,
predictive, and autonomous supply chains [13][16][17].
5. CONCLUSION
This study demonstrates that the integration of external variables significantly enhances the
accuracy of demand forecasting models, with XGBoost emerging as the most effective algorithm.
The findings provide a robust framework for optimizing inventory management in the vending
machine industry, with potential applications in retail, e-commerce, and other sectors. Future
research should explore advanced models, federated learning, and real-time forecasting to further
improve prediction accuracy and operational efficiency.
ACKNOWLEDGEMENTS
The authors would like to thank everyone, just everyone!
REFERENCES
[1] D. Ni, Z. Xiao, and M. K. Lim, "A systematic review of the research trends of machine learning in
supply chain man-agement," Int. J. Mach. Learn. Cybern., vol. 11, no. 7, pp. 1463–1482, Jul. 2020.
[2] U. Mehmood et al., "Machine Learning-Based Predictive Inventory for a Vending Machine
Warehouse," IEEE Internet of Things Magazine, 2024.
[3] J. K. Sayyad et al., "Optimizing e-Commerce Supply Chains With Categorical Boosting: A Predictive
Modeling Frame-work," IEEE Access, 2024.
[4] N. U. H. Qureshi et al., "Demand Forecasting in Supply Chain Management for Rossmann Stores
Using Weather En-hanced Deep Learning Model," IEEE Access, 2024.
[5] B. Huang, "Research on optimization of e-commerce supply chain management process based on
Internet of Things technology," Journal of Physics: Conference Series, vol. 2074, no. 1, 2021.
[6] M. M. Taye, "Understanding of machine learning with deep learning: Architectures, workflow,
applications and future directions," Computers, vol. 12, no. 5, p. 91, 2023.
[7] K. B. Agbemadon, R. Couturier, and D. Laiymani, "Over Stock Prediction Using Machine Learning
in Retail Industry," 2023 3rd International Conference on Computer, Control and Robotics (ICCCR),
2023.
International Journal of Computer Science & Information Technology (IJCSIT) Vol 17, No 6, December 2025
50
[8] H. Hewamalage, C. Bergmeir, and K. Bandara, "Recurrent neural networks for time series
forecasting: Current status and future directions," Int. J. Forecasting, vol. 37, no. 1, pp. 388–427,
2021.
[9] S. Ma and R. Fildes, "Retail Sales Forecasting with Meta-Learning," European Journal of Operational
Research, vol. 288, no. 1, 2021.
[10] M. A. C. Vollmer et al., "A Unified Machine Learning Approach to Time Series Forecasting Applied
to Demand at Emergency Departments," BMC Emergency Medicine, vol. 21, 2021.
[11] P. Helo and Y. Hao, "Artificial intelligence in operations management and supply chain management:
An exploratory case study," Prod. Planning Control, vol. 33, no. 16, pp. 1573–1590, 2022.
[12] R. Sharma et al., "The role of artificial intelligence in supply chain management: Mapping the
territory," Int. J. Prod. Res., vol. 60, no. 24, pp. 7527–7550, 2022.
[13] H. Allioui and Y. Mourdi, "Unleashing the potential of AI: Investigating cutting-edge technologies
that are transforming businesses," Int. J. Comput. Eng. Data Sci., vol. 3, no. 2, pp. 1–12, 2023.
[14] M. Yang et al., "Supply chain risk management with machine learning technology: A literature
review and future re-search directions," Comput. Ind. Eng., vol. 175, 2023.
[15] G. Shahzadi, F. Jia, L. Chen, and A. John, ‘‘AI adoption in supply chain management: A systematic
literature review,’’ J. Manuf. Technol. Manage., Jul. 2024.
[16] M. Pournader, H. Ghaderi, A. Hassanzadegan, and B. Fahimnia, Artificial intelligence applications in
supply chain management,’ Int. J. Prod. Econ., vol. 241, Feb. 2021, Art. no. 108250.
[17] R. G. Richey, S. Chowdhury, B. Davis-Sramek, M. Giannakis, and Y. K. Dwivedi, Artificial
intelligence in logistics and supply chain management: A primer and roadmap for research,’ J. Bus.
Logistics, vol. 44, no. 4, pp. 532–549, Oct. 2023.
[18] J. Li, X. Yan, Y. Li, and X. Dong, ‘‘Optimizing the agricultural supply chain through e-commerce: A
case study of Tu-douec in Inner Mongolia, China,’’ Int. J. Environ. Res. Public Health, vol. 20, no. 5,
p. 3775, Feb. 2023
[19] Y. Dai and J. Huang, A sales prediction method based on LSTM with hyper-parameter search,’’ J.
Phys., Conf. Ser., vol. 1756, no. 1, Feb. 2021, Art. no. 012015.
[20] H. Fatorachian and H. Kazemi, ‘‘Impact of industry 4.0 on supply chain performance,’’ Prod.
Planning Control, vol. 32, no. 1, pp. 63–81, 2021.
[21] P. Toktaş-Palut, ‘‘Analyzing the effects of industry 4.0 technologies and coordination on the
sustainability of supply chains,’’ Sustain. Prod. Consumption, vol. 30, pp. 341–358, Mar. 2022.
[22] R. Setiawan, R. Salman, B. G. Khairov, V. V. Karpov, S. D. Danshina, L. V. Vasyutkina, N. A.
Prodanova, V. Zhenzhebir, E. Nuyanzin, N. Kapustina, and A. H. Kalajahi, ‘‘Sustainable closed-loop
mask supply chain network design using mathematical modeling and a fuzzy multiobjective
approach,’’ Sustainability, vol. 13, no. 10, p. 5353, May 2021.
[23] N. P. Kumar et al., “Machine Learning Based Predictive Analytics for Agriculture Inventory
Management System,” 2022 4th Int’l. Conf. Cognitive Computing and Information Processing
(CCIP), Bengaluru, India, 2022.
[24] M. Ma, L. Shen, and X. Sun, ‘‘Optimization of e-commerce logistics service quality considering
multiple consumption psychologies,’’ Frontiers Psychol., vol. 13, Sep. 2022, Art. no. 956418.
[25] P. Wu, A. Andreev, and M. Benyoucef, "The state of lead scoring models and their impact on sales
performance," In-formation Technology and Management, vol. 25, no. 1, pp. 69–98, Mar. 2024.
[26] P. K. Detwal, R. Agrawal, A. Samadhiya, A. Kumar, and J. A. GarzaReyes, ‘‘Research developments
in sustainable supply chain management considering optimization and industry 4.0 techniques: A
systematic review,’’ Benchmarking, Int. J., vol. 31, no. 4, pp. 1249–1269, May 2024.
AUTHORS
Anees Fatima is a Master’s student in Computer Science in the Department of
Computing, Information and Mathematical Sciences and Technology (CIMST) at
Chicago State University. With more than eight years of professional experience as a
Senior Software Engineer, she possesses a strong background in full-stack
development, cloud computing, and DevOps methodologies. Her academic and
professional interests include artificial intelligence, machine learning, cybersecurity,
and modern software engineering practices. She has contributed to multiple research
areas, including the application of AI in education, immersive technologies such as augmented and virtual
reality, and human computer interaction. Her work investigates how intelligent systems and emerging
International Journal of Computer Science & Information Technology (IJCSIT) Vol 17, No 6, December 2025
51
technologies can enhance user experiences, improve security, and support data-driven decision-making.
Driven by a passion for innovation, she integrates her industry expertise with academic research to design
scalable, secure, and impactful technological solutions.
Dr. Mohammad Abdus Salam serves as the Chairperson of the Department of
Computing, Information and Mathematical Sciences, and Technology (CIMST) at
Chicago State University (CSU). With over 20 years of extensive teaching and
research experience, Dr. Salam previously held a professorship in Computer Science at
Southern University in Baton Rouge, Louisiana. His research expertise spans wireless
sensor networks, wireless communication, information and coding theory, data
visualization, machine learning, and cybersecurity. He has taught a wide array of
computer science and engineering courses and has contributed significantly to scholarly literature,
authoring numerous journal articles and conference proceedings. In addition, he has served as a guest editor
for multiple academic journals and as a panellist for esteemed organizations like NSF, NASA, and various
international conferences. He is a member of ACM and a senior member of IEEE.

A Data-Driven Predictive Framework for Inventory Optimization using Context-Augmented Machine Learning Models

  • 1.
    International Journal ofComputer Science & Information Technology (IJCSIT) Vol 17, No 6, December 2025 DOI: 10.5121/ijcsit.2025.17603 33 A DATA-DRIVEN PREDICTIVE FRAMEWORK FOR INVENTORY OPTIMIZATION USING CONTEXT- AUGMENTED MACHINE LEARNING MODELS Anees Fatima and Mohammad Abdus Salam Department of Computing, Information and Mathematical Science, and Technology Chicago State University, Chicago, Illinois, USA ABSTRACT Demand forecasting in supply chain management (SCM) is critical for optimizing inventory, reducing waste, and improving customer satisfaction. Conventional approaches frequently neglect external influences like weather, festivities, and equipment breakdowns, resulting in inefficiencies. This research investigates the use of machine learning (ML) algorithms to improve demand prediction in retail and vending machine sectors. Four machine learning algorithms. Extreme Gradient Boosting (XGBoost), Autoregressive Integrated Moving Average (ARIMA), Facebook Prophet (Fb Prophet), and Support Vector Regression (SVR) were used to forecast inventory requirements. Ex-ternal factors like weekdays, holidays, and sales deviation indicators were methodically incorporated to enhance precision. XGBoost surpassed other models, reaching the lowest Mean Absolute Error (MAE) of 22.7 with the inclusion of external variables. ARIMAX and Fb Prophet demonstrated noteworthy enhancements, whereas SVR fell short in performance. Incorporating external factors greatly improves the precision of demand forecasting models, and XGBoost is identified as the most efficient algorithm. This study offers a strong framework for enhancing inventory management in retail and vending machine systems. KEYWORDS Machine Learning; Demand Forecasting; Inventory Management; XGBoost; Predictive Analytics 1. INTRODUCTION Demand forecasting is a critical function within supply chain management, supporting efficient inventory planning, cost reduction, and consistent service levels [1]. In sectors such as retail and vending where consumer behaviour shifts rapidly accurate forecasts are especially important. Traditional forecasting methods, however, rely mainly on historical sales and often overlook key external factors, leading to unreliable predictions, stock imbalances, and increased operational costs [2][3][4]. Recent developments in IoT and machine learning have reshaped forecasting practices. IoT- enabled vending machines now provide continuous, real-time sales data, offering deeper insight into consumption patterns and enabling faster, more informed replenishment decisions [5][6][7]. Machine learning models further enhance this process by incorporating diverse contextual variables and identifying complex demand patterns that traditional approaches may miss. Despite these advances, research focused specifically on ML-driven forecasting within vending machine supply chains remains limited [8]. This study addresses this gap by evaluating four machine learning techniques XGBoost, ARIMAX, Facebook Prophet, and Support Vector Regression to forecast demand for a
  • 2.
    International Journal ofComputer Science & Information Technology (IJCSIT) Vol 17, No 6, December 2025 34 warehouse supplying 1,500 vending machines. The models integrate external variables such as weekday, public holiday, and sales-deviation indicators to assess their impact on predictive accuracy [9][10][11]. The aim is to develop a tailored, context-aware forecasting framework that reduces waste, enhances replenishment efficiency, and supports data-driven operational decision- making [12][13]. By demonstrating the value of combining IoT data streams with advanced ML algorithms, this research highlights significant opportunities for improving vending machine logistics. The framework also holds broader relevance for retail and e-commerce sectors facing similar forecasting challenges [14][15]. The remainder of the paper outlines the literature review (Section 2), dataset and methodology (Section 3), experimental results (Section 4), discussion (Section 5), and conclusions with future research directions (Section 6). 2. MATERIALS AND METHODS This section provides a detailed description of the materials and methods used in this study, including data collection, preprocessing, feature engineering, and the implementation of machine learning (ML) algorithms. The goal is to ensure reproducibility and transparency, allowing other researchers to replicate and build upon the findings. 2.1. Gathering Information The effectiveness of machine learning models in supply chain forecasting depends heavily on the quality and completeness of the underlying data. This study uses the dataset originally compiled by Sayyad et al. (2024), who developed a comprehensive predictive framework for e-commerce supply chains using categorical boosting algorithms [3]. Their dataset consists of daily transactional sales information structured around four core attributes - Date, Store ID, Item ID, and Quantity Sold which collectively form the foundation for item-level demand forecasting. These variables capture when a sale occurred, the location of the transaction, the specific product involved, and the exact number of units sold, making them well-aligned with forecasting requirements in retail and vending operations. This dataset was adopted due to its relevance, depth, and alignment with the objectives of the present research. Sayyad et al. ensured rigorous data collection and integrated essential contextual variables such as public holidays, promotions, replenishment cycles, and demand fluctuations, providing a strong basis for generating reliable and context-aware predictions [3]. In addition to the primary transactional fields, the dataset supports derivation of meaningful engineered features such as weekday indicators, lagged sales, cyclical time variables, and anomaly-detection flags which enrich the modeling process and improve forecasting performance. Table 1 below summarizes the essential characteristics of the dataset as described in the referenced work, highlighting its suitability for predictive inventory management and supply chain forecasting.
  • 3.
    International Journal ofComputer Science & Information Technology (IJCSIT) Vol 17, No 6, December 2025 35 Table 1. Essential Characteristics of the Dataset (Adapted from Sayyad et al., 2024) Feature Description Data Source Transactional logs, market databases, internal inventory systems Collection Period January 2013 to December 2017 (5 years) Number of Records Approximately 913,000 daily item-level sales records Data Frequency Daily sales transactions Primary Features Date, Store ID, Item ID, Quantity Sold Engineered Features Holidays, promotional events, weekday/weekend indicators Feature Types Numerical (sales), categorical (store/item IDs, holidays), cyclical (month/weekdays) Data Preprocessing Steps Missing value interpolation, normalization, encoding categorical variables Intended Application Inventory demand forecasting for supply chain optimization Following Sayyad et al.’s recommended preprocessing methodology, the dataset underwent normalization, cyclical encoding of time-based variables, and systematic handling of missing values to improve data quality and model accuracy. These steps reduce inconsistencies and enhance temporal coherence, supporting more reliable forecasting outcomes [3]. By leveraging the rigorously collected dataset from Sayyad et al. (2024) and integrating the primary transactional features with contextual enhancements, this study aligns with best practices and strengthens the reliability and practical significance of its results. 2.2. Data Pre processing After acquiring the dataset from Sayyad et al. (2024) [3], a systematic data preprocessing pipeline was implemented to enhance data quality and ensure suitability for predictive modeling. This step was crucial to improve model performance, minimize bias, and ensure temporal and categorical consistency [1]. Handling missing or inconsistent values involved applying linear interpolation to estimate intermediate sales points based on surrounding observations, while forward-fill propagation was used to replace sequential gaps with the most recent valid entry. These methods preserved the continuity of the time-series structure and maintained underlying demand patterns essential for accurate forecasting. [1]. 1. Data Grouping The dataset was first explored and grouped by key identifiers such as store and item IDs. These categorical variables were transformed using one-hot encoding to ensure compatibility with machine learning models. This approach follows recommendations from Mehmood et al. (2024) [6] and Qureshi et al. (2024) [4], who highlight that proper encoding preserves data fidelity and enhances model interpretability. 2. Handling Product Data Interruptions Lag features were generated to capture recent demand patterns and address temporal gaps in sales data. Cyclical variables (e.g., month, weekday) were encoded using sine and cosine transformations to preserve periodicity, following best practices outlined by Vollmer et al. (2021) [5] and Dai and Huang (2021) [7]. 3. Handling Missing Data The dataset was thoroughly examined for missing or anomalous values, and gaps were addressed using linear interpolation to estimate intermediate sales points and forward-fill
  • 4.
    International Journal ofComputer Science & Information Technology (IJCSIT) Vol 17, No 6, December 2025 36 methods to propagate the last valid observation. These techniques preserved temporal continuity and maintained the underlying demand patterns essential for time-series forecasting, aligning with established practices in supply chain data integrity research [4][9]. 4. Chronological Ordering To prepare the dataset for time-dependent modeling, records were sorted chronologically by date. This step was essential to preserve the sequential nature of sales data, enabling accurate lag creation, seasonal decomposition, and temporal training/testing splits. Proper ordering ensures that model evaluation mimics real-world forecasting conditions, as highlighted in supply chain forecasting studies [1][3]. Through these rigorous preprocessing strategies, the raw dataset was transformed into a refined input format, facilitating the development of accurate and reliable machine learning models for inventory demand forecasting. 2.3. Feature Engineering Feature engineering enhances raw data by creating meaningful inputs that improve model performance. In this study, features were created to capture contextual, behavioural, and temporal signals relevant to demand fluctuations. The following variables were engineered based on proven techniques in recent literature. 1. Weekday A numeric weekday variable (0–6) was added to capture recurring weekly sales patterns. Prior studies show that weekday encoding enhances forecasting reliability across domains. Mehmood et al. (2024) and Qureshi et al. (2024) identified it as a key predictor in vending and retail forecasting [4][6], while Sharma et al. (2022) and Shahzadi et al. (2024) demonstrated its value in improving model adaptability to weekly operational cycles [13][16]. 2. Sales Deviation Flag A binary flag was created to identify abnormal sales spikes or drops by comparing actual sales to a rolling average threshold. This helped models detect anomalies caused by unrecorded promotions, disruptions, or local events. Sayyad et al. (2024) showed that such deviation markers increase responsiveness to retail shocks [3], while Agbemadon et al. (2023) found that they enhance forecasting accuracy under uncertainty [8]. 3. Public Holiday Indicator A holiday indicator was generated using the holidays Python library, which marks official Indian public holidays as binary flags. This helped capture systematic variations in demand caused by national events. Studies by Vollmer et al. (2021), Dai and Huang (2021), and Ma and Fildes (2021) all advocate including such exogenous variables to improve the accuracy of models forecasting re-tail, healthcare, and emergency logistics demand [6][11][17]. 2.4. Data Splitting After feature engineering, the dataset was divided into training and testing subsets to enable accurate evaluation of model performance [1]. Because the task involves time-series data, a strictly chronological split was used: January 2013–July 2017 for training and August 2017– December 2017 for testing. This approach mirrors real forecasting workflows and avoids using future information during model training, as highlighted in recent studies [17][18]. Prior research also confirms that temporal splits provide more realistic and unbiased forecasting assessments [6][4].
  • 5.
    International Journal ofComputer Science & Information Technology (IJCSIT) Vol 17, No 6, December 2025 37 Table 2 summarizes the details of the data-splitting strategy clearly: Table 2. Time-Based Data Splitting Approach Data Partition Period Number of Records Purpose Training Set Jan 2013 – July 2017 ~845,000 Model training and hyperparameter tuning Testing Set Aug 2017 – Dec 2017 ~68,000 Model evaluation and predictive vali-dation This structured approach to data splitting, based on recent forecasting research methodologies, ensures robust model training, rigorous evaluation, and a realistic assessment of each model’s predictive power under practical operational conditions [6][4]. 2.5. Machine Learning Methods This study evaluates four machine learning models selected based on their effective-ness and appropriateness for complex inventory forecasting tasks in supply chain management scenarios. These models include Extreme Gradient Boosting (XGBoost), Autoregressive Integrated Moving Average with Exogenous variables (ARIMAX), Facebook Prophet, and Support Vector Regression (SVR). Each model is briefly discussed below, along with a rationale for its selection, hyperparameter configuration, and relevant literature references supporting its use. o Extreme Gradient Boosting (XGBoost) o XGBoost is a gradient boosting algorithm that builds sequential decision trees, with each tree correcting prior errors, enhancing predictive accuracy. It is widely validated for forecasting across industries such as retail, agriculture, and healthcare [1][3][13]. o Hyper-parameter Configuration: Number of estimators is set at 100 trees (n_estimators=100), a learning rate of 0.1, and an L2 regularization term (lamb-da=0.1) to prevent overfitting. o Autoregressive Integrated Moving Average with Exogenous Inputs (ARIMAX) o ARIMAX extends ARIMA by incorporating external (exogenous) variables. It models historical trends through AR, I, and MA components while accounting for influential factors such as holidays and promotions [11][17]. o Hyperparameter Configuration: Utilized parameters of Auto regressive order p=1, differencing order d=0, and Moving Average order q=0. o Facebook Prophet (Fb Prophet) o Prophet is an open-source time-series model designed to capture complex trends, seasonality, and event-driven effects such as holidays or promotions. Its decomposable structure enables clear interpretation of components [6][7]. Recent studies highlight its effectiveness and ease of use in various supply chain forecasting applications [4][8]. o Hyperparameter Configuration: Selected a multiplicative approach for modeling seasonality, incorporated 25 changepoints for flexibility in capturing trend shifts, and set the predictive confidence interval at 95%. o Support Vector Regression (SVR) o SVR is effective for nonlinear and complex demand patterns, making it suitable for dynamic supply chain forecasting. Prior studies confirm its reliability when external variables are included [2][5][8][9] o Hyperparameter Configuration: The model used an RBF kernel to capture nonlinear relationships, with a regularization constant C = 1.0 and an epsilon value ε = 0.1 defining the acceptable deviation from predicted values.
  • 6.
    International Journal ofComputer Science & Information Technology (IJCSIT) Vol 17, No 6, December 2025 38 2.6. Model Evaluation Effective evaluation is essential for verifying the machine learning model’s performance and is often needed to be ascertaining its true predictive value and utility in actual situations. The evaluation criteria have been crafted based on existing methods and practices in contemporary literature on forecasting in the supply chain forecasting [1][2][3]. 1. Mean Absolute Error (MAE) o Mean Absolute Error (MAE) quantifies the average magnitude of prediction errors without considering their direction, making it an intuitive and robust measure against outliers [4][7][13]. Mathematically, MAE is defined as: MAE = 1/n i=1∑n ∣yi−y^i∣ where • n = number of observations, • yi = actual observed value, • y^i = model-predicted value 2. Root Mean Squared Error (RMSE) o RMSE provides an evaluation metric emphasizing larger errors, making it sensitive to significant prediction inaccuracies, which is critical in demand forecasting scenarios [9][17][18]. RMSE is calculated as: RMSE = √1/n i=1∑n (yi−y^i)² 3. Coefficient of Determination (R² Score) o The R² score assesses the degree of variation in the dependent variable which is brought about by independent variables. High R² values indicate good model performance [12][14]: o R² = 1 - SSres/SStot where  SSres: Residual sum of squares (unexplained variance)  SStot: Total variance in observed data Table 3 summarizes these metrics and their implications for vending machine demand forecasting. Table 3. Model Performance Metrics Metric Formula Interpretation MAE (Mean Absolute Error) ⅟n ∑∥yi−y^i∥ Tracks average error in units, critical for perishable inventory. RMSE (Root Mean Squared Error) √⅟n ∑(yi−y^i)2 Highlights severe over/under-predictions that disrupt restocking efficiency. R² Score (Coefficient of Determination) R2=1−SSres/SStot Reveals how well external factors (e.g., weather) explain demand volatility.
  • 7.
    International Journal ofComputer Science & Information Technology (IJCSIT) Vol 17, No 6, December 2025 39 To ensure robust and unbiased evaluation, the dataset was partitioned chronologically (time- based) into training and testing sets, aligning with practices suggested by recent forecasting research [19]. By adopting this methodology, the evaluation accurately reflects the model's ability to forecast future demand based solely on historical patterns and external features. Overall, the chosen evaluation metrics - MAE, RMSE, and R² - combined with a rigorous data- splitting strategy, ensure comprehensive and reliable assessments of each model’s performance, as consistently recommended in contemporary forecasting and predictive analytics literature. 2.7. Implementation Framework Developing an accurate and reliable predictive model for inventory demand forecasting requires a structured framework that spans across several key stages. This section outlines the implementation approach used in this study, organized into the following categories: Data Infrastructure, Modeling & Deployment, and Monitoring & Visualization. Each step aligns with best practices supported by recent research in predictive analytics and supply chain management [1][12]. A. Data Infrastructure The foundation of this study's implementation began with a clear definition of forecasting goals and data specifications, reflecting the structured framework proposed by Sayyad et al. (2024) for supply chain predictive tasks [3]. The data acquisition process used a pre-collected dataset as provided in Sayyad et al. (2024), followed by meticulous cleaning and preprocessing procedures in line with Mehmood et al. (2024) and Qureshi et al. (2024) [2][4]. Key preprocessing actions included: o Handling missing values via linear interpolation and forward-fill [2]. o Encoding categorical variables through one-hot encoding [4]. o Normalizing numerical features with Min-Max scaling [3]. o Transforming cyclical features (e.g., months, weekdays) using sine and cosine functions [8][5]. o Constructing lag features to capture temporal dependencies [9]. These practices ensured the dataset was accurate, comprehensive, and suitable for time-series modeling, thus forming a solid data infrastructure for the project. B. Modeling & Deployment Once pre-processing was complete, the dataset was partitioned using a temporal data-splitting strategy, where records from January 2013 to July 2017 were used for training and records from August 2017 to December 2017 were reserved for testing. This time-based approach avoids data leakage and mirrors real-world deployment scenarios [10][12][19]. The machine learning models selected for deployment included XGBoost, ARIMAX, Facebook Prophet, and Support Vector Regression (SVR) - all widely recognized in the literature for their high performance in forecasting tasks [13][14][20]. To optimize each model’s performance:
  • 8.
    International Journal ofComputer Science & Information Technology (IJCSIT) Vol 17, No 6, December 2025 40 o Hyper-parameters for XGBoost were tuned using best practices (e.g., learning rate, estimators, L2 regularization) [6][21]. o Facebook Prophet’s seasonal change-points and seasonality mode were adjusted to enhance accuracy [22]. The deployment phase ensured that all models were robustly implemented with validated parameter configurations for maximum predictive effectiveness. C. Monitoring & Visualization To ensure model accuracy and reliability, performance was continuously evaluated using Mean Absolute Error (MAE), Root Mean Squared Error (RMSE), and R² Score. These metrics are validated across the forecasting literature and provide a comprehensive view of model accuracy and predictive power [16][18][23]. Following evaluation, models were compared using side-by-side metric analysis. The best- performing model was selected based on a combination of interpret-ability, accuracy, and practical application, as recommended in decision frameworks from Pournader et al. (2022), Wu et al. (2022), and others [24][25]. The entire implementation pipeline is visually summarized in Figure 1, showcasing the integration of data preparation, modeling, evaluation, and final selection stages. Figure 1. Comprehensive Predictive Model Implementation Framework. By following this implementation framework, the research ensured that each stage, from data handling to deployment and performance monitoring was rigorously aligned with academic and
  • 9.
    International Journal ofComputer Science & Information Technology (IJCSIT) Vol 17, No 6, December 2025 41 industry standards. This comprehensive structure not only strengthens the study's predictive capabilities but also enhances its practical value for broader applications in demand forecasting and supply chain optimization [11]. 2.8. Ethical & Compliance Safeguards To ensure responsible AI deployment  Privacy by Design: All customer transaction data was anonymized at ingestion, stripping identifiers (e.g., payment tokens, location fingerprints) before analysis.  Regulatory Adherence: Compliance with GDPR [13] and industry standards was enforced through o Data Minimization: Only essential features were retained. o Audit Trails: Access logs and model decisions were archived for accountability.  Bias Mitigation: Training data was audited for representativeness across machine locations (e.g., urban vs. rural) to prevent geographic skew. 3. RESULTS This section presents the results of the experiments conducted to evaluate the performance of the four-machine learning (ML) algorithms - XGBoost, ARIMAX, Facebook Prophet (Fb Prophet), and Support Vector Regression (SVR) - in predicting inventory needs for a vending machine warehouse. The results are divided into two scenarios: Scenario #1, where predictions were made using only historical sales data, and Scenario #2, where external variables (weekday, public holiday, and sales deviation flag) were systematically introduced to assess their impact on prediction accuracy. The performance of each model was evaluated using the Mean Absolute Error (MAE) metric. 3.1. Scenario 1: Without External Variables Scenario 1 assessed XGBoost, ARIMAX, Facebook Prophet, and SVR using only historical sales data to establish a baseline, excluding external variables like holidays, weekdays, or deviation flags. This approach measures the models’ intrinsic ability to capture demand patterns [1][12][13]. Figure 2. Demand Trend Analysis (Actual vs. Predicted). Figure 2 illustrates the comparison between actual sales and the predictions generated under Scenario 1. As shown, all four models struggle to capture sudden fluctuations and peak demand periods, confirming that historical data alone is insufficient for stable forecasting. The visible
  • 10.
    International Journal ofComputer Science & Information Technology (IJCSIT) Vol 17, No 6, December 2025 42 deviations in Figure 2 support the performance metrics reported later and justify the need for external contextual variables. [11][14][15]. 3.2. Scenario 2: Impact of External Variables on Forecasting Performance This scenario extends the baseline model by introducing external variables to assess their impact on forecasting performance. External variables such as weekday, holiday indicators, and sales deviation flags were included to enhance the model’s contextual understanding. Prior studies in retail and supply chain analytics have demonstrated the significant influence of such features in improving predictive accuracy [2][13][15]. Figure 3. Feature Importance Ranking (XGBoost Model). The relative contribution of each engineered feature is presented in Figure 3. The XGBoost feature importance ranking revealed the following relative contributions: o Sales_Deviation_Flag showed the highest impact (~0.175 importance score) o Weekday was the second most influential (~0.125 score) o Public_Holiday demonstrated a moderate influence (~0.075 score) o Weather_Index, Previous_Sales, Promotion had marginal contributions (<0.05 scores each) The feature importance plot clearly shows that the sales deviation flag and weekday variables exert the greatest influence on model output, highlighting their critical role in correcting anomalies and capturing periodic demand behaviors. Sales deviation flags were added to capture abnormal demand fluctuations, following Sayyad et al. (2024) [3]. Binary indicators for public holidays and weekends were also included, consistent with Mehmood et al. (2024) and Qureshi et al. (2024), improving forecast stability [2][4]. Cyclical features like day-of-week and month were encoded with sine and cosine transformations to capture periodic demand patterns, as recommended by Vollmer et al. (2021) and Dai and Huang (2021) [13][19]. All models - XGBoost, ARIMAX, Facebook Prophet, and SVR were retrained using identical parameters and splits to ensure comparability [1][12]. External variables dominated overall feature importance (~80%), with the Sales_Deviation_Flag contributing 2.3× more than Weekday, reinforcing the improved accuracy observed in Scenario 2. 1. Temporal Patterns (Weekday Variable)  Performance Lift: All models showed improved accuracy, though with varying degrees
  • 11.
    International Journal ofComputer Science & Information Technology (IJCSIT) Vol 17, No 6, December 2025 43 o XGBoost: 15% MAE reduction (46.13 → 39.2) o ARIMAX: 3.6% improvement (41.6 → 40.1) o Prophet/SVR: <2% change (stable around 38-40 MAE)  Operational Insight: Particularly valuable for office-located machines, where weekday sales averaged 2.3× weekend volumes. The variable helped anticipate the "Monday coffee surge" and "Friday snack dips" patterns. 2. Event-Driven Demand (Public Holiday)  Model Response o XGBoost: 7.5% MAE increase (counterintuitive due to overcorrection) o ARIMAX: 3.8% performance degradation o Prophet: Showed resilience with only 1.8% MAE change  Key Finding: Holiday impacts varied dramatically by location type - airport machines saw 22% sales boosts while corporate park units dropped to 40% of normal volume. Only Prophet's multiplicative seasonality handled this spatial variance effectively. 3. Operational Anomalies (Sales Deviation Flag)  Breakthrough Improvement o XGBoost: 37% MAE drop (42.15 → 26.6) o ARIMAX: 27% improvement (41.62 → 30.26) o SVR: 24% gain (42.42 → 32.1) 1. Critical Value: This binary flag (activated when sales fell below 30% of rolling average) helped models distinguish between true demand shifts and machine outages - explaining 89% of outlier events in validation data. 4. Synergistic Effects (All Variables Combined) The full external feature set unlocked each algorithm's potential differently o XGBoost achieved peak performance (22.7 MAE, 51% better than baseline), demonstrating exceptional feature synthesis capability o ARIMAX showed strong temporal adaptation (26.9 MAE, 35% improvement) o Prophet plateaued (37.7 MAE) due to inherent holiday handling limitations o SVR struggled with high-dimensional interactions (37.8 MAE) Practical Implications:  Maintenance logs should be integrated with forecasting systems in real-time  Location-specific holiday profiles could yield additional 4-7% accuracy gains  The "weekday" variable's diminishing returns suggest opportunity for more granular intra-day periodicity features
  • 12.
    International Journal ofComputer Science & Information Technology (IJCSIT) Vol 17, No 6, December 2025 44 This analysis shows that all models gain accuracy from contextual variables, though the extent varies according to each model’s architecture a key consideration for inventory optimization in autonomous retail systems. The results indicate clear performance improvements, as external factors helped explain variations not captured by historical sales alone. These findings align with prior research highlighting the importance of rich feature sets for accurate forecasting in dynamic supply chains [7][9][15]. 3.3. Visualization of Results To provide a clearer understanding of the models' performance, the actual and predicted sales quantities were visualized for each model in both scenarios. 1. Scenario #1 (Without External Variables) o The predictions from Fb Prophet closely followed the actual sales trends, demonstrating its ability to capture seasonality and trends without external variables [12]. o XGBoost and ARIMAX showed larger deviations from the actual values, particularly during periods of high sales volatility. o SVR produced consistent predictions but failed to capture sudden spikes or drops in sales [2]. 2. Scenario #2 (With External Variables) o The predictions from XGBoost showed a significant improvement, closely aligning with the actual sales trends. The inclusion of external variables al-lowed the model to better capture anomalies and temporal patterns [4]. o ARIMAX also showed improved performance, with predictions that more accurately reflected actual sales [14]. o Fb Prophet and SVR showed slight improvements, but their predictions still deviated from actual values during periods of high volatility. The results of both scenarios are summarized in Table 4 below Table 4. Scenario 1 vs Scenario 2 Model Performance Algorithm Scenario #1 (No External Variables) Scenario #2 (With External Variables) XGBoost 46.13 22.7 ARIMAX 41.6 26.9 Fb Prophet 38.8 37.7 SVR 40.02 37.8 Key Findings Table 4 summarizes the MAE values for all models across both scenarios and clearly demonstrates the performance gains achieved when external variables are introduced. XGBoost shows the largest reduction in error (46.13 to 22.7), followed by ARIMAX, which also benefits substantially (41.6 to 26.9). Prophet and SVR show only moderate improvements, consistent with the more limited alignment observed in their visual predictions in Figures 2 and 3. These results indicate that historical sales alone were insufficient for handling high-demand fluctuations in Scenario 1, where predicted values deviated significantly from actuals, particularly during sharp
  • 13.
    International Journal ofComputer Science & Information Technology (IJCSIT) Vol 17, No 6, December 2025 45 spikes. In contrast, Scenario 2 produced predictions that were far more closely aligned with actual sales, especially around holidays and weekends, demonstrating the added value of contextual feature integration. This pattern aligns with prior research emphasizing the importance of incorporating domain-relevant variables in forecasting models [4][12]. Feature importance results from XGBoost further confirm that weekday, holiday flags, and sales deviation indicators played a dominant role in improving predictive accuracy, consistent with findings from Sayyad et al. (2024) and Mehmood et al. (2024) [2][3]. Additionally, residual histograms reveal narrower and more centered error distributions for models using external variables, supporting the quantitative improvements and aligning with literature advocating the use of graphical diagnostics for model interpretability and validation [6][7][9]. 3.4. Comparative Analysis Table 5 compares the performance of Linear Regression, Random Forest, and XGBoost in terms of MAE, RMSE, R² Score, and training time. It highlights the superior performance of XGBoost in terms of accuracy and efficiency [7]. Table 5. Model Performance Comparison Algorithm Scenario #1 (No External Variables) Scenario #2 (With External Variables) XGBoost 46.13 22.7 ARIMAX 41.6 26.9 Fb Prophet 38.8 37.7 Figure 4. Demand Forecasting Performance Comparison. Figure 4 compares actual versus predicted sales for Linear Regression, Random Forest, and XGBoost, showing XGBoost best captures trends and anomalies [7]. Across scenarios, XGBoost achieved the lowest MAE and RMSE and the highest R², particularly when external variables were included. Prophet and ARIMAX performed well but were sensitive to data sparsity, while SVR struggled with complex seasonality [1][3][12].
  • 14.
    International Journal ofComputer Science & Information Technology (IJCSIT) Vol 17, No 6, December 2025 46 XGBoost’s ensemble approach effectively handles non-linear relationships and heterogeneous features, assigning higher weights to influential variables. These results reinforce prior research showing gradient boosting models outperform traditional regressors in retail and supply chain forecasting, emphasizing the value of feature richness [7][9][13][15]. 3.5. Error Distribution Analysis Error distribution analysis was performed to understand how each model handled overprediction and underprediction. In Scenario 1, models exhibited wider error distributions, with a higher frequency of large deviations. This indicates that models relying solely on historical sales struggled to capture sudden shifts in demand. SVR, in particular, showed a skewed error distribution, reflecting its difficulty in generalizing from sparse and noisy data. Figure 5. Prediction Error Distribution. Figure 5 illustrates the distribution of prediction errors for each model, showing that XGBoost has the narrowest distribution, reflecting more consistent and accurate forecasts than Linear Regression and Random Forest. In Scenario 2, incorporating external variables reduced both the magnitude and variance of prediction errors. Prophet and ARIMAX also showed improved residual symmetry, though they struggled with sharp demand spikes. Narrow, centered error distributions are associated with better generalization and stable performance under dynamic conditions [6][7][9][10][12][15]. Overall, residual analysis confirms that XGBoost is the most reliable model for inventory forecasting, minimizing large prediction errors and enhancing operational efficiency across varying demand scenarios. 4. DISCUSSION The results of this study provide valuable insights into the application of machine learning (ML) algorithms for demand forecasting in the vending machine industry. The findings highlight the importance of incorporating external variables into predictive models and demonstrate the superior performance of XGBoost when these variables are included. Below, we discuss the implications of these findings, their alignment with previous research, and their broader significance for supply chain management (SCM). 4.1. Role of External Variables in Demand Forecasting Including external variables weekday, public holiday, and sales-deviation flags greatly improved prediction accuracy. These features helped models capture daily patterns, holiday effects, and anomalies from machine issues, outperforming approaches that rely only on historical sales.
  • 15.
    International Journal ofComputer Science & Information Technology (IJCSIT) Vol 17, No 6, December 2025 47 XGBoost and ARIMAX especially benefited, showing higher accuracy and stronger feature responsiveness. Overall, adding external context leads to more reliable forecasts and better inventory management. 4.2. Performance of Machine Learning Algorithms The study evaluated four ML algorithms - XGBoost, ARIMAX, Facebook Prophet (Fb Prophet), and Support Vector Regression (SVR) - and found that XGBoost outperformed the other models when external variables were included. Below, we discuss the strengths and limitations of each algorithm in the context of demand forecasting. 1. XGBoost Strengths: Achieved the lowest MAE (22.7) when external variables were included, effectively handling complex relationships and iteratively correcting errors [7]. Limitations: Relied heavily on additional features; performance was weaker in Scenario 1 without external variables [7]. 2. ARIMAX Strengths: MAE improved from 41.6 to 26.9 with external variables, leveraging exogenous inputs for robust time-series forecasting [8]. Limitations: Lagged behind XGBoost in non-linear settings due to its linear structure [8]. 3. Facebook Prophet Strengths: Handled trends, seasonality, and holiday effects without external features (MAE 38.8 → 37.7), making it robust for general time-series forecasting [9]. Limitations: Limited improvement from external variables, indicating underutilization of additional inputs [9]. 4. SVR Strengths: Maintained consistent performance across scenarios (MAE 40.02 → 37.8), robust to outliers and non-linear relationships [10]. Limitations: Computationally intensive and sensitive to hyperparameter tuning; lower accuracy than XGBoost and ARIMAX [10]. 4.3. Consequences for Supply Chain Management Integrating external features with ML models like XGBoost, ARIMAX, and Prophet improved forecast accuracy in supply chains. Compared to traditional methods, these models better captured non-linear and seasonal patterns, reducing overstocking and stockouts, enhancing shelf availability, and enabling proactive SKU-level inventory management, demonstrating the value of data-driven forecasting [2][3][4][7][9][10].
  • 16.
    International Journal ofComputer Science & Information Technology (IJCSIT) Vol 17, No 6, December 2025 48 Table 6. Inventory Optimization Impact Metric Before ML Implementation After ML Implementation Improvement (%) Overstock Rate 15% 5% 66.7% Reduction Stockout Rate 12% 3% 75% Reduction Forecast Accuracy 75% 92% 22.7% Increase Cost Savings N/A +20% Functional Effectiveness Baseline inventory performance in vending machine supply chains relied on conventional heuristics, such as trend averages or lagged sales, which often overlooked contextual factors like weather, holidays, and weekday effects [1][3][11][16]. This resulted in inefficiencies, reflected in a 15% overstock rate, a 12% stockout rate, and an overall forecast accuracy of only 75% patterns consistent with prior studies highlighting misaligned inventory across product categories [1][10][14]. The practical implications of improved forecasting accuracy are presented in Table 6, where the incorporation of machine learning models shows a substantial reduction in overstocking by 66.7% and stockouts by 75%. These improvements demonstrate the tangible operational value of the proposed forecasting approach and confirm that enhanced predictive accuracy directly leads to measurable supply chain efficiencies. After implementing advanced ML models - XGBoost, ARIMAX, SVR, and Facebook Prophet with exogenous variables, forecasting accuracy increased to 92%, corresponding to the significant reductions in overstock and stockout rates summarized in Table 6. These gains underscore the importance of integrating temporal and contextual features into model development, allowing for more accurate and responsive inventory planning. Additionally, nearly 20% cost savings were realized through reduced holding costs, fewer emergency replenishments, and more efficient resource utilization, echoing outcomes reported in similar ML-driven supply chain applications [20]. Overall, the results illustrate a clear progression from reactive forecasting practices toward a proactive, data-driven inventory management strategy. 4.4. Limitations and Future Research Directions Dataset Limitations: The study relied on historical sales and a limited set of external features (holidays, weekdays, sales deviations). Incorporating additional variables such as weather, promotions, or economic indicators could further improve model accuracy, as prior research has shown [3][4][14]. Federated Learning: Models were trained on a single dataset with a fixed temporal split, which may limit generalizability across regions or sales channels. Expanding to multi-regional or multi- channel datasets could enhance robustness [12][15]. Advanced Models: While MAE and RMSE indicated strong performance, explainability techniques such as SHAP or LIME were not applied. Future work should integrate explainable AI (XAI) tools to clarify feature contributions and support data-driven decision-making in supply chain operations [6][13]. Real-Time Forecasting: This study did not address real-time deployment or continuous learning. Incorporating streaming data and feedback loops could maintain model relevance in dynamic environments, as supported by recent adaptive analytics research [16][17].
  • 17.
    International Journal ofComputer Science & Information Technology (IJCSIT) Vol 17, No 6, December 2025 49 4.5. Cross-Industry Implications and Technological Transformation The methodologies and findings from this study extend beyond vending machine inventory management and are applicable to industries such as retail, healthcare, agriculture, and manufacturing. These sectors face similar challenges, including demand volatility, seasonal trends, and supply constraints, which can be effectively addressed using machine learning models enhanced with external variables [12][14][15]. In retail and e-commerce, integrating promotional calendars, weather forecasts, and customer footfall data improves inventory control, reduces markdowns, and optimizes shelf stocking [3][5]. In healthcare, accurate forecasting supports medical supply management, patient inflow prediction, and staffing optimization during holidays or public health emergencies [10][23]. IoT- driven frameworks, combined with proactive maintenance and edge computing, further enhance operational efficiency and reduce downtime in smart warehouses [22]. Emerging markets such as pharmaceuticals and agriculture also benefit from ML-driven forecasts. ARIMAX with environmental variables can minimize spoilage in vaccine logistics, while crop demand and fertilizer management are improved through weather, soil, and commodity data inputs [21][23][26]. Overall, ML and AI facilitate a shift toward proactive, predictive, and autonomous supply chains [13][16][17]. 5. CONCLUSION This study demonstrates that the integration of external variables significantly enhances the accuracy of demand forecasting models, with XGBoost emerging as the most effective algorithm. The findings provide a robust framework for optimizing inventory management in the vending machine industry, with potential applications in retail, e-commerce, and other sectors. Future research should explore advanced models, federated learning, and real-time forecasting to further improve prediction accuracy and operational efficiency. ACKNOWLEDGEMENTS The authors would like to thank everyone, just everyone! REFERENCES [1] D. Ni, Z. Xiao, and M. K. Lim, "A systematic review of the research trends of machine learning in supply chain man-agement," Int. J. Mach. Learn. Cybern., vol. 11, no. 7, pp. 1463–1482, Jul. 2020. [2] U. Mehmood et al., "Machine Learning-Based Predictive Inventory for a Vending Machine Warehouse," IEEE Internet of Things Magazine, 2024. [3] J. K. Sayyad et al., "Optimizing e-Commerce Supply Chains With Categorical Boosting: A Predictive Modeling Frame-work," IEEE Access, 2024. [4] N. U. H. Qureshi et al., "Demand Forecasting in Supply Chain Management for Rossmann Stores Using Weather En-hanced Deep Learning Model," IEEE Access, 2024. [5] B. Huang, "Research on optimization of e-commerce supply chain management process based on Internet of Things technology," Journal of Physics: Conference Series, vol. 2074, no. 1, 2021. [6] M. M. Taye, "Understanding of machine learning with deep learning: Architectures, workflow, applications and future directions," Computers, vol. 12, no. 5, p. 91, 2023. [7] K. B. Agbemadon, R. Couturier, and D. Laiymani, "Over Stock Prediction Using Machine Learning in Retail Industry," 2023 3rd International Conference on Computer, Control and Robotics (ICCCR), 2023.
  • 18.
    International Journal ofComputer Science & Information Technology (IJCSIT) Vol 17, No 6, December 2025 50 [8] H. Hewamalage, C. Bergmeir, and K. Bandara, "Recurrent neural networks for time series forecasting: Current status and future directions," Int. J. Forecasting, vol. 37, no. 1, pp. 388–427, 2021. [9] S. Ma and R. Fildes, "Retail Sales Forecasting with Meta-Learning," European Journal of Operational Research, vol. 288, no. 1, 2021. [10] M. A. C. Vollmer et al., "A Unified Machine Learning Approach to Time Series Forecasting Applied to Demand at Emergency Departments," BMC Emergency Medicine, vol. 21, 2021. [11] P. Helo and Y. Hao, "Artificial intelligence in operations management and supply chain management: An exploratory case study," Prod. Planning Control, vol. 33, no. 16, pp. 1573–1590, 2022. [12] R. Sharma et al., "The role of artificial intelligence in supply chain management: Mapping the territory," Int. J. Prod. Res., vol. 60, no. 24, pp. 7527–7550, 2022. [13] H. Allioui and Y. Mourdi, "Unleashing the potential of AI: Investigating cutting-edge technologies that are transforming businesses," Int. J. Comput. Eng. Data Sci., vol. 3, no. 2, pp. 1–12, 2023. [14] M. Yang et al., "Supply chain risk management with machine learning technology: A literature review and future re-search directions," Comput. Ind. Eng., vol. 175, 2023. [15] G. Shahzadi, F. Jia, L. Chen, and A. John, ‘‘AI adoption in supply chain management: A systematic literature review,’’ J. Manuf. Technol. Manage., Jul. 2024. [16] M. Pournader, H. Ghaderi, A. Hassanzadegan, and B. Fahimnia, Artificial intelligence applications in supply chain management,’ Int. J. Prod. Econ., vol. 241, Feb. 2021, Art. no. 108250. [17] R. G. Richey, S. Chowdhury, B. Davis-Sramek, M. Giannakis, and Y. K. Dwivedi, Artificial intelligence in logistics and supply chain management: A primer and roadmap for research,’ J. Bus. Logistics, vol. 44, no. 4, pp. 532–549, Oct. 2023. [18] J. Li, X. Yan, Y. Li, and X. Dong, ‘‘Optimizing the agricultural supply chain through e-commerce: A case study of Tu-douec in Inner Mongolia, China,’’ Int. J. Environ. Res. Public Health, vol. 20, no. 5, p. 3775, Feb. 2023 [19] Y. Dai and J. Huang, A sales prediction method based on LSTM with hyper-parameter search,’’ J. Phys., Conf. Ser., vol. 1756, no. 1, Feb. 2021, Art. no. 012015. [20] H. Fatorachian and H. Kazemi, ‘‘Impact of industry 4.0 on supply chain performance,’’ Prod. Planning Control, vol. 32, no. 1, pp. 63–81, 2021. [21] P. Toktaş-Palut, ‘‘Analyzing the effects of industry 4.0 technologies and coordination on the sustainability of supply chains,’’ Sustain. Prod. Consumption, vol. 30, pp. 341–358, Mar. 2022. [22] R. Setiawan, R. Salman, B. G. Khairov, V. V. Karpov, S. D. Danshina, L. V. Vasyutkina, N. A. Prodanova, V. Zhenzhebir, E. Nuyanzin, N. Kapustina, and A. H. Kalajahi, ‘‘Sustainable closed-loop mask supply chain network design using mathematical modeling and a fuzzy multiobjective approach,’’ Sustainability, vol. 13, no. 10, p. 5353, May 2021. [23] N. P. Kumar et al., “Machine Learning Based Predictive Analytics for Agriculture Inventory Management System,” 2022 4th Int’l. Conf. Cognitive Computing and Information Processing (CCIP), Bengaluru, India, 2022. [24] M. Ma, L. Shen, and X. Sun, ‘‘Optimization of e-commerce logistics service quality considering multiple consumption psychologies,’’ Frontiers Psychol., vol. 13, Sep. 2022, Art. no. 956418. [25] P. Wu, A. Andreev, and M. Benyoucef, "The state of lead scoring models and their impact on sales performance," In-formation Technology and Management, vol. 25, no. 1, pp. 69–98, Mar. 2024. [26] P. K. Detwal, R. Agrawal, A. Samadhiya, A. Kumar, and J. A. GarzaReyes, ‘‘Research developments in sustainable supply chain management considering optimization and industry 4.0 techniques: A systematic review,’’ Benchmarking, Int. J., vol. 31, no. 4, pp. 1249–1269, May 2024. AUTHORS Anees Fatima is a Master’s student in Computer Science in the Department of Computing, Information and Mathematical Sciences and Technology (CIMST) at Chicago State University. With more than eight years of professional experience as a Senior Software Engineer, she possesses a strong background in full-stack development, cloud computing, and DevOps methodologies. Her academic and professional interests include artificial intelligence, machine learning, cybersecurity, and modern software engineering practices. She has contributed to multiple research areas, including the application of AI in education, immersive technologies such as augmented and virtual reality, and human computer interaction. Her work investigates how intelligent systems and emerging
  • 19.
    International Journal ofComputer Science & Information Technology (IJCSIT) Vol 17, No 6, December 2025 51 technologies can enhance user experiences, improve security, and support data-driven decision-making. Driven by a passion for innovation, she integrates her industry expertise with academic research to design scalable, secure, and impactful technological solutions. Dr. Mohammad Abdus Salam serves as the Chairperson of the Department of Computing, Information and Mathematical Sciences, and Technology (CIMST) at Chicago State University (CSU). With over 20 years of extensive teaching and research experience, Dr. Salam previously held a professorship in Computer Science at Southern University in Baton Rouge, Louisiana. His research expertise spans wireless sensor networks, wireless communication, information and coding theory, data visualization, machine learning, and cybersecurity. He has taught a wide array of computer science and engineering courses and has contributed significantly to scholarly literature, authoring numerous journal articles and conference proceedings. In addition, he has served as a guest editor for multiple academic journals and as a panellist for esteemed organizations like NSF, NASA, and various international conferences. He is a member of ACM and a senior member of IEEE.