Downloads · 30 days
0
ysakhale/cmu-ml-route-optimizer
cmu-ml-route-optimizer is a machine learning model from ysakhale. Use it for the machine learning task on the model card, and read the license before you ship it in a product. The card lists the license as mit.
This is a fine-tuned machine learning approach to route optimization that combines traditional routing algorithms with ML-based preference learning. It uses a neural network to optimize routes considering user prefere…
Downloads · 30 days
0
Access
Public
Updated Oct 9, 2025
Repo size
—
Likes
1
Public
Click a slice to open those files.
.py11.9 KB · 64%
From the Hugging Face model README
This is a fine-tuned machine learning approach to route optimization that combines traditional routing algorithms with ML-based preference learning. It uses a neural network to optimize routes considering user preferences and geographic constraints.
class RouteOptimizer(nn.Module):
def __init__(self, input_dim):
super().__init__()
self.fc1 = nn.Linear(input_dim, 64)
self.fc2 = nn.Linear(64, 32)
self.fc3 = nn.Linear(32, 1)
self.relu = nn.ReLU()
self.dropout = nn.Dropout(0.2)
1. Extract ML features for each landmark
2. Score landmarks using neural network
3. Apply nearest neighbor ordering with ML scores
4. Post-process with 2-opt improvement
Training Accuracy: 85-90% preference satisfaction
Route Efficiency: 5-15% improvement over traditional
Preference Satisfaction: 70-85% user preference alignment
Execution Time: < 50ms for 20 landmarks
from model import MLRouteOptimizer, load_model_from_data
# Load model from landmarks data
optimizer = load_model_from_data('data/landmarks.json')
# Optimize route with ML
selected_indices = [0, 5, 10, 15, 20] # Landmark indices to visit
start_idx = 0
time_budget = 120.0
preferences = {
'selected_classes': ['Culture', 'Research'],
'indoor_pref': 'indoor',
'min_rating': 4.0
}
# Get optimized route
optimized_route = optimizer.optimize_route(
selected_indices, start_idx, time_budget, preferences
)
print(f"Optimized route: {optimized_route}")
# Compare with traditional method
comparison = optimizer.compare_routing_methods(
selected_indices, start_idx, preferences, time_budget
)
print(f"Distance improvement: {comparison['comparison']['distance_improvement']:.1%}")
print(f"Preference improvement: {comparison['comparison']['preference_improvement']:.3f}")
model.py: Main model implementationREADME.md: This model cardBased on model analysis:
The ML router:
@misc{cmu-explorer-ml-router,
title={ML-Enhanced Route Optimization},
author={Yash Sakhale, Faiyaz Azam},
year={2025},
url={https://huggingface.co/spaces/ysakhale/Tartan-Explore}
}
For questions about this model, please refer to the CMU Explorer Space.