MODULE REFERENCE
normality
anomx.models.base.normalityNormality model base contract.
A NormalityModel learns what "normal" looks like. What it can do with that knowledge is expressed through capability mixins (anomx.base.capabilities.Predictive, Reconstructive, Representational, Distributional, BoundaryEstimating), and what data it accepts through its anomx.base.signature.ModelSignature:
`python class TemporalFusionTransformer(NormalityModel, Predictive, Representational): signature = ModelSignature( structures={DataStructure.TEMPORAL_SEQUENCE}, modalities={Modality.NUMERIC}, requirements={"regular_or_known_timestamps"}, ) `
Trainable implementations live in the PyTorch domain: torch / lightning backends are the expected default for learned models (install the torch extra), while lightweight statistical baselines remain plain Python. A model never emits anomaly scores itself — scorers do that.
Forecast
Forecast(values: pd.DataFrame, metadata: dict[str, Any] = <factory: dict>)Forecast values with optional model metadata.
| Parameter | Type | Default |
|---|---|---|
values | pd.DataFrame | required |
metadata | dict[str, Any] | <factory: dict> |
Members
valuesattribute
values: pd.DataFramemetadataattribute
metadata: dict[str, Any] = field(default_factory=dict)to_dataframemethod
to_dataframe() -> pd.DataFrameReturn forecast values as a DataFrame.
Returns pd.DataFrame
NormalityModel
NormalityModelBases: Model, ABC
Base class for trainable normality models.
Members
component_typeattribute
component_type = 'model'capabilitiesattribute
capabilities: ClassVar[ComponentCapabilities] = ComponentCapabilities()preferred_viewattribute
preferred_view: ClassVar[str] = 'tabular'fitmethod
fit(data: Any) -> NoneTrain the model using input data.
| Parameter | Type | Default |
|---|---|---|
data | Any | required |
Returns None
predictmethod
predict(data: Any) -> AnyGenerate model outputs for input data.
| Parameter | Type | Default |
|---|---|---|
data | Any | required |
Returns Any
savemethod
save(path: str) -> NonePersist model state.
| Parameter | Type | Default |
|---|---|---|
path | str | required |
Returns None
loadmethod
load(path: str) -> NormalityModelLoad model state and return the model instance.
| Parameter | Type | Default |
|---|---|---|
path | str | required |
Returns NormalityModel
partial_fitmethod
partial_fit(batch: Any) -> NoneIncrementally update the model with one streaming batch.
| Parameter | Type | Default |
|---|---|---|
batch | Any | required |
Returns None
score_batchmethod
score_batch(batch: Any) -> AnyRun streaming inference on one batch.
| Parameter | Type | Default |
|---|---|---|
batch | Any | required |
Returns Any
Inherited members
is_component_abstractBaseComponentget_component_typeBaseComponentget_component_keyBaseComponentget_component_nameBaseComponentget_component_docsBaseComponentget_component_descriptionBaseComponentget_component_iconBaseComponentget_component_image_pathBaseComponentget_component_statusBaseComponentget_component_default_configBaseComponentget_component_config_schemaBaseComponentget_component_code_versionBaseComponentget_component_source_pathBaseComponentget_component_import_pathBaseComponentget_component_capabilitiesBaseComponentget_component_signatureBaseComponentget_component_parametersBaseComponentget_configBaseComponent