category
regressor_common
Shared predicates for regressor learning defaults, diagnostics, validation, dataset validation, export, and pretty-print helpers.
logtalk_load(regression_protocols(loader))staticPublic predicates
(no local declarations; see entity ancestors if any)
Protected predicates
regressor_diagnostics_data/2
Default hook predicate for exposing diagnostics metadata from a regressor term. Importing implementations may override it when using a non-standard regressor representation.
staticregressor_diagnostics_data(Regressor,Diagnostics)regressor_diagnostics_data(+compound,-list(compound)) - oneregressor_export_template/4
Hook predicate that importing regressor implementations must define in order to expose the exported regressor template for a given functor.
staticregressor_export_template(Dataset,Regressor,Functor,Template)regressor_export_template(+object_identifier,+compound,+atom,-callable) - oneregressor_term_template/2
Hook predicate that importing regressor implementations must define in order to expose the learned regressor term template used by pretty-printing helpers.
staticregressor_term_template(Regressor,Template)regressor_term_template(+compound,-callable) - onedataset_attributes/2
Collects the dataset attribute declarations as Attribute-Values pairs.
staticdataset_attributes(Dataset,Attributes)dataset_attributes(+object_identifier,-list(pair)) - onedataset_examples/2
Collects the dataset examples as example(Id, TargetValue, AttributeValues) terms.
staticdataset_examples(Dataset,Examples)dataset_examples(+object_identifier,-list(compound)) - onecheck_examples/2
Validates that the collected examples list is non-empty, only contains numeric targets, and only uses declared attributes without duplicate bindings.
staticcheck_examples(Dataset,Examples)check_examples(+object_identifier,+list) - one_or_errordomain_error(non_empty_dataset,Dataset)type_error(number,Target)domain_error(attribute_occurrences,Attribute)domain_error(declared_attribute,Attribute)print_regressor_template/1
Pretty-printing helper predicate used by importing regressor implementations to show the learned regressor term template.
staticprint_regressor_template(Regressor)print_regressor_template(+compound) - onebase_regressor_diagnostics/6
Builds common diagnostics metadata terms for a learned regressor and appends regressor-specific diagnostics terms.
staticbase_regressor_diagnostics(Model,Target,TrainingExampleCount,Options,ExtraDiagnostics,Diagnostics)base_regressor_diagnostics(+atom,+atom,+integer,+list(compound),+list(compound),-list(compound)) - onevalid_attribute_names/1
True when a list of attribute names is a proper list of distinct atoms.
staticvalid_attribute_names(AttributeNames)valid_attribute_names(+list(atom)) - zero_or_onevalid_attribute_declarations/1
True when a list of attribute declarations is a proper list of distinct Attribute-Values pairs where values are either continuous or a valid discrete value list.
staticvalid_attribute_declarations(Attributes)valid_attribute_declarations(+list(pair)) - zero_or_onevalid_discrete_values/1
True when a list of categorical values is non-empty, contains only nonvar terms, and has no duplicates.
staticvalid_discrete_values(Values)valid_discrete_values(+list) - zero_or_onevalid_regression_encoders/1
True when a list of encoders only contains valid continuous/3 or categorical/2 encoder terms with distinct attributes.
staticvalid_regression_encoders(Encoders)valid_regression_encoders(+list(compound)) - zero_or_onevalid_regressor_options/1
True when a list of options is structurally valid for the receiving regressor implementation.
staticvalid_regressor_options(Options)valid_regressor_options(+list(compound)) - zero_or_onevalid_regressor_metadata/2
True when diagnostics metadata contains the expected model term and records a structurally valid effective options list.
staticvalid_regressor_metadata(Model,Diagnostics)valid_regressor_metadata(+atom,+list(compound)) - zero_or_onevalid_diagnostic_count/3
True when diagnostics contains a count term with the given functor and integer value.
staticvalid_diagnostic_count(Functor,Diagnostics,Count)valid_diagnostic_count(+atom,+list(compound),+integer) - zero_or_onevalid_linear_model_diagnostics/1
True when diagnostics contains structurally valid linear-model optimization metadata terms for convergence, completed iterations, and final parameter delta.
staticvalid_linear_model_diagnostics(Diagnostics)valid_linear_model_diagnostics(+list(compound)) - zero_or_onevalid_encoded_rows/2
True when encoded training rows match the feature count induced by the encoders and carry numeric targets.
staticvalid_encoded_rows(Encoders,Rows)valid_encoded_rows(+list(compound),+list) - zero_or_oneencoded_feature_count/2
Counts the number of numeric features induced by a list of continuous and categorical encoders, including missing-value indicator features.
staticencoded_feature_count(Encoders,FeatureCount)encoded_feature_count(+list(compound),-integer) - onecontinuous_stats/5
Computes the mean and scaling factor used to encode a continuous attribute from the training examples according to the effective feature scaling option.
staticcontinuous_stats(Attribute,Examples,Options,Mean,Scale)continuous_stats(+atom,+list(compound),+list(compound),-float,-positive_float) - oneexamples_to_rows/3
Encodes dataset examples as numeric feature-vector and target pairs using a list of encoders.
staticexamples_to_rows(Examples,Encoders,Rows)examples_to_rows(+list(compound),+list(compound),-list(pair)) - oneencode_instance/3
Validates and encodes an attribute-value list as a numeric feature vector using a list of continuous and categorical encoders.
staticencode_instance(Encoders,AttributeValues,Features)encode_instance(+list(compound),+list(pair),-list(float)) - onefit_linear_model/7
Builds linear-model encoders from the training dataset, encodes the examples, fits an ordinary least-squares bias plus weight vector using the linear_algebra least-squares solver, and returns solver diagnostics terms.
staticfit_linear_model(Dataset,Options,Encoders,TrainingExampleCount,Bias,Weights,TrainingDiagnostics)fit_linear_model(+object_identifier,+list(compound),-list(compound),-integer,-float,-list(float),-list(compound)) - onefit_ridge_model/7
Builds linear-model encoders from the training dataset, encodes the examples, fits a bias plus weight vector by solving the ridge normal equations with partial pivoting, and returns ridge-specific diagnostics terms.
staticfit_ridge_model(Dataset,Options,Encoders,TrainingExampleCount,Bias,Weights,TrainingDiagnostics)fit_ridge_model(+object_identifier,+list(compound),-list(compound),-integer,-float,-list(float),-list(compound)) - onevalid_feature_labels/1
True when a list of regression-tree feature labels only contains valid feature/2 terms.
staticvalid_feature_labels(FeatureLabels)valid_feature_labels(+list(compound)) - zero_or_onevalid_regression_tree/2
True when a regression tree only contains valid leaf/1 and node/5 terms using feature indexes within bounds.
staticvalid_regression_tree(Tree,FeatureCount)valid_regression_tree(+compound,+positive_integer) - zero_or_onePrivate predicates
check_attribute_declarations/1
Checks that dataset attribute declarations use distinct attribute names and valid value domains.
staticcheck_attribute_declarations(Attributes)check_attribute_declarations(+list(pair)) - one_or_errordomain_error(attribute_declarations,Attribute)known_attribute_values/3
Collects the known numeric values for a continuous attribute from the training examples, skipping omitted and variable values.
staticknown_attribute_values(Examples,Attribute,Values)known_attribute_values(+list(compound),+atom,-list(number)) - onecheck_attribute_bindings/2
Checks that an attribute-value list contains only declared attributes and does not repeat any declared attribute; omitted declared attributes are allowed and treated as missing values.
staticcheck_attribute_bindings(AttributeNames,AttributeValues)check_attribute_bindings(+list(atom),+list(pair)) - onecheck_declared_attribute_bindings/2
Checks that no declared attribute appears more than once in an attribute-value list.
staticcheck_declared_attribute_bindings(AttributeNames,AttributeValues)check_declared_attribute_bindings(+list(atom),+list(pair)) - onecheck_undeclared_attribute_bindings/2
Checks that every attribute occurring in an attribute-value list is declared.
staticcheck_undeclared_attribute_bindings(AttributeValues,AttributeNames)check_undeclared_attribute_bindings(+list(pair),+list(atom)) - oneattribute_occurrences/4
Counts the number of times an attribute occurs in an attribute-value list.
staticattribute_occurrences(AttributeValues,Attribute,Count0,Count)attribute_occurrences(+list(pair),+atom,+integer,-integer) - onedeclared_attribute_names/2
Collects the declared attribute names from dataset attribute declarations.
staticdeclared_attribute_names(Attributes,AttributeNames)declared_attribute_names(+list(pair),-list(atom)) - oneencoder_attribute_names/2
Collects the declared attribute names from a list of regression encoders.
staticencoder_attribute_names(Encoders,AttributeNames)encoder_attribute_names(+list(compound),-list(atom)) - oneencode_instance_checked/3
Encodes an already validated attribute-value list as a numeric feature vector using a list of continuous and categorical encoders.
staticencode_instance_checked(Encoders,AttributeValues,Features)encode_instance_checked(+list(compound),+list(pair),-list(float)) - onevalid_linear_model_convergence/1
True when a linear-model optimization stop reason is recognized.
staticvalid_linear_model_convergence(Convergence)valid_linear_model_convergence(+atom) - zero_or_onenormalize_continuous/4
Normalizes a continuous value using a stored mean and scale.
staticnormalize_continuous(Value,Mean,Scale,Feature)normalize_continuous(+number,+float,+positive_float,-float) - onecheck_categorical_value/3
Validates that a categorical value is declared for an attribute.
staticcheck_categorical_value(Attribute,Values,Value)check_categorical_value(+atom,+list,+nonvar) - oneone_hot_encode/4
Encodes a declared categorical value using reference-level dummy coding plus a trailing missing-value indicator feature set to zero.
staticone_hot_encode(Values,Value,Encoded,Tail)one_hot_encode(+list,+nonvar,-list(float),+list(float)) - onemissing_one_hot_encode/3
Encodes a missing categorical value as reference-level dummy zeroes plus a trailing missing-value indicator feature set to one.
staticmissing_one_hot_encode(Values,Encoded,Tail)missing_one_hot_encode(+list,-list(float),+list(float)) - onezero_vector_from_values/3
Creates a zero vector with one element per supplied categorical value slot.
staticzero_vector_from_values(Values,Zeroes,Tail)zero_vector_from_values(+list,-list(float),+list(float)) - onebuild_linear_encoders/4
Builds the encoder list used by linear models from dataset attribute declarations, training examples, and the effective feature scaling option.
staticbuild_linear_encoders(Attributes,Examples,Options,Encoders)build_linear_encoders(+list(pair),+list(compound),+list(compound),-list(compound)) - onetrain_linear_model/6
Fits an ordinary least-squares linear model bias and weight vector from encoded rows by delegating the solve and rank estimation to the linear_algebra library and returns solver diagnostics terms.
statictrain_linear_model(Rows,FeatureCount,Options,Bias,Weights,TrainingDiagnostics)train_linear_model(+list(pair),+integer,+list(compound),-float,-list(float),-list(compound)) - onerows_to_design_matrix/3
Transforms encoded training rows into a row-oriented design matrix with a leading intercept column and a target vector.
staticrows_to_design_matrix(Rows,DesignMatrix,Targets)rows_to_design_matrix(+list(pair),-list(list(float)),-list(float)) - oneresidual_sum_of_squares/4
Computes the residual sum of squares for encoded training rows and a learned intercept plus weight vector.
staticresidual_sum_of_squares(Rows,Bias,Weights,ResidualSumOfSquares)residual_sum_of_squares(+list(pair),+float,+list(float),-float) - onetrain_ridge_model/6
Fits a ridge model bias and weight vector from encoded rows by solving a direct weighted linear system and returns diagnostics terms describing the solve.
statictrain_ridge_model(Rows,FeatureCount,Options,Bias,Weights,TrainingDiagnostics)train_ridge_model(+list(pair),+integer,+list(compound),-float,-list(float),-list(compound)) - oneridge_feature_statistics/3
Computes per-feature ridge penalty weights and active-feature flags from encoded training rows, dropping zero-variance columns from the direct solve.
staticridge_feature_statistics(Rows,PenaltyWeights,ActiveFlags)ridge_feature_statistics(+list(pair),-list(float),-list(atom)) - oneaccumulate_feature_statistics/5
Accumulates per-feature sums and squared sums over encoded training rows.
staticaccumulate_feature_statistics(Rows,Sums0,SumSquares0,Sums,SumSquares)accumulate_feature_statistics(+list(pair),+list(float),+list(float),-list(float),-list(float)) - oneadd_squared_vector/3
Adds the element-wise squares of a feature vector to an accumulated vector.
staticadd_squared_vector(Features,AccumulatedSquares0,AccumulatedSquares)add_squared_vector(+list(float),+list(float),-list(float)) - onefeature_penalty_profiles/5
Builds ridge penalty weights and active-feature flags from per-feature sums and squared sums.
staticfeature_penalty_profiles(Sums,SumSquares,Count,PenaltyWeights,ActiveFlags)feature_penalty_profiles(+list(float),+list(float),+integer,-list(float),-list(atom)) - oneactive_feature_count/2
Counts the number of active encoded features retained for the direct ridge solve.
staticactive_feature_count(ActiveFlags,Count)active_feature_count(+list(atom),-integer) - onecompress_rows/3
Filters encoded training rows down to the active feature subset selected for the direct ridge solve.
staticcompress_rows(Rows,ActiveFlags,CompressedRows)compress_rows(+list(pair),+list(atom),-list(pair)) - onecompress_features/3
Filters a feature vector down to the active feature subset selected for the direct ridge solve.
staticcompress_features(Features,ActiveFlags,CompressedFeatures)compress_features(+list(float),+list(atom),-list(float)) - onecompress_vector/3
Filters a numeric vector down to the active positions selected for the direct ridge solve.
staticcompress_vector(Vector,ActiveFlags,CompressedVector)compress_vector(+list(float),+list(atom),-list(float)) - onebuild_ridge_system/5
Builds the regularized linear system for the intercept plus active ridge coefficients.
staticbuild_ridge_system(Rows,PenaltyWeights,Regularization,Matrix,Vector)build_ridge_system(+list(pair),+list(float),+float,-list(list(float)),-list(float)) - oneaccumulate_ridge_system/5
Accumulates the unregularized normal-equation matrix and target vector for a set of active encoded rows.
staticaccumulate_ridge_system(Rows,Matrix0,Vector0,Matrix,Vector)accumulate_ridge_system(+list(pair),+list(list(float)),+list(float),-list(list(float)),-list(float)) - oneadd_outer_product/4
Adds the outer product of two vectors to an accumulated matrix.
staticadd_outer_product(Vector1,Vector2,Matrix0,Matrix)add_outer_product(+list(float),+list(float),+list(list(float)),-list(list(float))) - oneregularize_ridge_matrix/4
Adds the ridge penalty weights to the feature-feature diagonal block of a linear system matrix.
staticregularize_ridge_matrix(Matrix0,PenaltyWeights,Regularization,Matrix)regularize_ridge_matrix(+list(list(float)),+list(float),+float,-list(list(float))) - onesolve_linear_system/4
Solves a square linear system using partial pivoting Gaussian elimination and returns the solver name.
staticsolve_linear_system(Matrix,Vector,Solution,Solver)solve_linear_system(+list(list(float)),+list(float),-list(float),-atom) - one_or_erroraugment_rows/3
Pairs each matrix row with its corresponding right-hand-side value for elimination.
staticaugment_rows(Matrix,Vector,Rows)augment_rows(+list(list(float)),+list(float),-list(compound)) - onetriangularize/2
Transforms an augmented matrix into upper-triangular form using partial pivoting.
statictriangularize(Rows0,UpperRows)triangularize(+list(compound),-list(compound)) - one_or_errorselect_pivot_row/3
Selects the pivot row with the largest leading magnitude and returns the remaining rows.
staticselect_pivot_row(Rows0,PivotRow,RemainingRows)select_pivot_row(+list(compound),-compound,-list(compound)) - oneleading_magnitude/2
Returns the absolute leading coefficient magnitude of an augmented row.
staticleading_magnitude(Row,Magnitude)leading_magnitude(+compound,-float) - oneensure_non_zero/1
Checks that a pivot coefficient is numerically non-zero.
staticensure_non_zero(Value)ensure_non_zero(+float) - one_or_errorevaluation_error(zero_divisor)eliminate_rows/5
Eliminates the leading coefficient from remaining augmented rows using a pivot row.
staticeliminate_rows(Pivot,PivotTail,PivotValue,Rows0,Rows)eliminate_rows(+float,+list(float),+float,+list(compound),-list(compound)) - onescaled_row_difference/4
Subtracts a scaled pivot tail from another row tail.
staticscaled_row_difference(PivotTail,RowTail,Factor,Difference)scaled_row_difference(+list(float),+list(float),+float,-list(float)) - oneback_substitution/2
Performs back-substitution on an upper-triangular augmented matrix.
staticback_substitution(UpperRows,Solution)back_substitution(+list(compound),-list(float)) - one_or_errormaximum_linear_system_residual/4
Computes the maximum absolute residual of a solved linear system.
staticmaximum_linear_system_residual(Matrix,Vector,Solution,MaximumResidual)maximum_linear_system_residual(+list(list(float)),+list(float),+list(float),-float) - oneexpand_weights/3
Expands active ridge coefficients back to the full encoded feature vector, inserting zeroes for dropped zero-variance features.
staticexpand_weights(ActiveFlags,ActiveWeights,Weights)expand_weights(+list(atom),+list(float),-list(float)) - oneOperators
(none)