TabularPredictor.fit_weighted_ensemble

TabularPredictor.fit_weighted_ensemble(base_models: list | None = None, name_suffix='Best', expand_pareto_frontier=False, time_limit=None, refit_full=False)[source]

Fits new weighted ensemble models to combine predictions of previously-trained models. cache_data must have been set to True during the original training to enable this functionality.

Parameters:
  • base_models (list, default = None) – List of model names the weighted ensemble can consider as candidates. If None, all previously trained models are considered except for weighted ensemble models. As an example, to train a weighted ensemble that can only have weights assigned to the models ‘model_a’ and ‘model_b’, set base_models=[‘model_a’, ‘model_b’]

  • name_suffix (str, default = 'Best') – Name suffix to add to the name of the newly fitted ensemble model.

  • expand_pareto_frontier (bool, default = False) – If True, will train N-1 weighted ensemble models instead of 1, where N=len(base_models). The final model trained when True is equivalent to the model trained when False. These weighted ensemble models will attempt to expand the pareto frontier. This will create many different weighted ensembles which have different accuracy/memory/inference-speed trade-offs. This is particularly useful when inference speed is an important consideration.

  • time_limit (int, default = None) – Time in seconds each weighted ensemble model is allowed to train for. If expand_pareto_frontier=True, the time_limit value is applied to each model. If None, the ensemble models train without time restriction.

  • refit_full (bool, default = False) – If True, will apply refit_full to all weighted ensembles created during this call. Identical to calling predictor.refit_full(model=predictor.fit_weighted_ensemble(…))

Returns:

  • List of newly trained weighted ensemble model names.

  • If an exception is encountered while training an ensemble model, that model’s name will be absent from the list.