Description Usage Arguments Value Estimation Procedures References See Also Examples
View source: R/wrapProcedure.R
Use provided metadata on a given estimation procedure to create a boostr compatible wrapper. See section below for more details on estimation procedures.
1 | wrapProcedure(proc, learningSet = "data", predictionSet = "newdata")
|
proc |
a function that obeys the definition of an estimation procedure
as defined in the white paper. Generally, |
learningSet |
a string indicating the name of the argument in
|
predictionSet |
a string indicating the name of the argument in
|
An 'estimationProcedure
' object whose signature and whose
output's signature are compatible with boostr. Explicitly, the arguments of
the wrapper are
data |
the data that |
... |
any additional arguments necessary for |
and the returned closure from the wrapper has arguments
newdata |
the data that |
.estimatorArgs |
a named list of any additional arguments that need to
be passed to |
The examples below demonstrate two typical estimation procedures. For more
information, see the Estimation Procedures section in the vignette
vignette(topic = "boostr_user_inputs", package="boostr")
.
Steven Pollack. (2014). Boost: a practical generalization of AdaBoost (Master's Thesis). http://pollackphoto.net/misc/masters_thesis.pdf
Other Wrapper Generators: buildEstimationProcedure
;
wrapAggregator
;
wrapPerformanceAnalyzer
;
wrapReweighter
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 | ## Not run:
# examples of estimation procedures
library(class)
library(e1071)
kNN <- function(data, formula, k) {
df <- model.frame(formula=formula, data=data)
function(newdata) {
knn(train=df[, -1], test=newdata, cl=df[, 1], k=k)
}
}
SVM <- function(data, formula, cost) {
model <- svm(formula, data, cost=cost)
function(newdata) {
predict(model, newdata)
}
}
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.