object

lof_anomaly_detector

Local Outlier Factor anomaly detector with multiple distance metrics, mixed-feature support, and missing-value handling. Learns from baseline training examples selected from a dataset object implementing the anomaly_dataset_protocol protocol and returns a detector term that can be used for scoring, prediction, and export.

Availability:
logtalk_load(lof_anomaly_detector(loader))
Author: Paulo Moura
Version: 2:0:1
Date: 2026-11-11
Compilation flags:
static, context_switching_calls
Remarks:
(none)

Public predicates

(no local declarations; see entity ancestors if any)

Protected predicates

(no local declarations; see entity ancestors if any)

Private predicates

extract_values/3

Extracts feature values in the declared attribute order.

Compilation flags:
static
Template:
extract_values(Attributes,AttributeValues,Values)
Mode and number of proofs:
extract_values(+list(atom),+list(pair),-list) - one_or_error
Exceptions:
A declared attribute is absent from AttributeValues:
existence_error(attribute,Attribute)

check_feature_values/2

Checks prepared numeric, categorical, and missing feature values.

Compilation flags:
static
Template:
check_feature_values(FeatureTypes,Values)
Mode and number of proofs:
check_feature_values(+list(atom),+list) - one_or_error
Exceptions:
A bound feature value in Values is not a ground term:
instantiation_error
A numeric feature value is not a number:
type_error(number,Value)
A categorical feature value is not an atom:
type_error(atom,Value)

check_instance_ids/2

Checks distinct integer identities for training examples.

Compilation flags:
static
Template:
check_instance_ids(Instances,Seen)
Mode and number of proofs:
check_instance_ids(+list,+list(integer)) - one_or_error
Exceptions:
An example identifier in Instances is not a ground term:
instantiation_error
An example identifier is not an integer:
type_error(integer,Id)
An example identifier occurs more than once:
domain_error(unique_example_id,Id)

Operators

(none)