pycotools3.tasks.ParameterEstimation.Context

class pycotools3.tasks.ParameterEstimation.Context(models, experiments, working_directory=None, context='s', parameters='mg', filename=None, validation_experiments={}, settings={})

A high level interface to create a ParameterEstimation.Config object.

Enables the construction of a ParameterEstimation.Config object assuming one of several common patterns of usage.

Examples

Assuming that we have two copasi models (mod1 and mod2) and two experimental data files (fname1, fname2), correctly formatted according to the copasi specification. We can generate a config object that specifies the fitting of both experiments to both models and to fit all global and local parameters parameters=’gl’ in each.

with ParameterEstimation.Context(
    [mod1, mod2], [fname1, fname2],
    context='s', parameters='gl') as context:
    context.set('method', 'genetic_algorithm_sr')
    context.set('number_of_generations', 25)
    context.set('population_size', 10)
    config = context.get_config()

pe = ParameterEstimation(config)

Or for profile likelihoods on the first model mod1

__init__(models, experiments, working_directory=None, context='s', parameters='mg', filename=None, validation_experiments={}, settings={})

Initialize self. See help(type(self)) for accurate signature.

Methods

__init__(models, experiments[, …]) Initialize self.
get_config()
set(parameter, value) Set the value of parameter to value.

Attributes

acceptable_context_args
acceptable_parameters_args
experiment_filetypes
get_config_cv()

configure for cross validation Returns:

get_config_pl()

configure for profile likelihoods Returns:

set(parameter, value)

Set the value of parameter to value.

Looks for the first instance of parameter and sets its value to value.

Parameters:
  • parameter – A key somewhere in the nested structure of the config object
  • value – A value to replace the current value with
Returns:

None

setd(dct)

Set the value of multiple settings using a dict[setting] = value.

Iterates over ParameterEstimation.Context.set() with key value pairs

Parameters:dct (dict) – a settings dict where keys are settings and values are setting values
Returns:None