Description Usage Arguments Value Estimation Procedures Warning References See Also Examples
View source: R/buildEstimationProcedure.R
A convenience function which builds a boostr compatible estimation
procedure from functions train
and predict
.
1 2 | buildEstimationProcedure(train, predict = stats::predict,
learningSet = "data", predictionSet = "newdata", modelName = "object")
|
train |
a function that learns from data to produce a model |
predict |
a function that leverages the model from |
learningSet |
a string indicating the name of the argument in
|
predictionSet |
a string indicating the name of the argument in
|
modelName |
a string indicating the name of the argument in
|
An 'estimationProcedure
' object which is compatible with the
boostr framework. Meaning, the output is a function factory which accepts
arguments
data |
the data to be passed to |
.trainArgs |
a list of arguments to be passed to |
.predictArgs |
a list of arguments to pass to |
and returns a closure with arguments
newdata |
the data whose response variable is to be estimated. |
.predictArgs |
a list of arguments to pass 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")
.
This function makes the fundamental assumption that the design-pattern
linking train
and predict is the common train
-predict
pattern found in the design of SVM
in the examples. If this is not the
case, you'll want to build assemble your procedure manually and call
wrapProcedure
instead.
Steven Pollack. (2014). Boost: a practical generalization of AdaBoost (Master's Thesis). http://pollackphoto.net/misc/masters_thesis.pdf
Other Wrapper Generators: wrapAggregator
;
wrapPerformanceAnalyzer
;
wrapProcedure
; 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.