.. index:: single: ada_boost .. _ada_boost/0: .. rst-class:: right **object** ``ada_boost`` ============= AdaBoost (Adaptive Boosting) classifier using C4.5 decision trees as base learners. Implements the SAMME (Stagewise Additive Modeling using a Multi-class Exponential loss function) variant, which supports multi-class classification. Builds an ensemble of weighted decision trees where each subsequent tree focuses on the examples misclassified by previous trees. | **Availability:** | ``logtalk_load(ada_boost(loader))`` | **Author:** Paulo Moura | **Version:** 1:0:0 | **Date:** 2026-02-20 | **Compilation flags:** | ``static, context_switching_calls`` | **Implements:** | ``public`` :ref:`classifier_protocol ` | **Imports:** | ``public`` :ref:`options ` | **Uses:** | :ref:`c45 ` | :ref:`fast_random(Algorithm) ` | :ref:`format ` | :ref:`list ` | :ref:`pairs ` | :ref:`type ` | **Remarks:** - Algorithm: AdaBoost iteratively trains weak learners (C4.5 decision trees) on weighted versions of the training data. After each iteration, the weights of misclassified examples are increased so that subsequent learners focus more on difficult cases. - SAMME variant: This implementation uses the SAMME algorithm (Zhu et al., 2009) which extends AdaBoost to the multi-class case by adjusting the weight update formula to account for the number of classes. - Learner weights: Each base learner receives a weight (alpha) proportional to its accuracy. More accurate learners have higher weights in the final ensemble vote. - Classifier representation: The learned classifier is represented as a ``ab_classifier(WeightedTrees, ClassValues, Options)`` term where ``WeightedTrees`` is a list of ``weighted_tree(Alpha, Tree, AttributeNames)`` elements. - Early stopping: Training stops early if a perfect classifier is found (zero weighted error) or if a base learner performs worse than random guessing. | **Inherited public predicates:** |  :ref:`options_protocol/0::check_option/1`  :ref:`options_protocol/0::check_options/1`  :ref:`classifier_protocol/0::classifier_to_clauses/4`  :ref:`classifier_protocol/0::classifier_to_file/4`  :ref:`options_protocol/0::default_option/1`  :ref:`options_protocol/0::default_options/1`  :ref:`classifier_protocol/0::learn/2`  :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:`options_protocol/0::valid_option/1`  :ref:`options_protocol/0::valid_options/1`   .. contents:: :local: :backlinks: top Public predicates ----------------- .. index:: learn/3 .. _ada_boost/0::learn/3: ``learn/3`` ^^^^^^^^^^^ Learns a classifier from the given dataset object using the specified options. | **Compilation flags:** | ``static`` | **Template:** | ``learn(Dataset,Classifier,Options)`` | **Mode and number of proofs:** | ``learn(+object_identifier,-compound,+list(compound))`` - ``one`` ------------ .. index:: predict_probabilities/3 .. _ada_boost/0::predict_probabilities/3: ``predict_probabilities/3`` ^^^^^^^^^^^^^^^^^^^^^^^^^^^ Predicts class probabilities for a new instance using the learned classifier. Returns a list of ``Class-Probability`` pairs sorted by descending probability. Probabilities are derived from the weighted votes of all base learners. | **Compilation flags:** | ``static`` | **Template:** | ``predict_probabilities(Classifier,Instance,Probabilities)`` | **Mode and number of proofs:** | ``predict_probabilities(+compound,+list,-list)`` - ``one`` ------------ Protected predicates -------------------- (no local declarations; see entity ancestors if any) Private predicates ------------------ (no local declarations; see entity ancestors if any) Operators --------- (none) .. seealso:: :ref:`dataset_protocol `, :ref:`c45 `, :ref:`isolation_forest `, :ref:`knn `, :ref:`naive_bayes `, :ref:`nearest_centroid `, :ref:`random_forest `