heuristicsProb {heuristica} | R Documentation |
Wrap fitted heuristics to pass to rowPairApply to call predictProb.
Description
One or more fitted heuristics can be passed in. They must all implement predictProbInternal. Users will generally not use the output directly but instead pass this to rowPairApply.
Usage
heuristicsProb(...)
Arguments
... |
A list of predictProbInternal implementers, e.g. a fitted ttb model. |
Value
An object of class heuristics, which implements createFunction. Users will generally not use this directly– rowPairApply will.
See Also
rowPairApply
which is what heuristicsProb is passed in to.
predictProbInternal
which must be implemented by heuristics in
order to use them with the heuristicsProb() wrapper function.
Examples
## This is typical usage:
data <- cbind(y=c(30,20,10,5), x1=c(1,1,0,0), x2=c(1,1,0,1))
ttb <- ttbModel(data, 1, c(2:ncol(data)))
rowPairApply(data, heuristicsProb(ttb))
## This outputs ttb's predictions for all 6 row pairs of data.
## (It has 6 row pairs because 4*2/2 = 6.) It gets the predictions
## by calling ttb's predictProbInternal.
[Package heuristica version 1.0.3 Index]