deephyper.ensemble.selector.Selector

deephyper.ensemble.selector.Selector#

class deephyper.ensemble.selector.Selector(loss_func: Callable | Loss)[source]#

Bases: ABC

Base class that represents an algorithm that select a subset of predictors from a set of available predictors in order to build an ensemble.

Parameters:

loss_func (Callable or Loss) – a loss function that takes two arguments: the true target values and the predicted target values.

Methods

select

The selection algorithms.

abstract select(y, y_predictors) Tuple[Sequence[int], Sequence[float]][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]