| Did you know ... | Search Documentation: |
| Pack logtalk -- logtalk-3.100.1/docs/handbook/_sources/libraries/regression_tree.rst.txt |
.. _library_regression_tree:
regression_tree
Regression tree regressor supporting continuous and mixed-feature
datasets. The library implements the regressor_protocol defined in
the regression_protocols library and learns a binary regression tree
using recursive variance-reduction splits that select the encoded
feature threshold maximizing variance reduction.
Open the `../../apis/library_index.html#regression_tree <../../apis/library_index.html#regression_tree>`__ link in a web browser.
To load this library, load the loader.lgt file:
::
| ?- logtalk_load(regression_tree(loader)).
To test this library predicates, load the tester.lgt file:
::
| ?- logtalk_load(regression_tree(tester)).
To run the performance benchmark suite, load the
tester_performance.lgt file:
::
| ?- logtalk_load(regression_tree(tester_performance)).
The shared exporter in the regressor_common category writes a header
before the exported clauses in the following format:
::
% exported regressor predicate: Functor/Arity % training dataset: Dataset % target: Target % attributes: Attributes % diagnostics: Diagnostics % Functor(Encoders, FeatureLabels, Tree, Diagnostics) Functor(Encoders, FeatureLabels, Tree, Diagnostics)
The exported clauses serialize the learned regressor state so that loading the file gives a regressor term that can be passed directly to the predict/3 predicate.
When exporting a serialized regressor term, using a noun such as regressor/4 or model/4 is recommended.
The learned regressor is represented by default as:
regression_tree_regressor(Encoders, FeatureLabels, Tree, Diagnostics)
In this representation, Tree is built from leaf(Prediction) and
node(Index, Threshold, FallbackPrediction, Left, Right) terms and
Diagnostics stores training metadata including the effective
options.The diagnostics/2 predicate returns a list of metadata terms with the form:
::
[
model(regression_tree),
target(Target),
training_example_count(TrainingExampleCount),
options(Options),
encoded_feature_count(FeatureCount)
]
Where:
model(regression_tree) identifies the learning algorithm that
produced the regressor.target(Target) stores the target attribute name declared by the
training dataset.training_example_count(TrainingExampleCount) stores the number of
examples used during training.options(Options) stores the effective learning options after
merging the user options with the library defaults.encoded_feature_count(FeatureCount) stores the number of numeric
features induced by the encoder list, including missing-value
indicator features.
Use the regression_protocols diagnostic/2 and
regressor_options/2 helper predicates when you only need a single
metadata term or the effective options.
The learn/3 predicate accepts the following options:
10.1.0.0.all. The default is all.true and
false. The default is false.