utilities¤
Helpers for lists and Pareto fronts.
Lists¤
list_split
¤
Split list at given indices. Closed lists have the same first and last elements. If the list is closed, splitting wraps around if the first or last index is not in the indices to split.
Parameters:
Returns:
-
split_lists(list) –Nest lists from splitting the list at the given indices.
sublist_from_to_items_in_closed_list
¤
sublist_from_to_items_in_closed_list(
lst: list[Any], from_item: Any, to_item: Any
) -> list[Any] | None
Return sublist between oe item to another.
Parameters:
-
lst(list) –A list. -
from_item(Any) –An item to be found in the list. The beginning of the sublist. -
to_item(Any) –An item to be found in the list. The end of the sublist.
Returns:
-
sublist(list) –A sublist from the input list, between from_item and to_item.
are_items_in_list
¤
common_items
¤
remove_isomorphism_in_integer_list
¤
Pareto¤
extract_pareto_indices
¤
Get the Pareto front from data. The performances are to be minimised. If the metrics must be maximised, take the opposite X <- -X and the inverse k <- 1/k.
Parameters:
-
data(list) –A list of iterables storing the performance data.
-
k(float, default:1.0) –Parameter for weak domination. Default is 1.0.
Returns:
-
list–List of indices of Pareto front in data.
References
- Wikipedia. Multi-objective optimization. Available at: https://en.wikipedia.org/wiki/Multi-objective_optimization.
is_dominating
¤
Check if design X1 dominates X2: all metrics below or equal and one strictly below.
k below 1.0 allows weak domination.
Parameters:
-
X1(iterable) –A design to test if is dominating.
-
X2(iterable) –A design to test if is dominated.
-
k(float, default:1.0) –Parameter for weak domination. Default if 1.0.
Returns:
-
bool–True if is dominating, False otherwise
References
- Wikipedia. Multi-objective optimization. Available at: https://en.wikipedia.org/wiki/Multi-objective_optimization.