seqme.models.Ensemble

seqme.models.Ensemble#

class seqme.models.Ensemble(predictors, weights=None)[source]#

Combines multiple predictor functions into a weighted ensemble.

Each predictor maps sequences to numeric arrays. The final output is a weighted sum of individual predictions.

__init__(predictors, weights=None)[source]#

Initialize the ensemble of predictors.

Parameters:
  • predictors (list[Callable[[list[str]], ndarray]]) – List of callables that produce predictions for the given sequences.

  • weights (Union[list[float], ndarray, None]) – Optional list of weights for each predictor. If None, all predictors are weighted equally.

Raises:

ValueError – If the length of weights does not match the number of predictors.

__call__(sequences)[source]#

Compute ensemble predictions on a list of sequences.

Parameters:

sequences (list[str]) – Input sequences to the predictors.

Return type:

ndarray

Returns:

Array of weighted predictions.

Methods

__init__(predictors[, weights])

Initialize the ensemble of predictors.

__call__(sequences)

Compute ensemble predictions on a list of sequences.