Search¶
The BaseSearch class defines the interface for search strategies that generate candidate pools
for evaluation. Search strategies can operate on predefined datasets (DatasetSearch), generate
new candidates using models (GeneratorSearch), or apply mutations to existing sequences
(SingleMutantSearch).
- class alf_core.optimizer.search.BaseSearch[source]¶
Bases:
ABCBase class for all types of search methods.
Search methods provide a way of searching the design space in order to propose new candidates not yet observed in the training dataset. This can be achieved in multiple ways depending on the search protocol, or availability of ground truth labels.
- class alf_core.optimizer.search.DatasetSearch[source]¶
Bases:
BaseSearchOffline search method based on a dataset defining the search pool.
- get_metrics(state)[source]¶
Return recall and regret metrics for the dataset search method.
Both metrics compare the initial candidate pool against the candidates acquired during the loop. The acquired-only set is reconstructed from
state.historyso the initial labelled seed (which is not part of the candidate pool) does not enter the comparison.- Parameters:
state (
State) – Current task state.- Return type:
dict[str,float]- Returns:
Dictionary containing recall and regret metrics comparing the initial candidate pool to the acquired candidates. The metrics are omitted until at least one candidate has been acquired.
- class alf_core.optimizer.search.GeneratorSearch(model)[source]¶
Bases:
BaseSearchSearch method based on a model generating samples.
- class alf_core.optimizer.search.ModelProtocolSearch(model, protocol)[source]¶
Bases:
BaseSearchSearch method based on a model and a protocol to define the search pool.
- class alf_core.optimizer.search.ProtocolSearch(protocol)[source]¶
Bases:
BaseSearchSearch method based on a function/procedure to define the search pool.