This function enables the relabeling of category labels based on the most significant terms, or top_terms, within each category. It takes two columns as inputs: one with the old_labels, which can be single or multi-valued categories, and one with the top_terms for each data point. The replacement of the labels is influenced by the specified rank method, which can be TFIDF, BACKGROUND, FOREGROUND, UPLIFT, ORDINAL, or ALPHANUM, and the number of top terms considered (specified by top_n).

rank_method
string
default: "TFIDF"

The method used to rank the top terms.

Values must be one of the following:

TFIDF BACKGROUND FOREGROUND UPLIFT ORDINAL ALPHANUM

top_n
integer
default: "4"

The number of top terms considered for each label.

Values must be in the following range:

1 ≤ top_n < inf
ascending
boolean

Whether the terms should be sorted in ascending order.