PineForge HPO 1.11.0
Native hyperparameter optimization for PineForge strategies
Loading...
Searching...
No Matches
pineforge_hpo.sensitivity Namespace Reference

Classes

class  PairPlan
 

Functions

dict not_near_counts (dict profile)
 
list rank_pairs (dict counts, int pair_k)
 
list plan_pairs (Study study, dict values, dict profile, int pair_k)
 
list pair_maps (Study study, dict values, list plans)
 

Detailed Description

Pair ranking and pair maps for the neighbourhood of finished trials (version 1).

A pair map crosses the one-move neighbours of two dimensions around a centre, so
that the cells off the two axes (the diagonals) show whether two parameters
interact. It is built after the fact, like the neighbourhood itself: the cells
are looked up in the rows that were supplied and nothing is evaluated.

The module works on what ``neighbourhood`` produced. The pairs are ranked from
the per-dimension profile of a centre, the map cells are classified by
``Study.cell``, and no neighbour is generated here. ``neighbourhood`` calls
``plan_pairs`` and ``pair_maps`` when ``pair_k`` is above 0; they are public so
that the ranking and the maps can be read and tested on their own. See
``docs/sensitivity.md``.

Function Documentation

◆ not_near_counts()

dict pineforge_hpo.sensitivity.not_near_counts ( dict  profile)
Per dimension, the scored neighbours of a centre that are not near the best.

A scored neighbour is one with status ok or constraint violation. An
infeasible neighbour is scored and never near. Unscorable and never
evaluated neighbours are not counted.

Definition at line 55 of file sensitivity.py.

Referenced by pineforge_hpo.sensitivity.plan_pairs().

◆ pair_maps()

list pineforge_hpo.sensitivity.pair_maps ( Study  study,
dict  values,
list  plans 
)
The maps of the planned pairs at one centre, in plan order.

Cells are in row-major order: the first dimension is the outer loop, each
dimension ascending. A cell is the centre, an axis cell (one dimension moved)
or a diagonal cell (both moved), and carries the class, objective, gap, near
flag and row ids of ``Study.cell``. The diagonal totals count the diagonal
cells, those with any row, those scored and those scored near the best.

Definition at line 143 of file sensitivity.py.

◆ plan_pairs()

list pineforge_hpo.sensitivity.plan_pairs ( Study  study,
dict  values,
dict  profile,
int  pair_k 
)
Rank the pairs of one centre and span their maps; looks nothing up.

``values`` is the centre's normalised vector and ``profile`` its
per-dimension neighbour cells as ``neighbourhood`` builds them.

Definition at line 90 of file sensitivity.py.

References pineforge_hpo.sensitivity.not_near_counts(), and pineforge_hpo.sensitivity.rank_pairs().

◆ rank_pairs()

list pineforge_hpo.sensitivity.rank_pairs ( dict  counts,
int  pair_k 
)
The ``pair_k`` best pairs as (first, second, score), best first.

The score of a pair is the sum of the not-near counts of its two dimensions.
Pairs are ordered by descending score, then by ascending (first, second)
name, both byte-wise. Fewer pairs are returned when fewer exist.

Definition at line 68 of file sensitivity.py.

Referenced by pineforge_hpo.sensitivity.plan_pairs().