swiftemulator.design.transform module

Transformer from an ND array to a model specification object.

swiftemulator.design.transform.transform_to_model_spec(input_array: ndarray, model_specification: ModelSpecification, prefix_unique_id: Optional[str] = None) ModelParameters[source]

Transforms the input nd array (which is of shape n models by n parameters) to a model parameters object, by re-scaling the parameters according to the specification.

Parameters:
  • input_array (np.ndarray) – Input array, of shape (number of samples, number of parameters).

  • model_specification (ModelSpecification) – Model specification used to rescale the array.

  • prefix_unique_id (str, optional) – An optional prefix for the newly generated unique IDs. Defaults to no prefix.

Returns:

model_parameters – A model values container with the re-scaled parameters and associated metadata.

Return type:

ModelParameters