Metrics
running_time_closed_gap(schedules, performance, budget, par, feature_time)
Calculates the closed gap metric for a given selector.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
schedules
|
Dict[str, List[Tuple[str, float]]]
|
The schedules to evaluate. |
required |
performance
|
DataFrame
|
The performance data for the algorithms. |
required |
budget
|
float
|
The budget for the scenario. |
required |
par
|
float
|
The penalization factor for unsolved instances. |
required |
feature_time
|
DataFrame
|
The feature time data for each instance. |
required |
Returns:
Name | Type | Description |
---|---|---|
float |
float
|
The closed gap value, representing the improvement of the selector over the single best solver |
float
|
relative to the virtual best solver. |
Source code in asf/metrics/baselines.py
running_time_selector_performance(schedules, performance, budget=5000, par=10, feature_time=None)
Calculates the total running time for a selector based on the given schedules and performance data.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
schedules
|
Dict[str, List[Tuple[str, float]]]
|
The schedules to evaluate, where each key is an instance and the value is a list of tuples (algorithm, allocated budget). |
required |
performance
|
DataFrame
|
The performance data for the algorithms. |
required |
budget
|
float
|
The budget for the scenario. |
5000
|
par
|
float
|
The penalization factor for unsolved instances. |
10
|
feature_time
|
Optional[DataFrame]
|
The feature time data for each instance. Defaults to zero if not provided. |
None
|
Returns:
Type | Description |
---|---|
Dict[str, Union[float, int]]
|
Dict[str, Union[float, int]]: A dictionary mapping each instance to its total running time. |
Source code in asf/metrics/baselines.py
single_best_solver(performance, maximize=False)
Selects the single best solver across all instances based on the aggregated performance.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
schedules
|
DataFrame
|
The schedules to evaluate (not used in this function). |
required |
performance
|
DataFrame
|
The performance data for the algorithms. |
required |
maximize
|
bool
|
Whether to maximize or minimize the performance. |
False
|
Returns:
Name | Type | Description |
---|---|---|
float |
float
|
The best aggregated performance value across all instances. |
Source code in asf/metrics/baselines.py
virtual_best_solver(performance, maximize=False)
Selects the virtual best solver for each instance by choosing the best performance per instance.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
schedules
|
DataFrame
|
The schedules to evaluate (not used in this function). |
required |
performance
|
DataFrame
|
The performance data for the algorithms. |
required |
maximize
|
bool
|
Whether to maximize or minimize the performance. |
False
|
Returns:
Name | Type | Description |
---|---|---|
float |
float
|
The sum of the best performance values for each instance. |