Learn R Programming

boostr (version 1.0.0)

predictClassFromWeightedVote: Predict a class using (un)weighted voting.

Description

Process a matrix of class predictions and form a column-wise estimate based on weighted voting.

Usage

predictClassFromWeightedVote(preds, weights, .parallel = FALSE, .rngSeed = 1234)
predictClassFromVote(preds, .parallel = FALSE, .rngSeed = 1234)

Arguments

preds
is (character) matrix of predicted classes
weights
is a vector of length equal to nrow(preds)
.parallel
is a boolean flag determining whether to work across columns of preds in parallel -- need to register a parallel backend (e.g. doParallel, doRedis) for this to actually work.
.rngSeed
the value of the RNG seed to be used in the case that ties are to be randomly broken.

Value

a character vector of length equal to ncol(preds) containing the class estimates per column of preds.

Details

Gives the vote from row(i) in preds weight equal to weights[i]. Ties are broken randomly, but before so, the seed is set to .rngSeed.