deephyper.ensemble.selector.TopKSelector#
- class deephyper.ensemble.selector.TopKSelector(loss_func: Callable | Loss, k: int = 5)[source]#
Bases:
Selector
Selection method implementing Top-K selection. This method selects the K predictors with the lowest loss.
- Parameters:
Methods
The selection algorithms.
- select(y, y_predictors) Sequence[int] [source]#
The selection algorithms.
- Parameters:
y (np.ndarray) – the true target values.
y_predictors (_type_) – a sequence of predictions from available predictors. It should be a list of length
n_predictors
with each element being the prediction of a predictor.
- Returns:
the sequence of selected predictors. Sequence[float]: the sequence of weights associated to the selected predictors.
- Return type:
Sequence[int]