| Did you know ... | Search Documentation: |
| Pack logtalk -- logtalk-3.100.1/docs/apis/_sources/c45_classifier_0.rst.txt |
.. index:: single: c45_classifier .. _c45_classifier/0:
.. rst-class:: right
object
c45_classifier
C4.5 decision tree learning algorithm. Builds a decision tree from a dataset object implementing the dataset_protocol protocol and provides predicates for exporting the learned tree as a list of predicate clauses or to a file. Supports both discrete and continuous attributes, handles missing values, and supports tree pruning.
| Availability:
| logtalk_load(c45_classifier(loader))
| Author: Paulo Moura | Version: 2:0:0 | Date: 2026-05-11
| Compilation flags:
| static, context_switching_calls
| Imports:
| public :ref:`classifier_common <classifier_common/0>`
| Uses:
| :ref:`format <format/0>`
| :ref:`list <list/0>`
| :ref:`numberlist <numberlist/0>`
| :ref:`pairs <pairs/0>`
| :ref:`type <type/0>`
| Remarks: | (none)
| Inherited public predicates: | Â :ref:`classifier_protocol/0::check_classifier/1` Â :ref:`options_protocol/0::check_option/1` Â :ref:`options_protocol/0::check_options/1` Â :ref:`classifier_protocol/0::classifier_options/2` Â :ref:`options_protocol/0::default_option/1` Â :ref:`options_protocol/0::default_options/1` Â :ref:`classifier_protocol/0::diagnostic/2` Â :ref:`classifier_protocol/0::diagnostics/2` Â :ref:`classifier_protocol/0::export_to_clauses/4` Â :ref:`classifier_protocol/0::export_to_file/4` Â :ref:`classifier_protocol/0::learn/2` Â :ref:`classifier_protocol/0::learn/3` Â :ref:`options_protocol/0::option/2` Â :ref:`options_protocol/0::option/3` Â :ref:`classifier_protocol/0::predict/3` Â :ref:`classifier_protocol/0::print_classifier/1` Â :ref:`classifier_protocol/0::valid_classifier/1` Â :ref:`options_protocol/0::valid_option/1` Â :ref:`options_protocol/0::valid_options/1` Â
.. contents:: :local: :backlinks: top
.. index:: prune/5 .. _c45_classifier/0::prune/5:
prune/5 ^^^^^^^^^^^
Prunes a decision tree using pessimistic error pruning (PEP). This post-pruning method estimates error rates using the upper confidence bound of the binomial distribution with the given confidence factor and replaces subtrees with leaf nodes when doing so would not increase the estimated error. Pruning helps reduce overfitting and can improve generalization to unseen data.
| Compilation flags:
| static
| Template:
| prune(Dataset,Tree,ConfidenceFactor,MinInstances,PrunedTree)
| Mode and number of proofs:
| prune(+object_identifier,+tree,+float,+positive_integer,-tree) - one
| Remarks:
(0.0, 1.0). Lower values result in more aggressive pruning (smaller, simpler trees), while higher values result in less pruning (larger, more complex trees). The default value is 0.25.2... index:: prune/3 .. _c45_classifier/0::prune/3:
prune/3 ^^^^^^^^^^^
Prunes a decision tree using pessimistic error pruning (PEP) with default parameter values. Calls prune/5 with ConfidenceFactor = 0.25 and MinInstances = 2.
| Compilation flags:
| static
| Template:
| prune(Dataset,Tree,PrunedTree)
| Mode and number of proofs:
| prune(+object_identifier,+tree,-tree) - one
| Remarks:
0.25 (the confidence level for computing the upper bound of the error estimate) and minimum instances per leaf of 2.(no local declarations; see entity ancestors if any)
(no local declarations; see entity ancestors if any)
(none)
.. seealso::
:ref:`dataset_protocol <dataset_protocol/0>`, :ref:`isolation_forest_anomaly_detector <isolation_forest_anomaly_detector/0>`, :ref:`knn_classifier <knn_classifier/0>`, :ref:`naive_bayes_classifier <naive_bayes_classifier/0>`, :ref:`nearest_centroid_classifier <nearest_centroid_classifier/0>`, :ref:`random_forest_classifier <random_forest_classifier/0>`, :ref:`adaptive_boosting_classifier <adaptive_boosting_classifier/0>`