File size: 1,354 Bytes
cef44ca
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
# 📦 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)