SingleComponentClassifier#

Module: exa.core.multistate_classifier.classifier

class SingleComponentClassifier#

Bases: ABC

ABC for single component classifier.

Implementation of classifier to single component readouts without any correlations to other components. Also implements assignment correction.

Attributes

LABEL

The label used as part of the observation name for this classifier.

MODEL_PARAMETERS

The names of the model parameters used by this classifier.

Methods

apply

Apply classifier to data.

calibrate

Calibrate classifier with data.

get_component_settings

Get settings corresponding to component classifier parameters.

get_observation_name

Map component and model parameter to label that is used for retrieving and saving observations.

get_observation_names

Get observation names corresponding to the component.

get_parameter_values

Get observation names and values from observations.

setting_node_to_parameters

Get parameters from setting node.

MODEL_PARAMETERS: ClassVar[list[str]] = []#

The names of the model parameters used by this classifier.

LABEL = 'multi_state_classifier'#

The label used as part of the observation name for this classifier.

abstractmethod apply(input_data, component, data_variable_label, component_override)#

Apply classifier to data.

Updates the input data with the classification results.

Parameters:
  • input_data (Dataset) – The dataset to classify.

  • component (str) – The component whose readout data to classify.

  • data_variable_label (str) – The data variable containing the raw readout to classify.

  • component_override (dict[str, Any] | None) – The mapping of observation names to model parameters.

Return type:

None

abstractmethod calibrate(input_data, component, data_variable_label)#

Calibrate classifier with data.

Parameters:
  • input_data (Dataset) – The labeled calibration dataset.

  • component (str) – The component to calibrate the classifier for.

  • data_variable_label (str) – The data variable containing the raw readout to calibrate.

Returns:

The mapping of observation names to calibrated model parameters.

Return type:

dict

get_observation_name(component, parameter)#

Map component and model parameter to label that is used for retrieving and saving observations.

Parameters:
  • component (str) – The component the parameter belongs to.

  • parameter (str) – The name of the model parameter.

Returns:

The observation name for the given component and parameter.

Return type:

str

get_observation_names(component)#

Get observation names corresponding to the component.

Parameters:

component (str) – The component to get the observation names for.

Returns:

The observation names for all model parameters of the component.

Return type:

list

get_parameter_values(component)#

Get observation names and values from observations.

Parameters:

component (str) – The component to get the parameter values for.

Returns:

The mapping of observation names to model parameter values.

Return type:

dict

get_component_settings(component)#

Get settings corresponding to component classifier parameters.

Parameters missing from observations are left out.

Parameters:

component (str) – The component to get the classifier settings for.

Returns:

The setting node containing the classifier model parameters loaded from observations.

Return type:

SettingNode

setting_node_to_parameters(setting_node, component)#

Get parameters from setting node.

Inverse of get_component_settings().

Parameters:
  • setting_node (SettingNode) – The setting node containing the classifier model parameters for the component.

  • component (str) – The component the setting node belongs to.

Returns:

The mapping of observation names to model parameter values.

Return type:

dict

Inheritance

Inheritance diagram of exa.core.multistate_classifier.classifier.SingleComponentClassifier