| # 📦 Random Forest Model for Inventory Optimization | |
| This is a trained **Random Forest Regressor** model for predicting **stockout risks** and **optimizing inventory levels** based on supplier lead time and demand fluctuations. | |
| ## Model Overview | |
| - **Algorithm Used**: Random Forest Regressor | |
| - **Purpose**: Forecasting inventory demand & optimizing reorder points | |
| - **Key Features**: | |
| - Supplier lead times | |
| - Order quantities | |
| - Shipment modes | |
| - Regional logistics data | |
| - Demand fluctuations | |
| ## 📊 Training Details | |
| - **Dataset**: Historical e-commerce inventory data (orders, shipments, supplier info) | |
| - **Feature Engineering**: Handled missing values, removed outliers, and normalized data | |
| - **Performance Metrics**: | |
| - **Mean Absolute Error (MAE):** *XYZ* | |
| - **Root Mean Squared Error (RMSE):** *XYZ* | |
| - **R² Score:** *XYZ* | |
| ## 🔧 How to Use the Model | |
| To load and use the model in Python: | |
| ```python | |
| import joblib | |
| from huggingface_hub import hf_hub_download | |
| # Download the model | |
| model_path = hf_hub_download(repo_id="sohnikaavisakula/inventory-optimization", filename="inventory_model.pkl") | |
| # Load the model | |
| model = joblib.load(model_path) | |
| # Example input (adjust based on your dataset) | |
| X_test = [[5.2, 1.3, 7.8, 3.1]] # Replace with real data | |
| prediction = model.predict(X_test) | |
| print("Predicted stockout risk:", prediction) | |