Description Usage Arguments Details Value Note References Examples
Perform the Boost algorithm on proc
with reweighter
and
aggregator
and monitor estimator performance with
analyzePerformance
.
1 2 3 4 5 6 | boostBackend(B, reweighter, aggregator, proc, data, initialWeights, .procArgs,
analyzePerformance = defaultOOBPerformanceAnalysis,
.reweighterArgs = NULL, .aggregatorArgs = NULL,
.analyzePerformanceArgs = NULL, .subsetFormula = findFormulaIn(.procArgs),
.formatData = !is.null(.subsetFormula), .storeData = FALSE,
.calcBoostrPerformance = TRUE)
|
B |
the number of iterations to run. |
reweighter |
a boostr compatible reweighter function. |
aggregator |
a boostr compatible aggregator function. |
proc |
a boostr compatible estimation procedure. |
data |
the learning set to pass to |
initialWeights |
a vector of weights used for the first iteration of the ensemble building phase of Boost. |
.procArgs |
a named list of arguments to pass to |
.reweighterArgs |
a named list of arguments to pass to
|
.aggregatorArgs |
a named list of arguments to pass to
|
.storeData |
a boolean indicating whether the data should be stored in
the returned |
.calcBoostrPerformance |
a boolean indicating whether
|
.subsetFormula |
a |
.formatData |
a boolean indicating whether the data needs to be
reformatted via |
analyzePerformance |
a boostr compatible performance analyzer. |
.analyzePerformanceArgs |
a named list arguments to pass to
|
For the details behind this algorithm, check out the paper at http://pollackphoto.net/misc/masters_thesis.pdf
a "boostr
" object. The returned closure is the output of
aggregator
on the collection of estimators built during the iterative
phase of Boost. This is intended to be a new estimator, and hence accepts
the argument newdata
. However, the estimator also has attributes
ensembleEstimators |
An ordered list whose components are the trained estimators. |
reweighterOutput |
An ordered list whose components are the output of
|
performanceOnLearningSet |
The performance of the returned boostr object
on the learning set, as measure by |
estimatorPerformance |
An ordered list whose components are the output
of |
oobVec |
A row-major matrix whose ij-th entry indicates if observation j was used to train estimator i. |
reweighter |
The reweighter function used. |
reweighterArgs |
Any additional arguments passed to |
aggregator |
The aggregator function used. |
aggregatorArgs |
Any additional arguments passed to |
estimationProcedure |
The estimation procedure used. |
estimationProcedureArgs |
Any additional arguments passed to
|
data |
The learning set. Only stored if |
analyzePerformance |
The performance analyzer used. |
analyzePerformanceArgs |
Any additional arguments passed to
|
subsetFormula |
The value of |
formatData |
The value of |
storeData |
The value of |
calcBoostrPerformance |
The value of |
initialWeights |
The initial weights used. |
The attributes can be accessed through the appropropriate
extraction function
.
wrapReweighter
, wrapAggregator
,
wrapPerformanceAnalyzer
, wrapProcedure
, and
buildEstimationProcedure
are all Wrapper Generators
designed to allow user implemented functions inside the boostBackend
.
These functions are intelligently called from inside boost
.
Thus, to minimize any sources of frustration, the recommended use of
boostBackend
is through boost
.
Steven Pollack. (2014). Boost: a practical generalization of AdaBoost (Master's Thesis). http://pollackphoto.net/misc/masters_thesis.pdf
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 | ## Not run:
df <- within(iris, {
Setosa <- factor(2*as.numeric(Species == "setosa") - 1)
Species <- NULL
})
form <- formula(Setosa ~ . )
df <- model.frame(formula=form, data=df)
# demonstrate arc-fs algorithm using boostr convenience functions
glmArgs <- list(.trainArgs=list(formula=form, family="binomial"))
# format prediction to yield response in {-1,1} instead of {0,1}
glm_predict <- function(object, newdata) {
2*round(predict(object, newdata, type='response')) - 1
}
Phi_glm <- buildEstimationProcedure(train=glm, predict=glm_predict)
phi <- boostBackend(B=3, data=df,
reweighter=adaboostReweighter,
aggregator=adaboostAggregator,
proc=Phi_glm,
.procArgs=glmArgs)
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.