Update v2 model card
Browse files
README.md
CHANGED
|
@@ -1,49 +1,50 @@
|
|
| 1 |
---
|
| 2 |
library_name: sklearn
|
| 3 |
tags:
|
|
|
|
| 4 |
- logistics
|
| 5 |
- xgboost
|
| 6 |
- sklearn
|
| 7 |
- tabular-regression
|
| 8 |
-
- eta-prediction
|
| 9 |
- delivery-time
|
| 10 |
-
-
|
| 11 |
datasets:
|
| 12 |
- Cainiao-AI/LaDe-D
|
| 13 |
-
- electricsheepafrica/africa-synth-retail-and-ecommerce-last-mile-delivery-data-nigeria
|
| 14 |
license: mit
|
| 15 |
---
|
| 16 |
|
| 17 |
-
# FairRelay — Delivery Time Estimation Model
|
| 18 |
|
| 19 |
Part of the **[FairRelay](https://github.com/MUTHUKUMARAN-K-1/FairRelay)** AI logistics platform.
|
| 20 |
|
| 21 |
## Model Description
|
| 22 |
|
| 23 |
-
|
| 24 |
|
| 25 |
-
**Type**: XGBRegressor Pipeline
|
| 26 |
-
**
|
| 27 |
-
**Task**: Regression
|
| 28 |
|
| 29 |
## Performance
|
| 30 |
|
| 31 |
-
- **R²**: 0.
|
| 32 |
-
- **MAE**:
|
| 33 |
-
- **RMSE**:
|
| 34 |
-
- **
|
| 35 |
-
|
|
|
|
| 36 |
|
| 37 |
## Input Features
|
| 38 |
|
| 39 |
| Feature | Importance |
|
| 40 |
|---------|-----------|
|
| 41 |
-
| `
|
| 42 |
-
| `
|
| 43 |
-
| `
|
| 44 |
-
| `
|
| 45 |
-
| `
|
| 46 |
-
| `
|
|
|
|
|
|
|
| 47 |
|
| 48 |
|
| 49 |
## Usage
|
|
@@ -51,23 +52,24 @@ Delivery Time Estimation Model
|
|
| 51 |
```python
|
| 52 |
from skops import io as sio
|
| 53 |
from huggingface_hub import hf_hub_download
|
|
|
|
| 54 |
|
| 55 |
# Download and load
|
| 56 |
model_path = hf_hub_download(repo_id="muthuk1/fairrelay-delivery-time", filename="model.skops")
|
| 57 |
untrusted = sio.get_untrusted_types(file=model_path)
|
| 58 |
model = sio.load(model_path, trusted=untrusted)
|
| 59 |
|
| 60 |
-
# Predict
|
| 61 |
-
|
| 62 |
-
features = np.array([[
|
| 63 |
-
|
|
|
|
| 64 |
```
|
| 65 |
|
| 66 |
## Training Data
|
| 67 |
|
| 68 |
-
- **Cainiao-AI/LaDe-D**: Real last-mile delivery data from
|
| 69 |
-
- **
|
| 70 |
-
- **FairRelay Synthetic**: Physics-informed synthetic data calibrated to FairRelay's deterministic formulas
|
| 71 |
|
| 72 |
## Part of FairRelay
|
| 73 |
|
|
|
|
| 1 |
---
|
| 2 |
library_name: sklearn
|
| 3 |
tags:
|
| 4 |
+
- fairrelay
|
| 5 |
- logistics
|
| 6 |
- xgboost
|
| 7 |
- sklearn
|
| 8 |
- tabular-regression
|
|
|
|
| 9 |
- delivery-time
|
| 10 |
+
- eta-prediction
|
| 11 |
datasets:
|
| 12 |
- Cainiao-AI/LaDe-D
|
|
|
|
| 13 |
license: mit
|
| 14 |
---
|
| 15 |
|
| 16 |
+
# FairRelay — Delivery Time Estimation Model (v2)
|
| 17 |
|
| 18 |
Part of the **[FairRelay](https://github.com/MUTHUKUMARAN-K-1/FairRelay)** AI logistics platform.
|
| 19 |
|
| 20 |
## Model Description
|
| 21 |
|
| 22 |
+
Predicts total delivery time (in minutes) for a courier's daily route based on package count, stops, distance, and temporal features. Trained on real last-mile delivery data from **Cainiao-AI/LaDe-D** (KDD 2023, Shanghai + Hangzhou, ~70K courier-days) combined with physics-informed synthetic data calibrated to FairRelay's `estimate_route_time()` formula.
|
| 23 |
|
| 24 |
+
**Type**: XGBRegressor Pipeline (StandardScaler + XGBoost)
|
| 25 |
+
**Task**: Regression (delivery time in minutes)
|
|
|
|
| 26 |
|
| 27 |
## Performance
|
| 28 |
|
| 29 |
+
- **R²**: 0.6206
|
| 30 |
+
- **MAE**: 73.01 minutes
|
| 31 |
+
- **RMSE**: 105.68 minutes
|
| 32 |
+
- **Median AE**: 46.03 minutes
|
| 33 |
+
- **MAPE**: 33.4%
|
| 34 |
+
- **CV R² (5-fold)**: 0.5580 ± 0.2773
|
| 35 |
|
| 36 |
## Input Features
|
| 37 |
|
| 38 |
| Feature | Importance |
|
| 39 |
|---------|-----------|
|
| 40 |
+
| `num_packages` | 0.1579 |
|
| 41 |
+
| `num_stops` | 0.2307 |
|
| 42 |
+
| `total_distance_km` | 0.1216 |
|
| 43 |
+
| `avg_distance_km` | 0.0709 |
|
| 44 |
+
| `spatial_spread_km` | 0.1569 |
|
| 45 |
+
| `start_hour` | 0.0713 |
|
| 46 |
+
| `active_hours` | 0.0852 |
|
| 47 |
+
| `packages_per_stop` | 0.1055 |
|
| 48 |
|
| 49 |
|
| 50 |
## Usage
|
|
|
|
| 52 |
```python
|
| 53 |
from skops import io as sio
|
| 54 |
from huggingface_hub import hf_hub_download
|
| 55 |
+
import numpy as np
|
| 56 |
|
| 57 |
# Download and load
|
| 58 |
model_path = hf_hub_download(repo_id="muthuk1/fairrelay-delivery-time", filename="model.skops")
|
| 59 |
untrusted = sio.get_untrusted_types(file=model_path)
|
| 60 |
model = sio.load(model_path, trusted=untrusted)
|
| 61 |
|
| 62 |
+
# Predict: [num_packages, num_stops, total_distance_km, avg_distance_km,
|
| 63 |
+
# spatial_spread_km, start_hour, active_hours, packages_per_stop]
|
| 64 |
+
features = np.array([[25, 15, 12.5, 0.83, 5.2, 9, 6, 1.67]])
|
| 65 |
+
predicted_minutes = model.predict(features)
|
| 66 |
+
print(f"Estimated delivery time: {predicted_minutes[0]:.0f} minutes")
|
| 67 |
```
|
| 68 |
|
| 69 |
## Training Data
|
| 70 |
|
| 71 |
+
- **Cainiao-AI/LaDe-D**: Real last-mile delivery data (Shanghai + Hangzhou splits, ~70K courier-days from 1.5M+ individual deliveries)
|
| 72 |
+
- **FairRelay Synthetic**: 20K samples with physics-informed noise, calibrated to `estimate_route_time()` formula
|
|
|
|
| 73 |
|
| 74 |
## Part of FairRelay
|
| 75 |
|