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.
heuristicsProb(...)
A list of predictProbInternal implementers, e.g. a fitted ttb model.
An object of class heuristics, which implements createFunction. Users will generally not use this directly-- rowPairApply will.
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.
# NOT RUN {
## 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.
# }
Run the code above in your browser using DataLab