petab_select.candidate_space
Classes and methods related to candidate spaces.
Functions
|
Decorator to call the method of the inner space. |
|
Decorator to call the method of both the super() and inner space. |
|
Get a candidate space class, given its method name. |
Classes
|
The backward method class. |
|
The brute-force method class. |
|
A base class for collecting candidate models. |
|
The FAMoS method class. |
|
The forward method class. |
|
Find models with the same number of estimated parameters. |
- class petab_select.candidate_space.BackwardCandidateSpace(*args, predecessor_model=None, max_steps=None, **kwargs)[source]
The backward method class.
- __init__(*args, predecessor_model=None, max_steps=None, **kwargs)
See class attributes for arguments.
- accept(model, distance)
Add a candidate model to the candidate space.
- consider(model)
Add a candidate model, if it should be added.
- Parameters:
model (
Model|None) – The candidate model. This value may beNoneif theModelSubspacedecided to exclude the model that would have been sent.- Return type:
- Returns:
Whether it is OK to send additional models to the candidate space. For example, if the limit of the number of accepted models has been reached, then no further models should be sent.
- distance(model)
Compute the distance between two models that are neighbors.
- distances_in_estimated_parameters(model, predecessor_model=None)
Distance between two models in model space, using different metrics.
All metrics are in terms of estimated parameters.
- Metrics:
- l1:
The L_1 distance between two models.
- size:
The difference in the number of estimated parameters between two models.
- excluded(model_hash)
Check whether a model is excluded.
- Parameters:
model – The model.
- Return type:
- Returns:
Trueif themodelis excluded, otherwiseFalse.
- get_excluded_hashes()
Get the excluded hashes.
- get_iteration_calibrated_models(calibrated_models, reset=False)
Get all calibrated models for the current iteration.
The full list of models identified for calibration in an iteration of model selection may include models for which calibration results are already available. This combines the calibration results of the uncalibrated models, with the models that were already calibrated, to produce the full list of models that were identified for calibration in the current iteration.
- Parameters:
calibrated_models (
Models) – The calibration results for the uncalibrated models of this iteration. Keys are model hashes, values are models.reset (
bool) – Whether to remove the previously calibrated models from the candidate space, after they are used to produce the full list of calibrated models.iteration – If provided, the iteration attribute of each model will be set to this.
- Return type:
- Returns:
All calibrated models for the current iteration.
- is_plausible(model)
Determine whether a candidate model is plausible.
A plausible model is one that could possibly be chosen by model selection method, in the absence of information about other models in the model space.
For example, given a forward selection method that starts with an initial model
self.predecessor_modelthat has no estimated parameters, then only models with one or more estimated parameters are plausible.
- n_accepted()
Get the current number of accepted models.
- Return type:
- Returns:
The number of models.
- classmethod read_arguments_from_yaml_dict(yaml_dict)
Parse settings that were stored in YAML.
- reset(predecessor_model=None, excluded_hashes=None, limit=None)
Reset the candidate models, optionally reinitialize with a model.
- Parameters:
- Return type:
- set_excluded_hashes(hashes, extend=False)
Set the excluded hashes.
- set_iteration_user_calibrated_models(user_calibrated_models)
Hide previously-calibrated models from the calibration tool.
This allows previously-calibrated model results, e.g. from a previous model selection job, to be re-used in this job. Calibrated models are stored here between model selection iterations, while the calibration tool calibrates the uncalibrated models of the iteration. The models are then combined as the full model calibration results for the iteration, with
get_iteration_calibrated_models().
- set_limit(limit=None)
Set the limit on the number of accepted models.
- set_predecessor_model(predecessor_model)
Set the predecessor model.
See class attributes for arguments.
- update_after_calibration(*args, iteration_calibrated_models, **kwargs)
Do work in the candidate space after calibration.
For example, this is used by the
FamosCandidateSpaceto switch methods.Different candidate spaces require different arguments. All arguments are here, to ensure candidate spaces can be switched easily and still receive sufficient arguments.
- wrap_search_subspaces(search_subspaces)
Decorate the subspace searches of a model space.
Used by candidate spaces to perform changes that alter the search. See
BidirectionalCandidateSpacefor an example, where it’s used to switch directions.
- class petab_select.candidate_space.BruteForceCandidateSpace(*args, **kwargs)[source]
The brute-force method class.
- accept(model, distance)
Add a candidate model to the candidate space.
- consider(model)
Add a candidate model, if it should be added.
- Parameters:
model (
Model|None) – The candidate model. This value may beNoneif theModelSubspacedecided to exclude the model that would have been sent.- Return type:
- Returns:
Whether it is OK to send additional models to the candidate space. For example, if the limit of the number of accepted models has been reached, then no further models should be sent.
- distance(model)
Compute the distance between two models that are neighbors.
- distances_in_estimated_parameters(model, predecessor_model=None)
Distance between two models in model space, using different metrics.
All metrics are in terms of estimated parameters.
- Metrics:
- l1:
The L_1 distance between two models.
- size:
The difference in the number of estimated parameters between two models.
- excluded(model_hash)
Check whether a model is excluded.
- Parameters:
model – The model.
- Return type:
- Returns:
Trueif themodelis excluded, otherwiseFalse.
- get_excluded_hashes()
Get the excluded hashes.
- get_iteration_calibrated_models(calibrated_models, reset=False)
Get all calibrated models for the current iteration.
The full list of models identified for calibration in an iteration of model selection may include models for which calibration results are already available. This combines the calibration results of the uncalibrated models, with the models that were already calibrated, to produce the full list of models that were identified for calibration in the current iteration.
- Parameters:
calibrated_models (
Models) – The calibration results for the uncalibrated models of this iteration. Keys are model hashes, values are models.reset (
bool) – Whether to remove the previously calibrated models from the candidate space, after they are used to produce the full list of calibrated models.iteration – If provided, the iteration attribute of each model will be set to this.
- Return type:
- Returns:
All calibrated models for the current iteration.
- is_plausible(model)
Determine whether a candidate model is plausible.
A plausible model is one that could possibly be chosen by model selection method, in the absence of information about other models in the model space.
For example, given a forward selection method that starts with an initial model
self.predecessor_modelthat has no estimated parameters, then only models with one or more estimated parameters are plausible.
- n_accepted()
Get the current number of accepted models.
- Return type:
- Returns:
The number of models.
- classmethod read_arguments_from_yaml_dict(yaml_dict)
Parse settings that were stored in YAML.
- reset(predecessor_model=None, excluded_hashes=None, limit=None)
Reset the candidate models, optionally reinitialize with a model.
- Parameters:
- Return type:
- set_excluded_hashes(hashes, extend=False)
Set the excluded hashes.
- set_iteration_user_calibrated_models(user_calibrated_models)
Hide previously-calibrated models from the calibration tool.
This allows previously-calibrated model results, e.g. from a previous model selection job, to be re-used in this job. Calibrated models are stored here between model selection iterations, while the calibration tool calibrates the uncalibrated models of the iteration. The models are then combined as the full model calibration results for the iteration, with
get_iteration_calibrated_models().
- set_limit(limit=None)
Set the limit on the number of accepted models.
- set_predecessor_model(predecessor_model)
Set the predecessor model.
See class attributes for arguments.
- update_after_calibration(*args, iteration_calibrated_models, **kwargs)
Do work in the candidate space after calibration.
For example, this is used by the
FamosCandidateSpaceto switch methods.Different candidate spaces require different arguments. All arguments are here, to ensure candidate spaces can be switched easily and still receive sufficient arguments.
- wrap_search_subspaces(search_subspaces)
Decorate the subspace searches of a model space.
Used by candidate spaces to perform changes that alter the search. See
BidirectionalCandidateSpacefor an example, where it’s used to switch directions.
- class petab_select.candidate_space.CandidateSpace(method, criterion, predecessor_model=None, excluded_hashes=None, limit=inf, summary_tsv=None, previous_predecessor_model=None, calibrated_models=None, iteration=0)[source]
A base class for collecting candidate models.
The intended use of subclasses is to identify suitable models in a model space, that will be provided to a model selection method for selection.
- criterion
The criterion by which models are compared.
- distances
The distances of all candidate models from the initial model.
- predecessor_model
The model used for comparison, e.g. for stepwise methods.
- previous_predecessor_model
The previous predecessor model.
- excluded_hashes
A list of model hashes that will not be accepted into the candidate space. The hashes of accepted models are added to :attr:
excluded_hashes.
- governing_method
Used to store the search method that governs the choice of method during a search. In some cases, this is always the same as the method attribute. An example of a difference is in the bidirectional method, where
governing_methodstores the bidirectional method, whereas method may also store the forward or backward methods.
- iteration
The iteration of model selection.
- limit
A handler to limit the number of accepted models.
- models
The current set of candidate models.
- method
The model selection method of the candidate space.
- predecessor_model
The model used for comparison, e.g. for stepwise methods.
- previous_predecessor_model
The previous predecessor model.
- retry_model_space_search_if_no_models
Whether a search with a candidate space should be repeated upon failure. Useful for the
BidirectionalCandidateSpace, which switches directions upon failure.
- summary_tsv
A string or
pathlib.Path. A summary of the model selection progress will be written to this file.
- calibrated_models
All models that have been calibrated across all iterations of model selection.
- latest_iteration_calibrated_models
The calibrated models from the most recent iteration.
- __init__(method, criterion, predecessor_model=None, excluded_hashes=None, limit=inf, summary_tsv=None, previous_predecessor_model=None, calibrated_models=None, iteration=0)[source]
See class attributes for arguments.
- consider(model)[source]
Add a candidate model, if it should be added.
- Parameters:
model (
Model|None) – The candidate model. This value may beNoneif theModelSubspacedecided to exclude the model that would have been sent.- Return type:
- Returns:
Whether it is OK to send additional models to the candidate space. For example, if the limit of the number of accepted models has been reached, then no further models should be sent.
- distances_in_estimated_parameters(model, predecessor_model=None)[source]
Distance between two models in model space, using different metrics.
All metrics are in terms of estimated parameters.
- Metrics:
- l1:
The L_1 distance between two models.
- size:
The difference in the number of estimated parameters between two models.
- excluded(model_hash)[source]
Check whether a model is excluded.
- Parameters:
model – The model.
- Return type:
- Returns:
Trueif themodelis excluded, otherwiseFalse.
- get_iteration_calibrated_models(calibrated_models, reset=False)[source]
Get all calibrated models for the current iteration.
The full list of models identified for calibration in an iteration of model selection may include models for which calibration results are already available. This combines the calibration results of the uncalibrated models, with the models that were already calibrated, to produce the full list of models that were identified for calibration in the current iteration.
- Parameters:
calibrated_models (
Models) – The calibration results for the uncalibrated models of this iteration. Keys are model hashes, values are models.reset (
bool) – Whether to remove the previously calibrated models from the candidate space, after they are used to produce the full list of calibrated models.iteration – If provided, the iteration attribute of each model will be set to this.
- Return type:
- Returns:
All calibrated models for the current iteration.
- is_plausible(model)[source]
Determine whether a candidate model is plausible.
A plausible model is one that could possibly be chosen by model selection method, in the absence of information about other models in the model space.
For example, given a forward selection method that starts with an initial model
self.predecessor_modelthat has no estimated parameters, then only models with one or more estimated parameters are plausible.
- n_accepted()[source]
Get the current number of accepted models.
- Return type:
- Returns:
The number of models.
- classmethod read_arguments_from_yaml_dict(yaml_dict)[source]
Parse settings that were stored in YAML.
- reset(predecessor_model=None, excluded_hashes=None, limit=None)[source]
Reset the candidate models, optionally reinitialize with a model.
- Parameters:
- Return type:
- set_iteration_user_calibrated_models(user_calibrated_models)[source]
Hide previously-calibrated models from the calibration tool.
This allows previously-calibrated model results, e.g. from a previous model selection job, to be re-used in this job. Calibrated models are stored here between model selection iterations, while the calibration tool calibrates the uncalibrated models of the iteration. The models are then combined as the full model calibration results for the iteration, with
get_iteration_calibrated_models().
- set_predecessor_model(predecessor_model)[source]
Set the predecessor model.
See class attributes for arguments.
- update_after_calibration(*args, iteration_calibrated_models, **kwargs)[source]
Do work in the candidate space after calibration.
For example, this is used by the
FamosCandidateSpaceto switch methods.Different candidate spaces require different arguments. All arguments are here, to ensure candidate spaces can be switched easily and still receive sufficient arguments.
- class petab_select.candidate_space.FamosCandidateSpace(*args, predecessor_model=None, critical_parameter_sets=[], swap_parameter_sets=[], method_scheme=None, n_reattempts=0, consecutive_laterals=False, **kwargs)[source]
The FAMoS method class.
This candidate space implements and extends the original FAMoS algorithm (doi: 10.1371/journal.pcbi.1007230).
- critical_parameter_sets
A list of lists, where each inner list contains parameter IDs. All models must estimate at least 1 parameter from each critical parameter set.
- swap_parameter_sets
A list of lists, where each inner list contains parameter IDs. The lateral moves in FAMoS are constrained to be between parameters that exist in the same swap parameter set.
- method_scheme
A dictionary that specifies how to switch between methods when the current method doesn’t produce a better model. Keys are n-tuples that described a pattern of length n methods. Values are methods. If the previous methods match the pattern in the key, then the method in the value will be used next. The order of the dictionary is important: only the first matched pattern will be used. Defaults to the method scheme described in the original FAMoS publication.
- n_reattempts
Integer. The total number of times that a jump-to-most-distance action will be performed, triggered whenever the model selection would normally terminate. Defaults to no reattempts (
0).
- consecutive_laterals
Boolean. If
True, the method will continue performing lateral moves while they produce better models. Otherwise, the method scheme will be applied after one lateral move.
- __init__(*args, predecessor_model=None, critical_parameter_sets=[], swap_parameter_sets=[], method_scheme=None, n_reattempts=0, consecutive_laterals=False, **kwargs)[source]
See class attributes for arguments.
- accept(model, distance)
Add a candidate model to the candidate space.
- check_critical(model)[source]
Check if the model contains all necessary critical parameters
- Return type:
- check_swap(model)[source]
Check if parameters that are swapped are contained in the same swap parameter set.
- Return type:
- consider(model)[source]
Re-define
considerof FAMoS to be theconsidermethod of theinner_candidate_space. Update all the attributes changed in theconsidermethod.- Return type:
- distance(model)
Compute the distance between two models that are neighbors.
- distances_in_estimated_parameters(model, predecessor_model=None)
Distance between two models in model space, using different metrics.
All metrics are in terms of estimated parameters.
- Metrics:
- l1:
The L_1 distance between two models.
- size:
The difference in the number of estimated parameters between two models.
- excluded(model_hash)
Check whether a model is excluded.
- Parameters:
model – The model.
- Return type:
- Returns:
Trueif themodelis excluded, otherwiseFalse.
- get_excluded_hashes()
Get the excluded hashes.
- get_iteration_calibrated_models(calibrated_models, reset=False)
Get all calibrated models for the current iteration.
The full list of models identified for calibration in an iteration of model selection may include models for which calibration results are already available. This combines the calibration results of the uncalibrated models, with the models that were already calibrated, to produce the full list of models that were identified for calibration in the current iteration.
- Parameters:
calibrated_models (
Models) – The calibration results for the uncalibrated models of this iteration. Keys are model hashes, values are models.reset (
bool) – Whether to remove the previously calibrated models from the candidate space, after they are used to produce the full list of calibrated models.iteration – If provided, the iteration attribute of each model will be set to this.
- Return type:
- Returns:
All calibrated models for the current iteration.
- get_most_distant()[source]
Get most distant model to all the checked models. We take models from the sorted list of best models (
self.best_models) and construct complements of these models. For all these complements we compute the distance in number of different estimated parameters to all models from history. For each complement we take the minimum of these distances as it’s distance to history. Then we choose the complement model with the maximal distance to history.TODO: Next we check if this model is contained in any subspace. If so we choose it. If not we choose the model in a subspace that has least distance to this complement model.
- Return type:
- insert_model_into_best_models(model_to_insert)[source]
Inserts a model into the list of best_models which are sorted w.r.t. the criterion specified.
- Return type:
- is_plausible(model)[source]
Determine whether a candidate model is plausible.
A plausible model is one that could possibly be chosen by model selection method, in the absence of information about other models in the model space.
For example, given a forward selection method that starts with an initial model
self.predecessor_modelthat has no estimated parameters, then only models with one or more estimated parameters are plausible.
- jump_to_most_distant()[source]
Jump to most distant model with respect to the history of all calibrated models.
- n_accepted()
Get the current number of accepted models.
- Return type:
- Returns:
The number of models.
- classmethod read_arguments_from_yaml_dict(yaml_dict)[source]
Parse settings that were stored in YAML.
- Parameters:
yaml_dict – The information that was read from the YAML file. Keys are class attributes, values are the corresponding values.
- Return type:
- Returns:
The settings, parsed into PEtab Select objects where possible.
- reset(predecessor_model=None, excluded_hashes=None, limit=None)
Reset the candidate models, optionally reinitialize with a model.
- Parameters:
- Return type:
- set_excluded_hashes(hashes, extend=False)
Set the excluded hashes.
- set_iteration_user_calibrated_models(user_calibrated_models)
Hide previously-calibrated models from the calibration tool.
This allows previously-calibrated model results, e.g. from a previous model selection job, to be re-used in this job. Calibrated models are stored here between model selection iterations, while the calibration tool calibrates the uncalibrated models of the iteration. The models are then combined as the full model calibration results for the iteration, with
get_iteration_calibrated_models().
- set_limit(limit=None)
Set the limit on the number of accepted models.
- set_predecessor_model(predecessor_model)
Set the predecessor model.
See class attributes for arguments.
- switch_inner_candidate_space(excluded_hashes)[source]
Switch the inner candidate space to match the current method.
- switch_method()[source]
Switch to the next method with respect to the history of methods used and the switching scheme in
self.method_scheme.- Return type:
- update_after_calibration(*args, iteration_calibrated_models, **kwargs)[source]
See CandidateSpace.update_after_calibration.
- Return type:
- update_from_iteration_calibrated_models(iteration_calibrated_models)[source]
Update
self.best_modelswith the latestiteration_calibrated_modelsand determine if there was a new best model. If so, returnFalse.Trueotherwise.- Return type:
- wrap_search_subspaces(search_subspaces)[source]
Decorate the subspace searches of a model space.
Used by candidate spaces to perform changes that alter the search. See
BidirectionalCandidateSpacefor an example, where it’s used to switch directions.- Parameters:
search_subspaces – The method that searches the subspaces of a model space.
- Returns:
The wrapped
search_subspaces.
- class petab_select.candidate_space.ForwardCandidateSpace(*args, predecessor_model=None, max_steps=None, **kwargs)[source]
The forward method class.
- direction
1for the forward method,-1for the backward method.
- max_steps
Maximum number of steps forward in a single iteration of forward selection. Defaults to no maximum (
None).
- __init__(*args, predecessor_model=None, max_steps=None, **kwargs)[source]
See class attributes for arguments.
- accept(model, distance)
Add a candidate model to the candidate space.
- consider(model)
Add a candidate model, if it should be added.
- Parameters:
model (
Model|None) – The candidate model. This value may beNoneif theModelSubspacedecided to exclude the model that would have been sent.- Return type:
- Returns:
Whether it is OK to send additional models to the candidate space. For example, if the limit of the number of accepted models has been reached, then no further models should be sent.
- distances_in_estimated_parameters(model, predecessor_model=None)
Distance between two models in model space, using different metrics.
All metrics are in terms of estimated parameters.
- Metrics:
- l1:
The L_1 distance between two models.
- size:
The difference in the number of estimated parameters between two models.
- excluded(model_hash)
Check whether a model is excluded.
- Parameters:
model – The model.
- Return type:
- Returns:
Trueif themodelis excluded, otherwiseFalse.
- get_excluded_hashes()
Get the excluded hashes.
- get_iteration_calibrated_models(calibrated_models, reset=False)
Get all calibrated models for the current iteration.
The full list of models identified for calibration in an iteration of model selection may include models for which calibration results are already available. This combines the calibration results of the uncalibrated models, with the models that were already calibrated, to produce the full list of models that were identified for calibration in the current iteration.
- Parameters:
calibrated_models (
Models) – The calibration results for the uncalibrated models of this iteration. Keys are model hashes, values are models.reset (
bool) – Whether to remove the previously calibrated models from the candidate space, after they are used to produce the full list of calibrated models.iteration – If provided, the iteration attribute of each model will be set to this.
- Return type:
- Returns:
All calibrated models for the current iteration.
- is_plausible(model)[source]
Determine whether a candidate model is plausible.
A plausible model is one that could possibly be chosen by model selection method, in the absence of information about other models in the model space.
For example, given a forward selection method that starts with an initial model
self.predecessor_modelthat has no estimated parameters, then only models with one or more estimated parameters are plausible.
- n_accepted()
Get the current number of accepted models.
- Return type:
- Returns:
The number of models.
- classmethod read_arguments_from_yaml_dict(yaml_dict)
Parse settings that were stored in YAML.
- reset(predecessor_model=None, excluded_hashes=None, limit=None)
Reset the candidate models, optionally reinitialize with a model.
- Parameters:
- Return type:
- set_excluded_hashes(hashes, extend=False)
Set the excluded hashes.
- set_iteration_user_calibrated_models(user_calibrated_models)
Hide previously-calibrated models from the calibration tool.
This allows previously-calibrated model results, e.g. from a previous model selection job, to be re-used in this job. Calibrated models are stored here between model selection iterations, while the calibration tool calibrates the uncalibrated models of the iteration. The models are then combined as the full model calibration results for the iteration, with
get_iteration_calibrated_models().
- set_limit(limit=None)
Set the limit on the number of accepted models.
- set_predecessor_model(predecessor_model)
Set the predecessor model.
See class attributes for arguments.
- update_after_calibration(*args, iteration_calibrated_models, **kwargs)
Do work in the candidate space after calibration.
For example, this is used by the
FamosCandidateSpaceto switch methods.Different candidate spaces require different arguments. All arguments are here, to ensure candidate spaces can be switched easily and still receive sufficient arguments.
- wrap_search_subspaces(search_subspaces)
Decorate the subspace searches of a model space.
Used by candidate spaces to perform changes that alter the search. See
BidirectionalCandidateSpacefor an example, where it’s used to switch directions.
- class petab_select.candidate_space.LateralCandidateSpace(*args, max_steps=None, **kwargs)[source]
Find models with the same number of estimated parameters.
- __init__(*args, max_steps=None, **kwargs)[source]
- Additional args:
- max_number_of_steps:
Maximal allowed number of swap moves. If 0 then there is no maximum.
- accept(model, distance)
Add a candidate model to the candidate space.
- consider(model)
Add a candidate model, if it should be added.
- Parameters:
model (
Model|None) – The candidate model. This value may beNoneif theModelSubspacedecided to exclude the model that would have been sent.- Return type:
- Returns:
Whether it is OK to send additional models to the candidate space. For example, if the limit of the number of accepted models has been reached, then no further models should be sent.
- distance(model)
Compute the distance between two models that are neighbors.
- distances_in_estimated_parameters(model, predecessor_model=None)
Distance between two models in model space, using different metrics.
All metrics are in terms of estimated parameters.
- Metrics:
- l1:
The L_1 distance between two models.
- size:
The difference in the number of estimated parameters between two models.
- excluded(model_hash)
Check whether a model is excluded.
- Parameters:
model – The model.
- Return type:
- Returns:
Trueif themodelis excluded, otherwiseFalse.
- get_excluded_hashes()
Get the excluded hashes.
- get_iteration_calibrated_models(calibrated_models, reset=False)
Get all calibrated models for the current iteration.
The full list of models identified for calibration in an iteration of model selection may include models for which calibration results are already available. This combines the calibration results of the uncalibrated models, with the models that were already calibrated, to produce the full list of models that were identified for calibration in the current iteration.
- Parameters:
calibrated_models (
Models) – The calibration results for the uncalibrated models of this iteration. Keys are model hashes, values are models.reset (
bool) – Whether to remove the previously calibrated models from the candidate space, after they are used to produce the full list of calibrated models.iteration – If provided, the iteration attribute of each model will be set to this.
- Return type:
- Returns:
All calibrated models for the current iteration.
- is_plausible(model)[source]
Determine whether a candidate model is plausible.
A plausible model is one that could possibly be chosen by model selection method, in the absence of information about other models in the model space.
For example, given a forward selection method that starts with an initial model
self.predecessor_modelthat has no estimated parameters, then only models with one or more estimated parameters are plausible.
- n_accepted()
Get the current number of accepted models.
- Return type:
- Returns:
The number of models.
- classmethod read_arguments_from_yaml_dict(yaml_dict)
Parse settings that were stored in YAML.
- reset(predecessor_model=None, excluded_hashes=None, limit=None)
Reset the candidate models, optionally reinitialize with a model.
- Parameters:
- Return type:
- set_excluded_hashes(hashes, extend=False)
Set the excluded hashes.
- set_iteration_user_calibrated_models(user_calibrated_models)
Hide previously-calibrated models from the calibration tool.
This allows previously-calibrated model results, e.g. from a previous model selection job, to be re-used in this job. Calibrated models are stored here between model selection iterations, while the calibration tool calibrates the uncalibrated models of the iteration. The models are then combined as the full model calibration results for the iteration, with
get_iteration_calibrated_models().
- set_limit(limit=None)
Set the limit on the number of accepted models.
- set_predecessor_model(predecessor_model)
Set the predecessor model.
See class attributes for arguments.
- update_after_calibration(*args, iteration_calibrated_models, **kwargs)
Do work in the candidate space after calibration.
For example, this is used by the
FamosCandidateSpaceto switch methods.Different candidate spaces require different arguments. All arguments are here, to ensure candidate spaces can be switched easily and still receive sufficient arguments.
- wrap_search_subspaces(search_subspaces)
Decorate the subspace searches of a model space.
Used by candidate spaces to perform changes that alter the search. See
BidirectionalCandidateSpacefor an example, where it’s used to switch directions.