This project implements a Demand Forecasting System using Python, Facebook Prophet, and AWS Lambda to predict inventory demand and optimize stock levels. The system helps businesses reduce inventory costs and improve forecast accuracy.
- ✅ Reduced inventory costs by 30%
- ✅ Improved forecast accuracy by 40%
The system follows a serverless architecture deployed on AWS:
- Data Ingestion: Sales and inventory data are stored in Amazon DynamoDB.
- Prediction Model: A forecasting model using Facebook Prophet processes the data.
- AWS Lambda Function: Runs the Prophet model on-demand to generate predictions.
- CloudWatch Monitoring: Logs execution details and errors.
- Python 🐍 (Data processing & Model development)
- Prophet 📈 (Time-series forecasting)
- AWS Lambda ⚡ (Serverless execution)
- DynamoDB 🗄️ (NoSQL storage for historical and predicted data)
- CloudWatch 🔍 (Monitoring and logging)
git clone https://github.com/yourusername/demand-forecasting-system.git
cd demand-forecasting-system
python -m venv venv
source venv/bin/activate # (Mac/Linux)
venv\Scripts\activate # (Windows)
pip install -r requirements.txt
python src/model.py
- Step 1: Upload the model script to AWS Lambda.
- Step 2: Connect Lambda to DynamoDB.
- Step 3: Configure CloudWatch for monitoring.
demand-forecasting-system/
├── data/ # Sample dataset (historical sales data)
├── src/ # Source code for model & AWS integration
│ ├── model.py # Prophet forecasting model
│ ├── lambda_function.py # AWS Lambda function script
│ ├── dynamodb.py # DynamoDB interaction script
├── requirements.txt # Dependencies
├── README.md # Documentation
import pandas as pd
from prophet import Prophet
# Load sample dataset
df = pd.read_csv('data/sales_data.csv')
df.rename(columns={'date': 'ds', 'sales': 'y'}, inplace=True)
# Initialize and fit the Prophet model
model = Prophet()
model.fit(df)
# Make future predictions
future = model.make_future_dataframe(periods=30)
forecast = model.predict(future)
# Save predictions
forecast[['ds', 'yhat', 'yhat_lower', 'yhat_upper']].to_csv('data/forecast.csv', index=False)
- Implement DynamoDB integration.
- Deploy AWS Lambda function.
- Enable CloudWatch monitoring.
👨💻 Contributions & Feedback are Welcome! 🚀