How alekhyabhupati/demand-forecasting-models-for-supply-chain-using-statistical-and-machine-learning-algorithms works
Project type and purpose
• This is a standalone data-science pipeline written in Python for demand forecasting in a supply-chain context.
• It ingests historical sales data (CSV), applies a battery of time‐series and machine‐learning algorithms, uses an ensemble strategy to select the best forecasts, and emits results in multiple formats (JSON, CSV, HTML), plus an Excel playbook for manual visualization.
File structure
• Model_Implementation/Code/Sales_Forecasting.py: main Python script containing the entire pipeline
• Model_Implementation/Input_Data_File/Sales_data.csv: raw historical data of SKUs
• Model_Implementation/Output Files/: generated artifacts including forecast CSVs, JSON summaries, HTML report
• Visualization/Forecast_Sales_Playbook.xlsx: Excel workbook for interactive review of forecasts
• README.md: full description of objectives, algorithms, evaluation metrics, and research questions
Examining the README
• Confirms the use of multiple time-series (AR, ARMA, ARIMA, SES, HWES) and ML algorithms (linear models, tree models, kNN, SVM regression) with an ensemble layer (AdaBoost, Bagging, RF, ET, GBM).
• Indicates evaluation metrics (RMSE, MAPE, forecast accuracy) and comparison across SKUs.
Main components
a. Data Source
• Input CSV file stored locally or in a data lake
b. Data Preprocessing
• Reading CSV, cleaning, ABC classification, ACF/PACF calculations
c. Modeling Layer
• Time-Series Module: AR, ARMA, ARIMA, SMA, SES, HWES
• ML Module: LR, Lasso, Ridge, Elastic Net, Huber, LLARS, PassiveAggressive, CART, kNN, SVMR
d. Ensemble Engine
• AdaBoost, Bagging, Random Forest, Extra Trees, Gradient Boosting
• Decision integration strategy that picks the best model per SKU
e. Evaluation & Metrics
• Compute RMSE, MAPE, forecast accuracy for each model and for the ensemble
f. Output Generator
• Write forecasts to CSV (forecast_data.csv, all_skus_output.csv, best_models.csv)
• Serialize summary to JSON (Sales_data.json)
• Generate HTML report (Output_html_file.html)
g. Visualization/Playbook
• Populate Forecast_Sales_Playbook.xlsx with results for interactive analysis
Architectural patterns and design principles
• Pipeline pattern with modular stages (clean-transform-model-evaluate-report).
• Separation of concerns: each algorithm group in its own subcomponent.
• Pluggable architecture: easy to add new models or metrics.
• Single-entry point (Sales_Forecasting.py) driving the entire orchestration.
Key technologies and libraries
• Python 3.x
• pandas for data handling
• statsmodels for time-series
• scikit-learn for ML algorithms and ensemble methods
• matplotlib/seaborn or plotly (implicit for HTML report)
• openpyxl or xlsxwriter for Excel playbook