TabularPredictor.fit_extra

TabularPredictor.fit_extra(hyperparameters: str | dict[str, Any], time_limit: float = None, base_model_names: list[str] = None, fit_weighted_ensemble: bool = True, fit_full_last_level_weighted_ensemble: bool = True, full_weighted_ensemble_additionally: bool = False, num_cpus: str | int = 'auto', num_gpus: str | int = 'auto', fit_strategy: Literal['auto', 'sequential', 'parallel'] = 'auto', memory_limit: float | str = 'auto', **kwargs) TabularPredictor[source]

在调用原始 TabularPredictor.fit() 后拟合额外的模型。将使用原始的 train_data 和 tuning_data 来训练模型。

参数:
  • hyperparameters (str or dict) – 参考 TabularPredictor.fit() 中的参数文档。如果指定了 base_model_names 并且 hyperparameters 使用基于级别的键表示法,则直接使用基础模型的级别的键应为 1。hyperparameters 字典中的级别是相对的,而不是绝对的。

  • time_limit (int, default = None) – 参考 TabularPredictor.fit() 中的参数文档。

  • base_model_names (list[str], default = None) – 在此拟合调用中用作基础模型的名称。基础模型将提供其折外预测作为 hyperparameters 中模型的附加特征。如果指定,训练的所有模型都将是堆叠集成模型。如果为 None,模型将按照在 TabularPredictor.fit() 中指定的方式进行训练,不依赖于现有模型。仅在启用 bagging 时有效。

  • fit_weighted_ensemble (bool, default = True) – 如果为 True,将在每个堆叠层中拟合一个 WeightedEnsembleModel。加权集成模型通常比单个模型更强大,同时训练速度非常快。建议将此值设置为 True 以最大化预测质量。

  • fit_full_last_level_weighted_ensemble (bool, default = True) – 如果为 True,则最后一层堆叠的 WeightedEnsembleModel 将使用所有之前层的所有(成功)模型作为基础模型进行拟合。如果禁用了堆叠,将其设置为 True 或 False 没有区别,因为 WeightedEnsembleModel L2 始终使用 L1 中的所有模型。建议将此值设置为 True 以最大化预测质量。

  • full_weighted_ensemble_additionally (bool, default = False) – 如果为 True,AutoGluon 将在训练完所有堆叠层后拟合两个 WeightedEnsembleModel。将其设置为 True,模拟了在调用 fit() 后调用 fit_weighted_ensemble() 的行为。如果 fit_full_last_level_weighted_ensemble 为 False 则无效,并且如果禁用了堆叠也不会拟合额外的 WeightedEnsembleModel。

  • num_cpus (int, default = "auto") – 您希望 AutoGluon 预测器使用的 CPU 总数。Auto 意味着 AutoGluon 将根据可用的 CPU 总数和模型对最佳性能的要求做出决策。用户通常不需要设置此值

  • num_gpus (int, default = "auto") – 您希望 AutoGluon 预测器使用的 GPU 总数。Auto 意味着 AutoGluon 将根据可用的 GPU 总数和模型对最佳性能的要求做出决策。用户通常不需要设置此值

  • fit_strategy (Literal["auto", "sequential", "parallel"], default = "auto") –

    用于拟合模型的策略。如果为“auto”,则使用与原始 TabularPredictor.fit() 调用中使用的 fit_strategy 相同的策略。如果为“sequential”,模型将按顺序拟合。这是最稳定的选项,具有最易读的日志记录。如果为“parallel”,模型将使用 ray 并行拟合,在它们之间分配可用计算资源。

    注意:“parallel” 是实验性的,可能会遇到问题。它首次添加于 1.2.0 版本。

    对于拥有 16 个或更多 CPU 内核的机器,很可能“parallel” 会比“sequential”更快。

    添加于 1.2.0 版本。

  • memory_limit (float | str, default = "auto") – 您希望 AutoGluon 预测器使用的总内存量(以 GB 为单位)。“auto” 意味着 AutoGluon 将使用系统上所有可用的内存(psutil 可以检测到的)。请注意,这只是一个软限制!AutoGluon 使用此限制来跳过那些预计需要太多内存的模型训练,或者停止训练会超过内存限制的模型。AutoGluon 尚不保证强制执行此限制。尽管如此,我们期望 AutoGluon 在大多数情况下遵守此限制,或者至多仅略微超出限制。对于大多数虚拟化系统(例如云端)以及在服务器或笔记本电脑上的本地使用,“auto” 是此参数的理想选择。我们建议在操作系统控制(例如 SLURM 和 cgroups)的共享资源系统上手动设置内存限制(以及任何其他资源)。否则,AutoGluon 可能会错误地认为可用于拟合模型的资源比操作系统允许的更多,这可能导致模型训练失败或效率低下。

  • **kwargs

    参考 TabularPredictor.fit() 中的 kwargs 文档。请注意,以下 kwargs 在 fit_extra 中不可用,因为它们无法更改其在 fit() 中设置的值

    [holdout_frac, num_bag_folds, auto_stack, feature_generator, unlabeled_data]

    此外,dynamic_stackingfit_extra 中也不可用,因为只有在第一次拟合时才支持检测堆叠过拟合。pseudo_data : pd.DataFrame, 默认值 = None

    由 AutoGluon 模型自标记的数据,将在“fit_extra”期间纳入训练。