skfolio.utils.tools.deduplicate_names#

skfolio.utils.tools.deduplicate_names(names)[source]#

Rename duplicated names by appending “_{duplicate_nb}” at the end.

Preserve the first occurrence of each name. Suffixes start at 1 and skip names present anywhere in the input or already generated for a duplicate.

This function is inspired by the pandas function _maybe_dedup_names.

Parameters:
namesarray-like of shape (n_names,)

List of names.

Returns:
nameslist[str]

Unique names in the original order.