optuna.search_space.intersection_search_space

optuna.search_space.intersection_search_space(trials, include_pruned=False)[源代码]

返回给定 Trials 的交集搜索空间。

交集搜索空间包含到目前为止研究中已完成的 Trials 中建议的参数分布的交集。如果存在多个名称相同但分布不同的参数,则结果搜索空间中不包含任何一个(即,排除具有动态值范围的参数)。

注意

IntersectionSearchSpace 提供了相同的功能,但速度快得多。如果希望尽可能缩短执行时间,请考虑使用它。

参数:
  • trials (list[FrozenTrial]) – Trial 列表。

  • include_pruned (bool) – 是否应在搜索空间中包含已剪枝的 Trials。

返回:

包含按参数名称排序的参数名称和参数分布的字典。

返回类型:

dict[str, BaseDistribution]