hots.evaluation.evaluator
Evaluation utilities for HOTS.
- class hots.evaluation.evaluator.EvalSnapshot(labels: ndarray, placement: dict[Any, Any], tick: int)[source]
Bases:
objectAll the info we need to compare two consecutive evaluations.
- labels: ndarray
- placement: dict[Any, Any]
- tick: int
- hots.evaluation.evaluator.eval_solutions(instance, clustering, clust_opt, problem_opt, problem, working_df, *, prev_snapshot: EvalSnapshot | None = None, tick: int | None = None) dict[str, Any][source]
Run the evaluation pipeline and collect evaluation metrics.
- hots.evaluation.evaluator.eval_step_kpis(instance, labels, placement, prev_snapshot: EvalSnapshot | None, tick: int, *, working_df: DataFrame | None = None) tuple[EvalSnapshot, dict[str, Any]][source]
Evaluate the two-stage result at this tick, comparing to previous snapshot.
- Returns:
(snapshot, metrics_dict)
- hots.evaluation.evaluator.get_conflict_graph(cur_duals: dict[Any, float], prev_duals: dict[Any, float], tol: float) Graph[source]
Build conflict graph where edges represent dual increases above tolerance.
- hots.evaluation.evaluator.get_container_tomove(instance, c1, c2, working_df: DataFrame)[source]
Pick between two containers by variance on c1’s placement node.
Chooses the container whose removal makes the node’s time series smoother (i.e., smaller variance of node_ts - container_ts).