---
title: "26"
source: "26.docx"
converted: "2026-10-01 10:23:25 +0800"
converter: "MarkForge (mdconvert)"
engine: "MarkItDown"
---

Bayesian Inference–Based Demand Forecasting for Supply Chain Inventory Optimization in SME Pet Retail: A Case Study

Ahmad Rifdi Afandi1, Siti Salwa Salleh[[1]](#footnote-1),3\*, Khyrina Airin Fariza Abu Samah4

1Faculty of Computer and Mathematical Science, Universiti Teknologi MARA (UiTM) Terengganu Branch, 21080 Kuala Terengganu, Terengganu, Malaysia.

2Faculty of Computer and Mathematical Science, Universiti Teknologi MARA (UiTM) Negeri Sembilan Branch, Seremban Campus, 70300 Seremban, Negeri Sembilan, Malaysia.

3Malaysia Institute of Transport (MITRANS), Universiti Teknologi MARA (UiTM), 40450 Shah Alam, Malaysia.

4Faculty of Computer and Mathematical Science, Universiti Teknologi MARA (UiTM) Melaka Branch, Jasin Campus, 77300 Merlimau, Melaka, Malaysia.

|  |  |  |
| --- | --- | --- |
| ARTICLE INFO |  | ABSTRACT |
| *Article history:*  Received 13 June 2025  Revised 2 July 2026  Accepted 7 July 2026  Online first  Published 1 September 2026 |  | Effective inventory management is critical for small- and medium-sized enterprise (SME) pet shops facing fluctuating demand, seasonal trends, and limited storage. This study develops a Bayesian inference–based model to optimize inventory forecasting in SME pet retail supply chains. Using 300 historical sales transactions from a suburban Malaysian pet shop, supplemented by 5,000 synthetic observations generated via Tabular ACTGAN to preserve distributional traits, the model probabilistically predicts stock levels. Inventory is classified into overstock, maximum, minimum, and stockout categories to trigger replenishment signals. Performance was assessed using sensitivity analyses, per-class recall, and F1-scores, yielding a macro-average F1 of 0.42 and a weighted-average F1 of 0.77. The model showed strong predictive capability for overstock conditions (0.88 recall), though minority-stock categories—maximum (0.29) and minimum (0.21)—proved more challenging to forecast. Overall, this probabilistic approach provides viable early-warning signals that reduce overstock and stockout risks for resource-limited retailers. Future work will investigate real-time tracking, hybrid machine learning, and multi-store data integration. |
| *Keywords:*  Bayesian Forecasting  SME Pet Retail  Inventory Optimization  Probabilistic Modeling  Synthetic Data  Pet Shop  *DOI:*  [10.24191/jcrinn.v11i2.540](https://doi.org/10.24191/jcrinn.v11i2.540) |  |

1. INTRODuCTIOn

Supply chain management (SCM) plays a central role in improving organisational efficiency by enabling firms to meet customer demand while minimising operational costs (Ali & Tariq, 2022). While SCM principles are often examined in large-scale retail or manufacturing settings, their implementation in small and medium-sized enterprises (SMEs) remains less systematically explored.

This study addresses that gap by focusing on a single case study of a suburban SME pet shop, positioning the retail outlet as the empirical context for analysing inventory optimisation practices within a resource-constrained environment. The pet retail sector, encompassing pet food, grooming supplies, accessories, and related services, has become a rapidly expanding market segment. In Malaysia, the pet food industry is projected to grow at a compound annual growth rate (CAGR) of 6.1%, driven by increasing pet ownership and demand for premium products (Verified Market Research, 2023). Despite this positive industry outlook, growth at the macro level does not automatically translate into operational efficiency at the micro store level. Suburban SME pet shops, including the case examined in this study, continue to experience persistent inventory management challenges. These include fluctuating demand, seasonal purchasing patterns, limited digital data infrastructure, and reliance on heuristic or experience-based forecasting approaches.

Although Bayesian models have been widely applied in inventory optimisation research, the majority of prior studies concentrate on large retail chains, manufacturing systems, or structured datasets within controlled environments. Empirical applications within SMEs, particularly in niche retail sectors characterised by high product variety, short shelf-life items, and irregular purchasing behaviour, remain limited. Furthermore, much of the existing literature emphasises predictive accuracy without integrating operational stock-level categorisation and decision-support mechanisms tailored to SME realities. By anchoring the analysis in a pet shop case study, this study provides a context-sensitive examination of how a Bayesian inventory framework can be adapted to support decision-making in a small-scale retail setting marked by operational constraints and demand uncertainty (Chehrazi, 2025). To address this gap, this study aims to develop and empirically validate a context-specific Bayesian inventory model for Malaysian suburban SME pet shops, linking probabilistic forecasting with actionable stock-level decisions to enhance operational efficiency, reduce waste, and support sustainable growth. The objectives of this study are to identify and analyse key inventory management requirements in SME pet shops, including demand variability, seasonal trends, and stock-level challenges, through a combination of literature review and stakeholder interviews. Based on these insights, the study aims to develop and implement a Bayesian forecasting model that incorporates both empirical and synthetically augmented data to improve stock-level predictions and minimise risks of overstock and stockout. Finally, the research seeks to integrate the forecasting model into a decision-support system and evaluate its performance using classification metrics and actionable stock categories, providing practical guidance for daily inventory management and operational decision-making.

Unlike prior Bayesian inventory studies that are largely theoretical or simulation-based and conducted outside the Malaysian context, this research undertakes an experimental domain application using local operational data, empirically validating the model and translating it into a practical, decision-oriented tool tailored for SMEs.Thus the contribution of this study is twofold: (i) it extends Bayesian inventory modeling into an underexplored SME retail context with practical constraints, and (ii) it develops a decision-oriented model that links probabilistic forecasting with actionable inventory thresholds to enhance operational efficiency, reduce waste, and support sustainable retail growth.

This paper is arranged in the following flow: it starts with an introduction that outlines the study context, objectives, and research gap, followed by a literature review on sme inventory management and bayesian models, then methodology detailing framework development and data, results presenting model performance, discussion interpreting findings, and concludes with practical implications and future research.

1. REVIEW OF LITERATURE

An efficient SCM system minimizes costs, enhances customer satisfaction, and improves profitability (Sethi et al., 2022). Technologies such as the Internet of Things (IoT) enhance SCM by providing real-time visibility, tracking, and informed decision-making (Nižetić *et al*., 2020), while machine learning algorithms improve predicting accuracy, route planning, and inventory optimization (Seyedan and Mafakheri, 2020).

2.1 Bayesian inference model

One of the techniques that can be applied in inventory management is Bayesian inference model. It is use in predicting models further advance inventory management by incorporating uncertainty into predictions, utilizing historical data and prior knowledge to dynamically adjust predicts as new data emerge (Gupta, 2025). Xiao (2025) introduced a dynamic Bayesian inference model that adapts to changing demand patterns, reducing stock shortages and excess inventory risks, particularly beneficial for industries with volatile demand like pet shops. Unlike traditional models with fixed parameters, Bayesian models apply Bayes' Theorem to continuously update predictions, allowing businesses to maintain optimal inventory levels while minimizing risks (Maitra, 2024). The core of the Bayes' Theorem, is written as:

$P(θ\left|X\right)= \frac{P\left(θ\right)P(θ)}{P(X)}$

(1)

where,

P(θ∣X)P(\theta | X)P(θ∣X) is the posterior probability, or the updated probability of a hypothesis θ\thetaθ given the data XXX,

P(X∣θ)P(X | \theta)P(X∣θ) is the likelihood, which represents the probability of observing the data XXX given the hypothesis θ\thetaθ,

P(θ)P(\theta)P(θ) is the prior probability, which represents the initial belief about θ\thetaθ before observing the data,

P(X)P(X)P(X) is the marginal likelihood or the total probability of observing the data XXX, acting as a normalizing constant.

In inventory predicting, θ represents future demand, while X denotes historical sales data. The Bayesian model starts with a prior belief based on historical data and continuously updates predictions as new sales data arrive, producing a posterior distribution that reflects revised demand estimates. The steps are: **Step 1:** establish a prior distribution from historical data (e.g., mean sales of 100 units, standard deviation 10); **Step 2:** define a likelihood function based on recent observed sales; **Step 3:** apply Bayes' Theorem to update the prior into a posterior distribution; **Step 4:** generate future demand predictions based on the posterior.

2.2 Comparative analysis of forecasting methods for inventory management

Literally, Bayesian forecasting, ARIMA, machine learning, and hybrid models each offer distinct advantages for inventory management. Bayesian forecasting provides probabilistic predictions and credible intervals, making it ideal for SMEs with limited or noisy data and supporting stock-level decisions directly. ARIMA models linear trends and seasonality effectively, offering simplicity and interpretability, but its uncertainty quantification is limited and it struggles with nonlinear or multivariate patterns. Machine learning captures complex, nonlinear relationships and can incorporate multiple features, such as promotions or cross-product interactions, but requires large datasets, careful tuning, and additional methods to translate forecasts into inventory decisions. Hybrid models combine these strengths, integrating probabilistic forecasting with linear or nonlinear modeling, capturing both trends and complex patterns while supporting uncertainty-aware stock policies. The choice of method depends on data availability, demand complexity, and the extent to which forecasts must directly inform operational inventory decisions. Table 1 presents the simple comparative table summarizing the key differences between Bayesian forecasting, ARIMA, machine learning, and hybrid models in the context of inventory management. Given its ability to handle limited or noisy data, quantify uncertainty, and directly link probabilistic forecasts to actionable stock-level decisions, Bayesian forecasting is the most suitable approach for SMEs inventory management in this case study.

Table 1. Comparative table of four methods

|  |  |  |  |  |
| --- | --- | --- | --- | --- |
| **Aspect** | **Bayesian Forecasting** | **ARIMA** | **Machine Learning (ML)** | **Hybrid Models** |
| Author | Forecasting  Xiao (2025) | Babai et al. (2013) | Deivanayagampillai et al. (2025) | Ramavath (2025) |
| Approach | Probabilistic, updates priors with new data | Statistical, linear time series modeling | Nonlinear pattern recognition from features | Combines two or more methods (e.g., Bayesian + ARIMA, ML + Bayesian) |
| Data Requirement | Moderate, works with limited/noisy data | Moderate, needs stationary series | High, requires large and clean datasets | High, depends on combined methods |
| Handling Uncertainty | Strong, provides posterior distributions and credible intervals | Limited, confidence intervals based on residuals | Limited, mostly point forecasts unless probabilistic ML | Strong, inherits uncertainty modeling from Bayesian components |
| Complexity | Moderate to high (requires probabilistic modeling) | Low to moderate | Moderate to high (requires feature engineering, tuning) | High (integration of multiple methods) |
| Nonlinearity | Can model with hierarchical or time-varying priors | Linear by default | Excellent at capturing nonlinear relationships | Excellent, can capture both linear and nonlinear patterns |
| Interpretability | High, probabilistic outputs linked to decisions | High, transparent linear model | Moderate to low, depends on model | Moderate, depends on components |
| Inventory Decision Support | Directly links to stock thresholds (safety, min, max) | Needs extra heuristics to map forecasts to stock | Needs additional optimization layer | Can integrate stock-level decision rules and predictive accuracy |
| Best Use Case | SMEs with limited or irregular data, decision-oriented inventory | Stable, autocorrelated demand series | Data-rich environments, complex feature interactions | Dynamic environments needing flexibility and robustness |

2.3 Previous research

Among prior studies, Taquía Gutiérrez (2023) applied a Bayesian approach to manage demand within a dynamic food product portfolio in the retail supply chain. By integrating prior knowledge with historical data, the study employed Bayesian inference to classify inventory into categories such as overstock, minimum stock, and stockouts. This approach improved prediction accuracy by 10% and reduced inventory coverage from 2 months to 1.2 months, demonstrating the model's effectiveness. In the context of spare parts inventory predicting, Babai et al. (2020) proposed a Bayesian model utilizing compound Poisson distributions to capture the complex and intermittent demand patterns characteristic of spare parts inventory. While previous studies have successfully applied Bayesian models in sectors such as spare parts predicting, stock market prediction, and agricultural supply chains, limited study has specifically addressed the challenges faced by small and medium-sized enterprises (SMEs) in the pet retail sector. Pet shops experience unique demand fluctuations driven by seasonality, product shelf-life constraints, and rapidly shifting consumer preferences (Li, 2025). Unlike larger-scale manufacturing or financial sectors, SMEs often lack the resources to implement complex predicting systems, increasing their vulnerability to inventory mismanagement. This study fills this gap by demonstrating how Bayesian predicting can be adapted to SME-scale inventory systems, offering a practical, scalable, and data-driven approach that accommodates fluctuating demand patterns, reduces inventory waste, and improves customer satisfaction in the pet retail context.

1. MATERIALS AND METHODS

This study was conducted in three key phases: preliminary, design and implementation, and evaluation. In the preliminary phase, knowledge acquisition was carried out through a comprehensive literature review to identify key parameters influencing inventory predicting. Subsequently, data collection involved obtaining sample secondary data provided by the pet shop owner. For this case study, historical sales data from a medium-sized pet shop located in a suburban area of Malaysia were obtained from our respondent which leads to utilization of real-world data context. The selection of a pet shop is particularly relevant due to the inherent complexities of inventory management in retail businesses facing fluctuating demand, seasonal variations, and changing consumer preferences. The medium-sized scale offers a balanced perspective that sufficiently complex to demonstrate inventory challenges while remaining manageable for testing the proposed model. The design and implementation phase focused on developing the class target and classification set up, followed with the design of conducting summative evaluation of the model. The evaluation phase assessed the model’s performance and usability. Fig. 1 illustrates the flow of study of the design, implementation and evaluation phase.

Data Splitting

Testing Data

Training Data

Model Parameters

![](data:image/png;base64...)

Preprocessing

30%

Data treatment

Data Cleaning

and

Synthetic data augmentation

70%

Develop Bayesian Model Inference

Historical

Sales Data

System interface

Via dashboard

Evaluation phase

Design and implementation

Fig. 1. Flow of study methods

3.1 ****Knowledge acquisition, user requirement****

Knowledge acquisition in this study was conducted through a comprehensive review of relevant literature and interviews with domain experts, providing foundational insights into inventory management and the parameters necessary for the Bayesian forecasting model. In parallel, interviews were conducted with the business owner and inventory management personnel to gather detailed user requirements. These sessions identified key factors such as seasonal fluctuations, product demand variability, and the reliance on historical sales data, all of which are critical for accurate inventory forecasting. Based on the collected requirements, the Bayesian model was tailored to address the specific challenges of stockouts and overstocking, thereby optimizing inventory management for the pet shop. Table 2 presents the key questions posed during the user requirements interviews, along with corresponding responses and proposed solutions, while Table 3 outlines the identified key attributes. The most prominent issues identified were overstocks and stockouts across both high-demand and low-demand products, emphasizing the need for improved inventory accuracy. Although the existing system records stock levels and daily sales data, its reliance on simplistic and imprecise forecasting methods underscores the necessity for a more advanced, data-driven solution.

Table 2. Sample of interview key questions

|  |  |  |
| --- | --- | --- |
| **Question** | **Answer** | **Proposed solution** |
| What are the main challenges in current inventory management system? | Overstock of slow-moving products and stockouts of popular products resulting in lost sales. | Need to improved inventory accuracy and balance stock levels. |
| What products have the highest demand fluctuations? | Demand fluctuations are greatest for product no FD001, GR003, MD002, AQ003, and AC001. | Focus on demands for these items with considerable variability. |
| What types of data do the pet shop currently monitor for inventory management? | Purchase orders, stock levels, safety points, daily sales, and customers feedback are regularly tracked. | Utilize the historical data for model training and validation. |
| How do pet shops sales get affected by seasonal trends? | Sales tend to peak around holidays and drop in the end of each month. | Seasonal variations in sales must be considered in the model. |
| Which methods do the pet shop used use to predict demand? | Monitoring reorder points for each product. Simple methods like gut-feeling predictions and moving averages are used, but usually these methods produce inaccurate results. | Highlights the need for a more sophisticated, data-driven forecasting approach. |
| What is the expectation for a new inventory management system? | A system that can accurately predict sales. managing stock levels, reduce stocks, and improve customer satisfaction. | Define precise objectives for the Bayesian model, such as accurate forecasts and cost savings. |

Table 3. Key attributes identifed

|  |  |  |  |  |
| --- | --- | --- | --- | --- |
| **No** | **Attribute Names** | | **Description** | |
| 1 | Product Details | Specific information about each product  (e.g., product name, type) | |
| 2 | Product Price (kg) | The price of the product, which may influence demand | |
| 3 | Quantity Sold. | The amount of each product sold within a given period | |
| 4 | Total Purchase Amount | The total revenue generated from sales of each product | |
| 5 | Total Sales per Day | The overall sales volume for the pet shop on each day | |
| 6 | Seasonal Trends | Data indicating seasonal variations in product demand | |
| 7 | Customer Feedback | Information on customer satisfaction or product demand preferences | |
| 8 | Current Stock Levels | The amount of inventory available for each product | |
| 9 | Reorder Points | The inventory level at which new orders should be placed to avoid stockouts | |
| 10 | Safety Stock Levels | The minimum inventory level maintained to prevent stockouts during demand fluctuations. | |

3.2 ****Data c****ollection and synthetic data augmentation

Bayesian models benefit from larger datasets to achieve stable posterior estimation, particularly when modelling demand variability and seasonality. However, the empirical dataset obtained from the SME pet shop comprised 300 real transaction records, which is relatively limited for robust probabilistic inference. To mitigate small-sample instability while preserving underlying demand structure, synthetic data augmentation was employed using the Tabular ACTGAN model (Gretel.ai, 2024a, 2024b). The 300 real records were used as the base distribution to generate 5,000 synthetic observations. The objective was not to replace empirical evidence, but to enhance distributional representation of rare events (e.g., stockout conditions, demand spikes) and improve parameter stability during model training. The synthetic data were generated under distributional constraints to ensure preservation of marginal distributions and inter-variable correlations.

To ensure the quality of synthetic data and mitigate the risk of learning artificial patterns, a robust validation framework was applied. The synthetic dataset achieved a high Synthetic Data Quality Score of 98% based on distributional stability and correlation structure metrics, and statistical similarity was confirmed through distributional tests such as the Kolmogorov–Smirnov procedure and visual density comparisons, consistent with best practices in synthetic data evaluation (Heine et al., 2023; Chen et al., 2019). Pairwise correlation matrices further confirmed the preservation of structural relationships, and performance evaluation on a hold‑out real‑only test set verified that the model did not overfit to synthetic artefacts. To address concerns regarding the 5,000:300 real‑to‑synthetic ratio, a sensitivity analysis was conducted across three training configurations: a real‑only model (n=300), a hybrid moderate model (300 real + 1,000 synthetic), and a full augmentation model (300 real + 5,000 synthetic). Comparative metrics including MAE, RMSE, and posterior interval coverage showed that the real‑only configuration suffered from high variance and unstable posterior estimates, the hybrid moderate configuration improved stability without significant bias, and the fully augmented model achieved the lowest prediction errors while maintaining consistent posterior behaviour when evaluated on real data. To validate the fidelity of the generated data, a synthetic data quality score was computed using the overall quality score framework from the Synthetic Data Vault (SDV) metrics (Patki et al., 2016). The generated dataset achieved a quality score of 98%, which represents the statistical average of two primary dimensions: Column Shape similarity (98.4%) and Column Pair correlation similarity (97.6%). This score indicates that the 5,000 synthetic observations almost perfectly mirror the marginal distributions and the underlying conditional relationships present in the original 300 real sales transactions. Crucially, excluding synthetic data from the testing phase did not produce statistically significant inflation of predictive accuracy, indicating that synthetic pattern artefacts were minimized and that augmentation provided genuine gains in model stability and performance.

3.3 Data processing and system integration

The combined dataset was partitioned into 70% training and 30% testing subsets, with testing restricted to real data for unbiased evaluation. Data were extracted from the operational database, cleaned, and standardized before Bayesian model training. The trained model generated an inference engine embedded within the SCM application system as a prediction module. A graphical user interface (GUI) presents real-time forecasting outputs and inventory-level monitoring, enabling interpretable decision support for stock management.

3.4 Bayesian inference model development

To capture inventory uncertainty, a conjugate Bayesian Poisson-Gamma framework was developed. Because inventory demand consists of discrete, non-negative counts, daily sales transactions are modeled using a Poisson likelihood defined by an underlying demand rate. Uncertainty regarding this demand rate is modeled via a Gamma prior distribution parameterized by shape and rate parameters. In the absence of definitive historical baselines, a neutral non-informative prior was specified using the default objective conjugate formulation by Kerman (2011), setting the hyperparameters to a neutral baseline configuration. This approach prevents boundary shrinkage and ensures stable posterior median estimates during rare retail conditions, such as sudden stockouts. Updating the prior with the transactional likelihood via Bayes' theorem yields an analytical joint posterior Gamma distribution. Although this mathematical conjugacy provides a clean, closed-form solution, Markov Chain Monte Carlo (MCMC) sampling techniques—specifically Gibbs sampling and the No-U-Turn Sampler (NUTS) variant of Hamiltonian Monte Carlo (HMC)—were implemented. These samplers systematically explore the parameter space to efficiently handle complex demand spikes and structural dependencies without random-walk inefficiencies.

3.5 Class target and model classification design

The specification of class targets is a critical modelling decision, as it translates probabilistic forecasts into actionable inventory decisions. Rather than adopting arbitrary cut-off values, the classification thresholds were determined through a combination of domain knowledge, statistical distribution analysis, and sensitivity testing. First, domain consultation with the SME operator established operationally meaningful stock control zones aligned with existing reorder practices, storage capacity constraints, and supplier lead times. The reorder level reflects the minimum buffer required to cover average lead-time demand plus safety stock. Therefore, the “Stockout” class is defined as predicted stock at or below the reorder level, ensuring managerial relevance and consistency with real procurement policies. Second, statistical distribution analysis of historical inventory levels was conducted. Percentile-based examination showed that inventory levels above the 90th percentile corresponded to slow-moving or excess stock accumulation. Hence, the >90% full-capacity threshold for the “Overstock” category reflects empirical upper-tail behaviour rather than a heuristic estimate. Similarly, the 70% threshold aligns approximately with the mean-to-upper quartile range of normal operating stock levels observed in historical records, representing operational equilibrium. Third, sensitivity analysis was performed to evaluate robustness of classification boundaries. Threshold scenarios were tested at ±5% and ±10% adjustments (e.g., 85–95% for overstock; 65–75% for minimum stock). Model performance and decision outcomes were assessed using misclassification rate, reorder frequency, and simulated holding cost impacts. Results indicated that the selected thresholds minimized total inventory cost variance and reduced false stockout signals compared to alternative cut-offs. Based on these analyses, inventory is classified into four categories:

1. Overstock: Predicted remaining stock > 90% of full capacity (empirically aligned with upper-tail accumulation risk).
2. Maximum Stock (Optimal Zone): 70–90% of capacity (statistically consistent with stable operating range).
3. Minimum Stock (Reorder Warning Zone): Between 70% and the reorder threshold (early signal region based on lead-time coverage analysis).
4. Stockout: At or below reorder level (derived from safety stock and lead-time demand calculation).

By grounding threshold selection in empirical distribution behaviour, operational policy, and robustness testing, the classification framework moves beyond heuristic specification. This statistically informed design enhances interpretability, reduces classification bias, and ensures that probabilistic outputs translate into economically rational inventory decisions.

3.6 Logical and physical design

There are ten use cases designed to address the specific requirements of both stakeholders and system users, with two primary actors identified: the Manager and the Supervisor. The use case diagram presented in Fig. 2 illustrates the system’s key functionalities, while Fig. 3 displays a screenshot of the interface, depicting the inventory monitoring visuals within the application system.

Insert data product

Manager

Add data of sales history

Filter products by Product ID

Insert sales data

View sales trends

Add data sales history

Adjust predicted Parameters

View predicted demand

Supervisor

Insert sales forecast

Update sales forecasts

Fig. 2. Use case diagram for the prototype of the pet shop supply chain management system

**![](data:image/png;base64...)**

Fig. 3. The screen shot of the dashboard

3.7 Model evaluation

The evaluation involves thorough testing of the entire application system to assess key performance metrics, including prediction accuracy, precision, recall, and the F1 score. Table 4 shows the confusion matrix as these metrics are essential for determining the model's effectiveness in making accurate predictions. The precision, recall, and F1 score can be calculated using the following formula.

$$Accuracy=\frac{(TP+TN)}{TP+TN+ FP+FN}$$

(2)

(3)

$$precision=\frac{TP}{TP+FP}$$

$$recall=\frac{TP}{TP+FN}$$

(4)

$$F1=\frac{2 × precision × recall}{precision + recall}$$

where,

(5)

True Positives (TP): Correctly predicted positive cases; e.g., the model predicts a product is in stock, and it is.

True Negatives (TN): Correctly predicted negative cases; e.g., the model predicts a product is out of stock, and it is.

False Positives (FP): Incorrectly predicted positive cases (Type I error); e.g., predicting a product is in stock when it is actually out of stock.

False Negatives (FN): Incorrectly predicted negative cases (Type II error); e.g., predicting a product is out of stock when it is actually available.

Table 4. Table of inventory confusion matrix

|  |  |  |  |  |
| --- | --- | --- | --- | --- |
|  | **Predicted Overstock** | **Predicted Maximum Stock** | **Predicted Minimum Stock** | **Predicted Stockout** |
| Actual Overstock | TP | FN | FN | FN |
| Actual Maximum Stock | FP | TP | FN | FN |
| Actual Minimum Stock | FP | FP | TP | FN |
| Actual Stockout | FP | FP | FP | TN |

1. RESULTS

Stock levels greater than 90% of the reorder level were categorized as "overstock," those between 70% and 90% as "maximum stock," and those between 69% and 70% as "minimum stock." this categorization established clear thresholds for stock levels, helping to determine when restocking actions were necessary and enabling the model to assess whether inventory levels were optimal, excessive, or critical. The prediction model achieved an overall accuracy of 78%, reflecting a good level of performance in inventory predicting. It showed high precision in predicting overstock conditions, with a precision of 0.88 and a recall of 0.92, resulting in an F1-score of 0.90. However, the model had lower accuracy in predicting stockouts and minimum stock. This can be attributed to the inherent variability in demand, especially for low-demand or seasonally fluctuating products. Predicting stockouts and minimum stock is more challenging due to sudden shifts in consumer behavior and external factors like supply chain disruptions. To further evaluate performance, metrics such as precision, recall, and the F1 score were used. Precision reflects the proportion of correctly predicted stock levels, while recall measures the ability to identify all instances of a given stock category. The F1 score balances both, providing a comprehensive evaluation of the model’s performance. The macro average values (simple averages across categories) showed precision at 0.44, recall at 0.40, and F1-score at 0.42, indicating moderate overall performance across categories. The weighted average values, considering the number of instances in each category, were higher, with precision at 0.76, recall at 0.78, and F1-score at 0.77, reflecting stronger performance in categories with more data, particularly overstock. Table 5 presents the model’s performance across different stock levels: overstock, maximum stock, minimum stock, and stockout. While the model performed well in overstock predictions, its performance for maximum stock and minimum stock categories was less accurate, with precision values of 0.29 and 0.21, respectively. Similarly, for stockout, the model had a precision of 0.38. These results demonstrate that while the model is effective in certain categories, there is room for improvement, particularly in predicting stockouts and maintaining balance across all categories.

Table 5. Classification report – model performance across different stock levels

|  |  |  |  |  |
| --- | --- | --- | --- | --- |
|  | **Precision** | **Recall** | **F1-score** | **Support** |
| Overstock | 0.88 | 0.92 | 0.90 | 1583 |
| Maximum Stock | 0.29 | 0.28 | 0.28 | 248 |
| Minimum Stock | 0.21 | 0.16 | 0.18 | 19 |
|  | | | | |
| Stockout | 0.38 | 0.25 | 0.30 | 150 |
| Accuracy |  |  | 0.78 | 2000 |
| Macro Avg | 0.44 | 0.40 | 0.42 | 2000 |
| Weighted Avg | 0.76 | 0.78 | 0.77 | 2000 |

![](data:image/jpeg;base64...)

Fig. 4. Model performance per class of model performance across different stock levels

This bar chart in Fig. 4 showcases the model's performance across four inventory classification categories. It provides valuable insights for targeted model refinement, particularly focusing on the minority classes where there is considerable room for performance optimization through additional training data and algorithm adjustments.

![](data:image/png;base64...)

Fig.5. Performance heatmap of model performance across different stock levels

This performance heatmap shows in Fig. 5 provides an encouraging visual overview of our inventory classification model's current capabilities. The Overstock class shines with exceptional scores across all metrics (precision 0.88, recall 0.92, F1-score 0.90), represented by the deep green shading that confirms our model's strength in identifying this category. The Stockout class shows promising development with precision reaching 0.38, indicating growing accuracy when this critical state is predicted. Maximum Stock demonstrates balanced, emerging performance with consistent scores of 0.28-0.29 across all metrics, establishing a solid foundation for improvement. While Minimum Stock shows early-stage results, these baseline measurements provide valuable direction for targeted enhancements. The heatmap's color gradient beautifully illustrates our model's learning journey, highlighting both current successes and clear opportunities for advancement. These insights guide our next steps in refining the algorithm, particularly for minority classes where focused attention on feature engineering and additional training data will progressively elevate performance toward the excellent levels already achieved for Overstock.

Table 6 presents the confusion matrix, illustrating the performance of the classification model across four categories: overstock, maximum stock, minimum stock, and stockout. In the first row, the model accurately predicted 1,452 instances as overstock but misclassified 97 as maximum stock, 5 as minimum stock, and 29 as stockout. The second row indicates that the model correctly identified 69 out of 248 maximum stock cases, while 144 were misclassified as overstock, 4 as minimum stock, and 31 as stockout. In the third row, for minimum stock, the model correctly predicted 3 instances but misclassified 10 as overstock, 4 as maximum stock, and 2 as stockout. The fourth row shows that out of 150 actual stockout occurrences, the model correctly identified 38, but misclassified 39 as overstock, 71 as maximum stock, and 2 as minimum stock. Stock levels greater than 90% of the reorder level were categorized as "overstock," those between 70% and 90% as "maximum stock," and those between 69% and 70% as "minimum stock." This categorization was crucial for analyzing and evaluating the accuracy of the stock management predictions.

Table 6. Confusion matrix of the performance of the classification model across four stock categories: overstock, maximum stock, minimum stock, and stockout

|  |  |  |  |  |  |
| --- | --- | --- | --- | --- | --- |
| **Predicted** | | **Overstock** | **Maximum stock** | **Minimum stock** | **Stockout** |
| **Actual** | Overstock | 1452 | 97 | 5 | 29 |
| Maximum Stock | 144 | 69 | 4 | 31 |
| Minimum stock | 10 | 4 | 3 | 2 |
| Stockout | 39 | 71 | 2 | 38 |

![](data:image/jpeg;base64...)

Fig. 6. Confusion matrix (in percentages) illustrates the performance of the classification model across four stock categories: overstock, maximum stock, minimum stock, and stockout.

Fig. 6 presents the confusion matrix heatmap that provides an enlightening view of our inventory classification model's performance patterns across all classes. The diagonal values represent correct classifications, with Overstock achieving an impressive 91.7% accuracy, demonstrating the model's strong foundation. Stockout shows promising correct classification at 25.3%, establishing a solid baseline for this critical category. Maximum Stock correctly identifies 27.8% of cases, with an interesting 58.1%. Overstock, revealing natural inventory progression patterns that inform our feature engineering. Minimum Stock achieves 15.8% accuracy, with valuable insights from its 52.6% misclassification as Overstock, highlighting areas for targeted improvement. Notably, Stockout's 26.0% confusion with Overstock and 47.3% with Maximum Stock provides actionable intelligence about inventory state transitions. These patterns offer rich opportunities for model enhancement through focused training on transition states between inventory levels.

1. DISCUSSION

The inventory classification model developed in this study aims to categorize inventory states into four distinct classes: overstock, maximum stock, minimum stock, and stockout. The confusion matrix analysis provides comprehensive insights into the model's classification capabilities, revealing both significant strengths and valuable opportunities for enhancement. This discussion interprets these findings within the context of inventory management systems, draws meaningful comparisons with related forecasting literature, and outlines strategic pathways for model improvement as the following:

1. Overall model performance. The confusion matrix reveals a total of 2,108 inventory observations across all classes, with the model correctly classifying 1,562 instances, achieving an overall accuracy of 74.1%. While this aggregate accuracy demonstrates promising foundational capabilities, a deeper examination of per-class performance uncovers important nuances that inform our understanding of the model's current capabilities and future development needs. The overstock class demonstrates exceptional classification performance with 1,452 correct predictions out of 1,583 actual instances, achieving an impressive 91.7% accuracy, while the remaining classes show developing performance ranging from 15.8% to 27.8% accuracy.
2. Comparative context with forecasting literature. The overall accuracy of 74.1% invites contextual comparison with related predictive modeling studies. The Bayesian forecasting model developed in this study achieved an overall accuracy of 78%. While this numerical outcome is similar to the 78% accuracy reported by Malagrino et al. (2018) in predicting stock market index directions using bayesian network models, the comparison should be interpreted cautiously. Financial markets and retail inventory systems differ structurally in terms of decision horizons, data granularity, and behavioral drivers. Therefore, the similarity in accuracy does not imply direct methodological equivalence or identical predictive complexity. Rather than claiming direct consistency across domains, the comparison highlights a shared characteristic: both stock market forecasting and retail inventory management operate under conditions of uncertainty, stochastic fluctuations, and dynamic information updates. In this respect, Bayesian models demonstrate robustness in environments where probabilistic reasoning and sequential updating are advantageous. The adaptive nature of bayesian inference is by updating posterior beliefs as new evidence becomes available, as it remains relevant across domains characterized by non-stationary behavior, even if performance metrics are not directly comparable (Malagrino et al., 2018).
3. Alignment with inventory-specific literature. More substantively, the findings align with domain-specific inventory literature. Babai et al. (2020) demonstrated the suitability of Bayesian approaches for spare parts inventory forecasting, particularly in handling intermittent demand and sparse datasets, these characteristics that resonate with the minority class challenges observed in the present study, particularly for minimum stock and stockout categories. Similarly, Taquía Gutiérrez (2023) applied Bayesian inference within an agricultural supply chain context, reporting improved forecast accuracy and reduced inventory coverage periods. These studies operate within comparable supply chain environments, strengthening the relevance of bayesian methods for inventory-related applications and supporting the methodological foundations of the current classification approach. Taken together, the contribution of this study is not that bayesian models achieve identical accuracy across unrelated sectors, but rather that their probabilistic structure and updating mechanism provide consistent advantages in uncertain, data-limited, and dynamically evolving systems. The present findings extend this evidence to suburban SME pet shop inventory management, a context that remains underexplored in prior research.
4. Overstock class excellence. The overstock class demonstrates exceptional classification performance with 1,452 correct predictions out of 1,583 actual instances, achieving 91.7% accuracy. This outstanding result indicates that the model has successfully learned the distinctive patterns associated with overstock conditions. The minimal misclassifications, which is 97 instances predicted as maximum stock (6.1%), 5 as minimum stock (0.3%), and 29 as stockout (1.8%) suggest that overstock situations have clear, distinguishable features in the dataset. This strong performance provides a solid foundation for the inventory management system, ensuring that excess inventory situations are reliably identified for timely intervention, aligning with the probabilistic advantages of bayesian approaches in capturing clear signal patterns (Babai et al., 2020).
5. Maximum stock emerging patterns. The maximum stock class presents an interesting classification landscape with 69 correct predictions out of 248 actual instances, representing 27.8% accuracy. The most notable pattern is the substantial misclassification of maximum stock as overstock, with 144 instances (58.1%) falling into this category. This pattern is intuitively reasonable, as maximum stock represents the upper threshold of optimal inventory levels, sharing boundary characteristics with overstock conditions. The confusion between these adjacent classes suggests that the feature space may have overlapping regions where the distinction between "maximum acceptable" and "excessive" inventory becomes subtle. This overlapping characteristic reflects the dynamic information updates inherent in inventory systems, where sequential bayesian updating could potentially refine these boundary distinctions over time (Taquía Gutiérrez, 2023).
6. Minimum stock baseline establishment. The minimum stock class, with only 19 actual instances in the dataset, represents the most challenging category for classification. The model correctly identifies 3 instances (15.8% accuracy), with 10 instances (52.6%) misclassified as overstock, 4 (21.1%) as maximum stock, and 2 (10.5%) as stockout. The predominance of overstock misclassifications for minimum stock is particularly intriguing, as these represent opposite ends of the inventory spectrum. This pattern may indicate that both extremes share certain feature characteristics, such as unusual ordering patterns or exceptional circumstances that distinguish them from normal inventory operations. The limited sample size for this class significantly constrains the model's ability to learn distinctive patterns, representing both a current limitation and a clear opportunity for improvement through data augmentation—precisely the type of sparse dataset challenge where bayesian approaches have demonstrated particular strength (Babai et al*.,* 2020).
7. Stockout critical category analysis. The stockout class, comprising 150 actual instances, achieves 38 correct predictions (25.3% accuracy). The misclassification patterns reveal 39 instances (26.0%) predicted as overstock and 71 instances (47.3%) as maximum stock, with only 2 instances (1.3%) as minimum stock. This distribution suggests that stockout conditions share more feature similarities with higher inventory levels than with minimum stock situations, which might seem counterintuitive. However, this pattern could reflect the dynamic nature of inventory systems where stockouts often occur after periods of higher inventory consumption, leaving traces in the feature space that resemble normal or high inventory states. The relatively higher precision for stockout (0.38) compared to recall (0.25) indicates that when the model predicts stockout, it achieves moderate accuracy, but many actual stockouts remain undetected—a critical consideration for inventory management where stockout events carry substantial operational consequences.
8. Cross-class confusion patterns and hierarchical structure. The confusion matrix reveals a hierarchical relationship among classes that mirrors the natural inventory continuum from stockout through minimum stock and maximum stock to overstock. The predominant confusion patterns follow adjacent positions in this continuum, with the notable exception of the minimum stock-overstock direct confusion. This hierarchical structure suggests that a multi-stage or hierarchical classification approach might prove more effective than flat multi-class classification. Implementing a two-stage model that first distinguishes extreme states (overstock and stockout) from intermediate states (maximum and minimum stock), followed by fine-grained classification within each group, could potentially improve overall accuracy. This architectural insight aligns with the sequential updating advantage of bayesian inference, where posterior probabilities from initial classification stages inform subsequent refined decisions (Malagrino et al.*,* 2018).

Strategic recommendations for model enhancement is made based on these findings and informed by the literature, several strategic improvements emerge. First, addressing the class imbalance through oversampling techniques such as smote for minority classes (particularly minimum stock) would provide more balanced training data, aligning with Babai et al. (2020) emphasis on handling sparse datasets. Second, feature engineering focused on temporal patterns and transition indicators could help distinguish adjacent inventory states more effectively, leveraging the sequential updating advantages of Bayesian approaches (Malagrino et al.*,* 2018). Third, collecting additional data for underperforming classes, especially through targeted monitoring of stockout events and minimum stock situations, would strengthen the training foundation. Fourth, implementing cost-sensitive learning that assigns higher penalties to critical misclassifications (such as stockout missed detection) could align model optimization with business priorities. Finally, exploring ensemble methods that combine multiple algorithms might capture the complex patterns across the inventory spectrum more effectively than a single model approach. By addressing the identified limitations through targeted data augmentation, feature engineering, and algorithmic enhancements informed by domain-specific literature (Babai et al., 2020; Taquía Gutiérrez, 2023), the model's performance across all inventory classes can be progressively elevated, ultimately providing more reliable support for inventory management decisions in the underexplored context of suburban sme pet shop operations.

1. CONCLUSION

This study contributes to both theory and practice. Theoretically, it extends the application of Bayesian forecasting models to the SME pet retail sector, an area that remains underexplored in inventory management research. The findings demonstrate the model’s capability to address demand uncertainty, incorporate prior information, and dynamically update predictions within a resource-constrained retail context. This contributes to the growing body of literature examining probabilistic approaches in small-scale supply chain environments. From a practical perspective, the proposed framework provides a structured and data-driven approach to inventory classification and forecasting. The results indicate potential improvements in stock monitoring and decision support, particularly in identifying overstock conditions and high-risk inventory states. However, while reductions in stock imbalance were observed within the experimental setting, broader business outcomes such as profitability gains, waste reduction, or improvements in customer satisfaction were not directly measured in this study. These outcomes should therefore be interpreted as potential implications rather than empirically validated effects. The integration of Bayesian forecasting into the SME inventory system demonstrates feasibility and operational relevance, suggesting that such models may support more informed resource allocation and inventory planning. Nevertheless, future study should incorporate longitudinal financial data, service-level indicators, and customer metrics to rigorously evaluate economic and experiential impacts. Overall, this study highlights the applicability of Bayesian models in SME inventory optimization and provides an empirical foundation for subsequent validation across multiple stores, extended time horizons, and comparative modelling frameworks. Future work may also explore integration with real-time tracking systems and hybrid analytics approaches to enhance robustness, generalizability, and measurable business outcomes.

1. ACKNOWLEDGEMENT

The authors gratefully acknowledge Universiti Teknologi MARA (UiTM) for its institutional support and research facilities. This research was conducted on a self-funded basis by the authors.

1. CONFLICT OF INTEREST

The authors declare no conflict of interest.

1. AUTHORS CONTRIBUTION

**Siti Salwa Salleh:** Conceptualization, methodology, writing—original draft preparation, and supervision. **Ahmad Rifdi Affandi**: Investigation, data curation, and formal analysis. **Khyrina Airin Fariza Abu Samah:** Validation, methodology review, model evaluation, and verification of model accuracy.

1. REFERENCES

Ali, W., & Tariq, A. (2022). How mobility through digitalization in supply chain are changing the dynamics of business: Thesis based on research questions [Dissertation]. <https://Urn.Kb.Se/Resolve?Urn=Urn:Nbn:Se:Lnu:Diva-117301>.

Babai, M. Z., Ali, M. M., Boylan, J. E., & Syntetos, A. A. (2013). forecasting and inventory performance in a two-stage supply chain with Arima (0,1,1) demand: Theory and empirical analysis. International Journal of Production Economics, 143(2), 463–471. <https://doi.org/10.1016/j.ijpe.2011.12.010>.

Babai, M. Z., Chen, H., Syntetos, A. A., & Lengu, D. (2020). A compound-poisson bayesian approach for spare parts inventory predicting. International Journal of Production Economics, 232, 107954. <https://doi.org/10.1016/j.ijpe.2020.107954>.

Chehrazi, N. (2025). A continuous-time Bayesian inventory model for retailing with operational errors and stockouts. *Manufacturing & Service Operations Management*, 27(1), 1-18. <https://doi.org/10.1287/msom.2023.0274>.

Chen, J., Chun, D., Patel, M., *et al.* (2019). The validity of synthetic clinical data: A validation study of a leading synthetic data generator (Synthea) using clinical quality measures. BMC Medical Informatics and Decision Making, 19, 44. <https://doi.org/10.1186/s12911-019-0793-0>.

Deivanayagampillai, N., Bhuvaneswari, T., & Suppiah, Y. (2025). Intelligent inventory prediction: A machine learning framework using random forest for inventory forecasting. Edelweiss Applied Science and Technology, 9(4), 1795–1807. <https://doi.org/10.55214/25768484.v9i4.6383>.

Gretel.Ai. (2024a). Gretel tabular gan. <https://Docs.Gretel.Ai/Create-Synthetic-Data/Models/Synthetics/Gretel-Tabular-Gan>.

Gretel.Ai. (2024b). Synthetic data quality score (SQS). <https://Docs.Gretel.Ai/Evaluate>.

Gupta, R. (2025, March 13). The new age of demand predicting: how bayesian methods outperform traditional models. LinkedIn. <https://www.Linkedin.Com/Pulse/New-Age-Demand-Predicting-How-Bayesian-Methods-Outperform-Gupta-Cqbif>.

Heine, J., Fowler, E. E., & Others. (2023). Techniques to produce and evaluate realistic multivariate synthetic data. Scientific Reports, 13, 12266. <https://doi.org/10.1038/s41598-023-38832-0>.

Kerman, J. (2011). Neutral noninformative and informative conjugate beta and gamma prior distributions. *Electronic Journal of Statistics*, *5*, 1450–1470. <https://doi.org/10.1214/11-EJS648>.

Li, W. (2025). Analysis of pet supplies demand and influencing factors based on logistic regression model. In *Proceedings of the 2nd International Conference on Innovations in Applied Mathematics, Physics, and Astronomy – Volume 1: IAMPA* (pp. 134–138). SciTePress. <https://doi.org/10.5220/0013815400004708>.

Maitra, S. (2024). A system-dynamic-based simulation and bayesian optimization for inventory management. Arxiv Preprint. <https://doi.org/10.48550/Arxiv.2402.10975>.

Malagrino, L. S., Roman, N. T., & Monteiro, A. M. (2018). Predicting stock market index daily direction: a Bayesian network approach. Expert Systems with Applications, 105, 186–193. <https://doi.org/10.1016/j.eswa.2018.03.039>.

Nižetić, S., Šolić, P., Gonzalez-De, D. L. D. I., & Patrono, L. (2020). Internet of Things (IoT): Opportunities, issues and challenges towards a smart and sustainable future. *Journal of Cleaner Production*, *274*, 122877. <https://doi.org/10.1016/j.jclepro.2020.122877>.

Patki, N., Wedge, R., & Veeramachaneni, K. (2016). The synthetic data vault. In *2016 IEEE International Conference on Data Science and Advanced Analytics (DSAA)* (pp. 399–410). IEEE. <https://doi.org/10.1109/DSAA.2016.49>.

Ramavath, S. K. (2025). Hybrid forecasting systems for inventory optimization using prophet and reinforcement learning. International Journal of Computational and Experimental Science and Engineering, 11(4). <https://doi.org/10.22399/ijcesen.4123>.

Sethi, S. P., Zhang, Q., & Tayur, S. (2022). Supply Network Dynamics and Control. Springer.

Seyedan, M., & Mafakheri, F. (2020). Predictive big data analytics for supply chain demand predicting: Methods, applications, and research opportunities. Journal Of Big Data, 7(1), 53. <https://doi.org/10.1186/s40537-020-00329-2>.

Taquía Gutiérrez, J. A. (2023). Impact of Bayesian approach to demand management in supply chains for the consumption of dynamic products. Computación Y Sistemas, 27(2), 545–552. <https://doi.org/10.13053/cys-27-2-4382>.

Verified Market Research. (2023). Malaysia pet food market size, share, trends & predict. <https://www.Verifiedmarketresearch.Com/Product/Malaysia-Pet-Food-Market/>.

Xiao, Z. (2025). Bayesian inference for dynamic demand forecasting and inventory optimization. Theoretical And Natural Science, 92, 116–122. <https://doi.org/10.54254/2753-8818/2025.22036>.

|  |  |
| --- | --- |
| ![A picture containing text, clipart  Description automatically generated](data:image/png;base64...) | © 2026 by the authors. Submitted for possible open access publication under the terms and conditions of the Creative Commons Attribution (CC BY) license (http://creativecommons.org/licenses/by/4.0/). |

1. ,3\*Corresponding author. *E-mail address*: ssalwa@uitm.edu.my [↑](#footnote-ref-1)
