From Stockouts to Smart Shelves: How Random-Mart Can Optimize Inventory with Predictive Analytics
- ohussein31
- Oct 15
- 3 min read
Business Problem
Random-Mart, a local retail chain, faces a persistent challenge: inventory imbalance. Popular items often sell out during peak seasons, while slower-moving products accumulate in storage.
These mismatches lead to:
Lost sales
Excess holding costs
Poor customer experience
To address this, Random-Mart reached out to Bayanat Analytics to develop a predictive analytics-based strategy that aligns inventory with actual demand patterns.
Data Transformation
Exploratory Analysis
The exploratory data analysis (EDA) was conducted to gain insights into customer purchasing patterns, spending behavior, and the influence of external factors such as seasonality and weather conditions. The analysis focused on understanding the distribution of key variables, correlations between drivers of sales, and identifying general trends that can support Random-Mart’s operational and marketing decisions.

Interpretation:
Sales are consistent through seasons
Credit cards are the most used payment method, far ahead of debit cards and cash.
Rain does not affect how much people spend—spending is similar whether it rains or not.
Trends Over Time

From our analysis of customer transactions, a few clear patterns emerged:
Spending habits vary by day: Fridays and Saturdays show the highest number of transactions, suggesting stronger weekend shopping activity.
Payment preferences: Credit cards and debit cards are the most common payment methods, while cash and e-payments are used less often.
Weather effects: Rainy days do not drastically change overall spending levels, but there’s a small drop in average spending on days with rainfall.
Seasonal trends: Total spending tends to rise during Spring and Summer, while Winter and Fall show slightly lower totals. This may reflect seasonal promotions or better weather encouraging more shopping.
Overall, the data suggests that weekends, warm weather, and card payments drive higher transaction volumes and total spending — valuable insights for marketing and operational planning.
Regression Modeling
The regression model was designed to explain and predict daily total spending using factors such as weather conditions, day of the week, season, and time of year. The model performs strongly overall, with an R-squared of 0.85, meaning it explains about 85% of the variation in daily transaction totals — a high level of explanatory power for this type of data.
Key insights:
Day of the Week is the strongest driver of spending. Fridays, Saturdays, and Sundays show significantly higher spending than Mondays. This pattern confirms the weekend boost observed in the exploratory analysis.
Weather has a minor but notable effect. Higher maximum temperatures are associated with slightly increased spending, suggesting warmer days encourage more consumer activity. Rain, however, does not have a statistically significant impact.
Seasonal effects are strong and meaningful. Spending patterns vary noticeably across seasons, with Spring and Summer showing higher daily totals compared to Fall and Winter. This suggests that customer activity increases during warmer and brighter months, possibly due to more outdoor activity, promotions, or seasonal demand.
Model diagnostics indicate that the model fits the data well, though the large condition number suggests that some predictor variables (like months and seasons) may overlap in their effects — a common occurrence with time-based data.
Summary:
The analysis shows that seasonal and weekly timing are the primary factors influencing total daily spending, with stronger sales in warmer seasons and weekends. Weather variations such as temperature contribute modestly, while rainfall plays a minimal role in consumer behavior.
Next Steps:
To create a more targeted analysis for the best-selling products—where stocking issues were identified—we took the following next steps.
Build regression models for best-selling products to identify key sales drivers
Analyze seasonal and weekday sales patterns for targeted planning.
Add promotion and pricing data to improve model accuracy.
Validate models using train/test splits for predictive performance.
Results
In summary, over the first quarter of 2024, applying predictive models for best-selling products—alongside total sales analyses for other items—would have enabled Random-Mart to make more informed inventory decisions. As a result, the company would likely have seen a noticeable reduction in out-of-stock alerts and a decline in customer complaints related to product availability, reflecting improved operational efficiency and demand forecasting.



Comments