cblearn.preprocessing.triplets_from_oddoneout#
- cblearn.preprocessing.triplets_from_oddoneout(X, y=None)[source]#
Calculates triplets from odd-one-out queries.
The odd-one-out query consists of k objects, of which one is most dissimilar to all others.
Note
For this transformation, we are assuming that the objects respect the triangle inequality. This might not always be a given and is not checked by this function.
- Parameters:
- Returns:
Array of triplet queries (n_query * (n_choices - 2) * (n_choices - 1), 3)
- Return type:
triplets