Create a boostr compatible wrapper for an estimation procedure.

Share:

Description

Use provided metadata on a given estimation procedure to create a boostr compatible wrapper. See section below for more details on estimation procedures.

Usage

1
wrapProcedure(proc, learningSet = "data", predictionSet = "newdata")

Arguments

proc

a function that obeys the definition of an estimation procedure as defined in the white paper. Generally, proc must be a function which learns some model and consequently returns an estimator that uses the learned model. See below.

learningSet

a string indicating the name of the argument in proc's signature that passes the data to be used inside proc.

predictionSet

a string indicating the name of the argument in predict's signature that indicates the observation to predicate responses for.

Value

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 proc will use to build a model.

...

any additional arguments necessary for proc to make its model.

and the returned closure from the wrapper has arguments

newdata

the data that proc's output will predict responses for.

.estimatorArgs

a named list of any additional arguments that need to be passed to proc's output.

Estimation Procedures

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").

References

Steven Pollack. (2014). Boost: a practical generalization of AdaBoost (Master's Thesis). http://pollackphoto.net/misc/masters_thesis.pdf

See Also

Other Wrapper Generators: buildEstimationProcedure; wrapAggregator; wrapPerformanceAnalyzer; wrapReweighter

Examples

 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)

Want to suggest features or report bugs for rdrr.io? Use the GitHub issue tracker.