Views
No views yet
estimate_route_time() formula.| Feature | Importance |
|---|---|
num_packages | 0.1579 |
num_stops | 0.2307 |
total_distance_km | 0.1216 |
avg_distance_km | 0.0709 |
spatial_spread_km | 0.1569 |
start_hour | 0.0713 |
active_hours | 0.0852 |
packages_per_stop | 0.1055 |
1from skops import io as sio
2from huggingface_hub import hf_hub_download
3import numpy as np
4
5# Download and load
6model_path = hf_hub_download(repo_id="muthuk1/fairrelay-delivery-time", filename="model.skops")
7untrusted = sio.get_untrusted_types(file=model_path)
8model = sio.load(model_path, trusted=untrusted)
9
10# Predict: [num_packages, num_stops, total_distance_km, avg_distance_km,
11# spatial_spread_km, start_hour, active_hours, packages_per_stop]
12features = np.array([[25, 15, 12.5, 0.83, 5.2, 9, 6, 1.67]])
13predicted_minutes = model.predict(features)
14print(f"Estimated delivery time: {predicted_minutes[0]:.0f} minutes")estimate_route_time() formula