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` classifier_protocol
Imports:
`public` options
Uses:
c45
fast_random(Algorithm)
format
list
pairs
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:
check_option/1 check_options/1 classifier_to_clauses/4 classifier_to_file/4 default_option/1 default_options/1 learn/2 option/2 option/3 predict/3 print_classifier/1 valid_option/1 valid_options/1

## Public predicates

### `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`

### `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)

See also

dataset_protocol, c45, isolation_forest, knn, naive_bayes, nearest_centroid, random_forest