Skip to content
Snippets Groups Projects
Unverified Commit 1f930a5f authored by Siraj R Aizlewood's avatar Siraj R Aizlewood
Browse files

Update layer.py

Following a request to be able to update route thresholds directly without having to fit.
parent 8600d9bb
Branches
Tags
No related merge requests found
......@@ -832,6 +832,22 @@ class RouteLayer:
def _get_route_names(self) -> List[str]:
return [route.name for route in self.routes]
def update_route_thresholds(self, threshold_dict: Dict[str, float]):
"""
Update thresholds for specified routes.
:param threshold_dict: A dictionary mapping route names to new threshold values.
:type threshold_dict: Dict[str, float]
"""
for route_name, new_threshold in threshold_dict.items():
route = self.get(route_name)
if route:
old_threshold = route.score_threshold
route.score_threshold = new_threshold
logger.info(f"Updated threshold for route '{route_name}' from {old_threshold} to {new_threshold}")
else:
logger.warning(f"Route '{route_name}' not found. Skipping threshold update.")
def threshold_random_search(
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment