|
QDpy
|
Evolve a repertoire with structural Shapley features and select by instance similarity. More...
Public Member Functions | |
| run (self, calibration, training_instances, budget, *, proposal_limit=None) | |
| Calibrate niche definitions and build the repertoire under a shared assay budget. | |
| select (self, instance) | |
| Retrieve a measured heuristic for an instance using its features only. | |
Evolve a repertoire with structural Shapley features and select by instance similarity.
Build a grid of heuristics that can be selected without scoring a new instance.
A ridge model fits signed mean performance against structural features
of the calibration heuristics. Its interventional Shapley values are
exact for the fitted linear predictor. The caller selects which
attributions to map to grid coordinates, and all attributions inform
the proposal callback. The calibration baseline and mapping are frozen
before search so any two elites use the same niche definitions.
:param archive: Empty parentless rectangular best-only Grid with a finite
nonzero scalar fitness weight and (-1, 1) bounds on each descriptor.
:param structure: Callback returning a fixed-width finite vector from a
hashable, immutable heuristic representation.
:param propose: Callback receiving (parent, attribution_tuple, rng) and
returning a heuristic or None to reject a proposal.
:param evaluate: Callback returning raw scalar fitness for (heuristic, instance).
:param instance_features: Callback returning a finite vector for one instance.
:param descriptor_indices: Distinct structural feature indices, one per grid axis.
:param neighbors: Number of most similar training instances used for selection.
:param ridge: Positive ridge regularization used on standardized structural features.
:param seed: Private proposal seed.
Definition at line 46 of file heuristic_design.py.
| qdpy.algorithms.heuristic_design.QDHeuristicDesign.run | ( | self, | |
| calibration, | |||
| training_instances, | |||
| budget, | |||
| * | , | ||
| proposal_limit = None ) |
Calibrate niche definitions and build the repertoire under a shared assay budget.
Measure at least two distinct calibration heuristics, then evolve the repertoire. Each complete panel costs one call per training instance. The budget must cover calibration. A remainder smaller than one panel stays unused. Duplicate and declined proposals count toward proposal_limit, which defaults to ten times the affordable panels. Create a fresh search to calibrate on a different panel.
Definition at line 123 of file heuristic_design.py.
| qdpy.algorithms.heuristic_design.QDHeuristicDesign.select | ( | self, | |
| instance ) |
Retrieve a measured heuristic for an instance using its features only.
Use mean elite fitness on the nearest training instances for selection. Standardization is fit on the training instances. The evaluator is never called. Ties favor the better average training fitness and then the archive order.
Definition at line 175 of file heuristic_design.py.