MODULE REFERENCE
generic
anomx.detection.genericExplicit adapters for user supplied scoring and detection algorithms.
GenericDetector
GenericDetector(model: Any = None, *, detect_fn: Callable | None = None, fit_fn: Callable | None = None, anomaly_label: int = 1)Bases: Detector
Wrap a detector callable or estimator and normalize binary labels.
detect_fn(model, values) overrides detect/predict. Output must have one row per input row. By default labels are bool or {0, 1}; set anomaly_label=-1 for sklearn's {-1, 1} convention. Unknown labels raise instead of silently changing their meaning. DataFrame results add an is_anomaly column, while TimeSeries results are numeric binary series.
| Parameter | Type | Default |
|---|---|---|
model | Any | None |
detect_fnkeyword only | Callable | None | None |
fit_fnkeyword only | Callable | None | None |
anomaly_labelkeyword only | int | 1 |
Members
component_keyattribute
component_key = 'generic_detector'component_discoverableattribute
component_discoverable = Falsefitmethod
fit(data: Any) -> GenericDetectorFit the custom detector explicitly on training data.
| Parameter | Type | Default |
|---|---|---|
data | Any | required |
Returns GenericDetector
detectmethod
detect(data: Any) -> AnyReturn binary labels with exactly the input observation alignment.
| Parameter | Type | Default |
|---|---|---|
data | 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_configBaseComponentGenericScorer
GenericScorer(model: Any = None, *, score_fn: Callable | None = None, fit_fn: Callable | None = None, higher_is_anomaly: bool = True)Bases: Scorer
Wrap a scoring callable or estimator with explicit anomaly direction.
The callable receives a finite numeric array with observations on axis 0 and returns one scalar or vector per observation. Alternatively provide an estimator with score_samples, decision_function, or score. score_fn(model, values) overrides method selection. Set higher_is_anomaly=False for sklearn density/inlier scores; the adapter negates those outputs. For DataFrames, a scalar output is added as score; TimeSeries outputs preserve time coordinates. Fitting, when available, is always explicit.
| Parameter | Type | Default |
|---|---|---|
model | Any | None |
score_fnkeyword only | Callable | None | None |
fit_fnkeyword only | Callable | None | None |
higher_is_anomalykeyword only | bool | True |
Members
component_keyattribute
component_key = 'generic_scorer'component_discoverableattribute
component_discoverable = Falsefitmethod
fit(data: Any) -> GenericScorerFit a user-provided scorer on the given training observations.
| Parameter | Type | Default |
|---|---|---|
data | Any | required |
Returns GenericScorer
scoremethod
score(data: Any) -> AnyReturn finite anomaly scores; larger values always mean more anomalous.
| Parameter | Type | Default |
|---|---|---|
data | 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