Description Usage Arguments Value Aggregators References See Also Examples
View source: R/wrapAggregator.R
Use provided metadata on a given aggregator to create a boostr compatible wrapper. See section below for details on aggregators.
1 | wrapAggregator(aggregator, .inputEnsemble = "estimators", .verbose = FALSE)
|
aggregator |
a function which satisfies the abstract definition of an aggregator. |
.inputEnsemble |
a string indicating the name of the argument that
|
.verbose |
a logical flag indicating whether warnings should be output or not. |
A function with is also an 'aggregator
' object. The function's
signature and output are now compatible with the boostr framework. In
particular, the signature of the wrapper is
estimators |
the list of estimators to be sent to |
... |
any additional arguments accepted/required by |
The output of this aggregator is an estimator with signature
newdata |
the data the |
See the Aggregators section in the vignette
vignette(topic = "boostr_user_inputs", package="boostr")
for
more details on aggregators.
Steven Pollack. (2014). Boost: a practical generalization of AdaBoost (Master's Thesis). http://pollackphoto.net/misc/masters_thesis.pdf
Other Wrapper Generators: buildEstimationProcedure
;
wrapPerformanceAnalyzer
;
wrapProcedure
; wrapReweighter
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 | ## Not run:
testAggregator <- function(ensemble) {
weights <- runif(min=0, max=1, n=length(ensemble))
function(x) {
preds <- foreach(estimator = iter(ensemble),
.combine = rbind) %do% {
matrix(as.character(estimator(x)), nrow=1)
}
as.factor(predictClassFromWeightedVote(preds, weights))
}
}
wrappedAggregator <- wrapAggregator(testAggregator,
.inputEnsemble="ensemble")
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.