category
feature_selector_common
Shared predicates for selector diagnostics, dataset validation, feature-matrix utilities, and selection strategies (top-k and threshold).
logtalk_load(feature_selection_protocols(loader))staticPublic predicates
(no local declarations; see entity ancestors if any)
Protected predicates
selector_diagnostics_data/2
Hook predicate that importing selector implementations must define in order to expose diagnostics metadata. A default implementation is provided that assumes the diagnostics list is the last argument of the selector term; concrete implementations following that convention do not need to override it.
staticselector_diagnostics_data(Selector,Diagnostics)selector_diagnostics_data(+compound,-list(compound)) - oneselector_export_template/4
Hook predicate that importing selector implementations must define in order to expose the exported selector template for a given functor.
staticselector_export_template(Dataset,Selector,Functor,Template)selector_export_template(+object_identifier,+compound,+atom,-callable) - oneselector_term_template/2
Hook predicate that importing selector implementations must define in order to expose the learned selector term template used by pretty-printing helpers.
staticselector_term_template(Selector,Template)selector_term_template(+compound,-callable) - oneprint_selector_template/1
Pretty-printing helper predicate used by importing selector implementations to show the learned selector term template.
staticprint_selector_template(Selector)print_selector_template(+compound) - onedataset_examples/2
Collects and validates dataset examples. Rejects duplicate declarations, repeated features within examples, unknown features, and inconsistent example counts.
staticdataset_examples(Dataset,Examples)dataset_examples(+object_identifier,-list(compound)) - one_or_errorinstantiation_errordomain_error(non_empty_examples,Dataset)domain_error(unknown_feature,Feature)domain_error(duplicate_feature,Feature)type_error(atomic,Feature)type_error(list,Features)type_error(pair,Entry)type_error(integer,DeclaredCount)domain_error(positive_integer,DeclaredCount)consistency_error(example_count,DeclaredCount,ObservedCount)dataset_examples/3
Collects declared feature names and validated examples in one pass over the dataset predicates. Uses the same validation as dataset_examples/2.
staticdataset_examples(Dataset,Features,Examples)dataset_examples(+object_identifier,-list(atomic),-list(compound)) - one_or_errorinstantiation_errordomain_error(non_empty_examples,Dataset)domain_error(duplicate_feature,Feature)domain_error(unknown_feature,Feature)type_error(atomic,Feature)type_error(list,Features)type_error(pair,Entry)type_error(integer,DeclaredCount)domain_error(positive_integer,DeclaredCount)consistency_error(example_count,DeclaredCount,ObservedCount)feature_names/2
Returns unique, atomic candidate features in declaration order, rejecting invalid or duplicate declarations.
staticfeature_names(Dataset,FeatureNames)feature_names(+object_identifier,-list(atomic)) - one_or_errorinstantiation_errortype_error(atomic,Feature)domain_error(duplicate_feature,Feature)feature_values/3
Returns the value of one feature for every example, in example order. An example that does not mention the feature contributes an unbound variable (a missing value).
staticfeature_values(Examples,Feature,Values)feature_values(+list(compound),+atomic,-list) - onetargets/2
Returns the target of every example, in example order (an unbound variable for an example with no known target).
statictargets(Examples,Targets)targets(+list(compound),-list) - onescore_features/4
Scores every feature using score/3 messages to the metric object. Returns Feature-Score pairs in decreasing score order, preserving input feature order for numeric ties.
staticscore_features(Metric,Examples,FeatureNames,FeatureScores)score_features(+object_identifier,+list(compound),+list(atomic),-list(pair)) - onesort_by_decreasing_score/2
Sorts feature scores numerically in decreasing order, preserving input order for ties.
staticsort_by_decreasing_score(FeatureScores,Sorted)sort_by_decreasing_score(+list(pair),-list(pair)) - oneselect_top_k/3
Returns the feature names of the K highest-scoring features (FeatureScores already sorted by decreasing score, as returned by score_features/4), preserving that order. Returns every feature name, still in that order, when fewer than K are given.
staticselect_top_k(FeatureScores,K,Selected)select_top_k(+list(pair),+positive_integer,-list(atomic)) - oneselect_above_threshold/3
Returns the feature names of every feature whose score is at least Threshold (FeatureScores already sorted by decreasing score, as returned by score_features/4), preserving that order.
staticselect_above_threshold(FeatureScores,Threshold,Selected)select_above_threshold(+list(pair),+number,-list(atomic)) - onebase_selector_diagnostics/5
Builds the common part of a selector diagnostics metadata list, combined with implementation-specific extra diagnostics terms.
staticbase_selector_diagnostics(Model,ExampleCount,Options,ExtraDiagnostics,Diagnostics)base_selector_diagnostics(+atom,+positive_integer,+list(compound),+list(compound),-list(compound)) - onevalid_selector_metadata/2
True when ground diagnostics metadata contains the expected model, a positive example count, and a list of stored options.
staticvalid_selector_metadata(Model,Diagnostics)valid_selector_metadata(+atom,+list(compound)) - zero_or_onevalid_selector_metadata/3
True when diagnostics metadata contains the expected model term and records the given effective options.
staticvalid_selector_metadata(Model,Options,Diagnostics)valid_selector_metadata(+atom,+list(compound),+list(compound)) - zero_or_onecheck_scoring_metric/1
Checks that a scoring metric option value names an object implementing score/3 (feature_scoring_protocol).
staticcheck_scoring_metric(Metric)check_scoring_metric(@callable) - one_or_errorMetric is a variable:instantiation_errorMetric is bound but does not implement score/3:domain_error(scoring_metric,Metric)Private predicates
compare_feature_scores/3
Compares numerically decreasing scores, breaking ties by increasing input position.
staticcompare_feature_scores(Order,ScoredFeature1,ScoredFeature2)compare_feature_scores(-atom,+compound,+compound) - oneOperators
(none)