object

# `knn_distance_anomaly_detector`

k-nearest-neighbor distance 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(knn_distance_anomaly_detector(loader))`
Author: Paulo Moura
Version: 1:0:0
Date: 2026-05-06
Compilation flags:
`static, context_switching_calls`
Imports:
`public` anomaly_detector_common
Uses:
format
list
numberlist
pairs
type
Remarks:
(none)
Inherited public predicates:
anomaly_detector_options/2 check_anomaly_detector/1 check_option/1 check_options/1 default_option/1 default_options/1 diagnostic/2 diagnostics/2 export_to_clauses/4 export_to_file/4 learn/2 learn/3 option/2 option/3 predict/3 predict/4 print_anomaly_detector/1 score/3 score_all/3 valid_anomaly_detector/1 valid_option/1 valid_options/1

## Public predicates

(no local declarations; see entity ancestors if any)

## Protected predicates

(no local declarations; see entity ancestors if any)

## Private predicates

(no local declarations; see entity ancestors if any)

## Operators

(none)

See also

anomaly_dataset_protocol, anomaly_detector_protocol, isolation_forest_anomaly_detector, lof_anomaly_detector