yamle.trainers.ensemble module#

class yamle.trainers.ensemble.BaggingTrainer(*args, **kwargs)[source]#

Bases: BaseTrainer

This class defines a bagging trainer which given a method and multiple data splits performs training and evaluation.

The difference is that the data is split across training splits and the training is performed in parallel for each training split.

fit()[source]#

This method trains the method and the embedded model.

Return type:

None

class yamle.trainers.ensemble.EnsembleTrainer(parallel=False, *args, **kwargs)[source]#

Bases: BaggingTrainer

This class defines an ensemble trainer which given a method and data loaders performs training and evaluation.

The difference is that the training is performed repeatedly for all ensemble members. If training data splits are provided, the training is performed with respect to the data splits which are separate for each ensemble member.

If the training is defines as parallel, this trainer returns multiple train loaders to the method. Then it is the method’s responsibility to train the ensemble members in parallel.

Parameters:

parallel (bool) – Whether to train the ensemble members in parallel.

fit(results)[source]#

This method trains the method and the embedded model.

It also measures the time taken for training and returns it.

Return type:

float

static add_specific_args(parent_parser)[source]#

This method adds the specific arguments for the ensemble trainer.

Return type:

ArgumentParser