TabularPredictor.fit_weighted_ensemble¶
- TabularPredictor.fit_weighted_ensemble(base_models: list = None, name_suffix: str = 'Best', expand_pareto_frontier: bool = False, time_limit: float = None, refit_full: bool = False, num_cpus: int | str = 'auto', num_gpus: int | str = 'auto')[source]¶
拟合新的加权集成模型以组合先前训练模型的预测。 cache_data 必须在原始训练期间设置为 True 才能启用此功能。
- Parameters:
base_models (list, default = None) – 加权集成可以考虑的模型名称列表。 如果为None,则考虑所有之前训练的模型,除了加权集成模型。 例如,要训练一个只能将权重分配给模型‘model_a’和‘model_b’的加权集成,设置 base_models=[‘model_a’, ‘model_b’]
name_suffix (str, default = 'Best') – 要添加到新拟合的集成模型名称中的名称后缀。
expand_pareto_frontier (bool, default = False) – 如果为True,将训练N-1个加权集成模型,而不是1个,其中N=len(base_models)。 当为True时训练的最终模型与为False时训练的模型相同。 这些加权集成模型将尝试扩展帕累托前沿。 这将创建许多不同的加权集成,这些集成具有不同的准确性/内存/推理速度权衡。 当推理速度是一个重要考虑因素时,这特别有用。
time_limit (float, default = None) – 每个加权集成模型允许训练的时间(以秒为单位)。如果 expand_pareto_frontier=True,则 time_limit 值将应用于每个模型。 如果为 None,则集成模型训练没有时间限制。
refit_full (bool, default = False) – 如果为True,将对此调用期间创建的所有加权集合应用refit_full。 等同于调用 predictor.refit_full(model=predictor.fit_weighted_ensemble(…))
num_cpus (int | str, default = "auto") – The total amount of cpus you want AutoGluon predictor to use. Auto means AutoGluon will make the decision based on the total number of cpus available and the model requirement for best performance. Users generally don’t need to set this value
num_gpus (int | str, default = "auto") – The total amount of gpus you want AutoGluon predictor to use. Auto means AutoGluon will make the decision based on the total number of gpus available and the model requirement for best performance. Users generally don’t need to set this value
- Returns:
新训练的加权集成模型名称列表。
如果在训练集成模型时遇到异常,该模型的名称将不会出现在列表中。