cblearn.preprocessing.triplets_from_multiselect#
- cblearn.preprocessing.triplets_from_multiselect(X, select, is_ranked)[source]#
Calculate triplets from n-select or n-rank queries.
The n-select query consists of \(k>2\) object indices. The first index indicates the pivot object. The selected objects should be more similar to the pivot, than the other objects. The selected objects themself can be ordered in similarity to the pivot (is_ranked=True).
Triplets are a special case of n-select queries, with a single other object.
- Parameters:
- Returns:
- Array of triplet queries
(n_query * (2 * (n_choices - n_select - 1) + int(is_ranked)), 3)
- Return type:
triplets