napistu_torch.labels.labeling_manager
Labeling manager configuration and validation for napistu-torch.
Classes
|
Configuration for label-specific featurization strategies. |
- class napistu_torch.labels.labeling_manager.LabelingManager(*, label_attribute: str, exclude_vertex_attributes: List[str] = <factory>, augment_summary_types: List[str] = <factory>, label_names: Dict[int, ~typing.Any] | None=None)
Bases:
BaseModelConfiguration for label-specific featurization strategies.
This class organizes and validates the attributes needed for different labeling approaches in molecular network analysis tasks.
- label_attribute
The vertex attribute to use as the target label
- Type:
str
- exclude_vertex_attributes
Vertex attributes to exclude from feature extraction
- Type:
List[str]
- augment_summary_types
SBML DFS summary types to add during graph augmentation. Used by augment_napistu_graph when calling add_sbml_dfs_summaries.
- Type:
List[str]
- label_names
Optional lookup table mapping label integers to their original names. Used to track the mapping between encoded integers and original label values.
- Type:
Optional[Dict[int, Any]]
- Public Methods
- --------------
- get_label_names
Get the label names mapping, returning empty dict if None
- to_dict
Convert the labeling strategy to a dictionary
- from_dict(config)
Create a LabelingManager from a dictionary configuration
- classmethod from_dict(config: Dict[str, Any]) LabelingManager
Create a LabelingManager from a dictionary configuration.
- classmethod validate_exclude_attributes(v: List[str]) List[str]
Validate that excluded attributes are strings.
- classmethod validate_label_attribute(v: str) str
Validate that the label attribute is not empty.
- classmethod validate_summary_types(v: List[str]) List[str]
Validate that summary types are valid SBML DFS summary types.
- get_label_names() Dict[int, Any]
Get the label names mapping, returning empty dict if None.
- to_dict() Dict[str, Any]
Convert the labeling strategy to a dictionary.
- _abc_impl = <_abc._abc_data object>
- augment_summary_types: List[str]
- exclude_vertex_attributes: List[str]
- label_attribute: str
- label_names: Dict[int, Any] | None
- model_config = {}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].