object
knn_classifierï
k-Nearest Neighbors classifier with multiple distance metrics and weighting options. Learns from a dataset object implementing the dataset_protocol protocol and returns a classifier term that can be used for prediction and exported as predicate clauses.
Availability:
logtalk_load(knn_classifier(loader))Author: Paulo Moura
Version: 2:0:0
Date: 2026-05-11
Compilation flags:
static, context_switching_callsRemarks:
(none)
Inherited public predicates:
 check_classifier/1  check_option/1  check_options/1  classifier_options/2  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_probabilities/3  print_classifier/1  valid_classifier/1  valid_option/1  valid_options/1
Public predicatesï
predict/4ï
Predicts the class label for a new instance using the learned classifier and the given options. The instance is a list of Attribute-Value pairs.
Compilation flags:
staticTemplate:
predict(Classifier,Instance,Class,Options)Mode and number of proofs:
predict(+compound,+list,-atom,+list(compound)) - onepredict_probabilities/4ï
Predicts class probabilities for a new instance using the learned classifier and the given options. Returns a list of Class-Probability pairs. The instance is a list of Attribute-Value pairs.
Compilation flags:
staticTemplate:
predict_probabilities(Classifier,Instance,Probabilities,Options)Mode and number of proofs:
predict_probabilities(+compound,+list,-list,+list(compound)) - oneProtected predicatesï
(no local declarations; see entity ancestors if any)
Private predicatesï
(no local declarations; see entity ancestors if any)
Operatorsï
(none)