phenotypic.tune.freeze_value#

phenotypic.tune.freeze_value(key: str, trials: list[Trial], *, top_k: int = 10) Any[source]#

The central-tendency value of key across the top-k explore trials (§6).

Numeric values → the median; non-numeric (categorical/bool) → the mode (“the value good configs tend to use”, robust to single-trial noise). Only the top_k lowest-cost non-failed trials that actually carry key count.

Parameters:
  • key (str) – The frozen param’s combo key.

  • trials (list[Trial]) – The explore-round trials.

  • top_k (int) – How many best trials to take the central tendency over.

Returns:

The pinned value for the frozen knob.

Raises:

ValueError – If no top-k trial carries key (nothing to freeze at).

Return type:

Any