Generate Predictions or Retrodictions From a Set of (Adaptively) Boosted Trees and Model Weights
testAda.Rd
This function implements the testing phase of the AdaBoost algorithm. It extracts the adaptively boosted weak learners (e.g. classification stumps) and their corresponding weights to combine them into the weighted sum $$H(\mathbf{x}) = \sum_{i=1}^Ta_th_t(\mathbf x),$$ which yields AdaBoost's predictions or retrodictions on a given set.
Arguments
- fit
A model fitted with
trainAda
. This is a list of boosted trees and theirs weights. More specifically, each element of the list contains a weak learner (e.g., a decision stump) and its corresponding weight.- data
A data frame containing the test set for predictions. The structure should match the training set used to generate
h
.- input_checks
A logical value indicating whether to perform input validation checks. Defaults to
TRUE
.- verbose
A logical value specifying whether to display progress messages and animations. Defaults to
TRUE
.
Value
A numeric vector containing the final predictions from the AdaBoost
model. The predictions are in the form of -1
or 1
,
corresponding to binary classification outcomes.
Details
The function proceeds as follows:
If
input_checks
isTRUE
, basic input validation is performed to ensure thatfit
is a valid AdaBoost model anddata
is appropriate for predictions.Progress messages and animations are shown if
verbose
isTRUE
.Boosted weak learners (
h
) and their weights (a
) are extracted fromfit
.Predictions or retrodictions are generated for each weak learner using the test set.
Individual predictions are combined using the weights from the AdaBoost model to produce the final predictions.