peppr.RandomSelector#
- class peppr.RandomSelector(k: int, seed: int = 42)[source]#
Selector that returns the best value from k randomly chosen values. Using this selector is equivalent to using the
TopSelector
with random confidence values.- Parameters:
- kint
The best value is chosen from k randomly chosen predictions.
- seedint, optional
The seed for the random number generator. Defaults to 42.
- select(values: ndarray, smaller_is_better: bool) float #
Select the representative metric value from a set of poses.
The meaning of ‘representative’ depends on the specific
Selector
subclass.ABSTRACT: Must be overridden by subclasses.
- Parameters:
- valuesndarray, shape=(n,), dtype=float
The metric values to select from. May contain NaN values. The values are sorted from highest to lowest confidence.
- smaller_is_betterbool
Whether the smaller value is considered a better prediction.
- Returns:
- float
The selected value.