Learn R Programming

Rborist (version 0.1-1)

PreTrain: Preformatting for Training with Warm Starts

Description

Presorts and formats training input into a form suitable for subsequent training by Rborist command. Saves unnecessary recomputation of this form when iteratively retraining.

Usage

"PreTrain"(x)

Arguments

x
the design matrix expressed as either a data.frame object with numeric and/or factor columns or as a numeric matrix.

Value

PreTrain
a list of presorted and formatted predictor information:colNames a vector of strings containing the training column names.rowNames a vector of strings containing the training row names.blockNum a matrix containing all numeric predictor values.blockFac a matrix containing all factor predictor values.nPredFac the number of factor predictors.nRow the number of training rows.facCard a vector of the factor cardinalities.signature a list consisting of training information needed for separate testing and prediction:nRow the number of training rows.predMap a vector mapping core predictor indices back to their respective front-end positions.level a vector of strings containing the training response factor levels.

Examples

Run this code
  ## Not run: 
#     data(iris)
#     pt <- PreTrain(iris[,-5])
# 
#     ppTry <- seq(0.2, 0.5, by= 0.3/10)
#     nIter <- length(ppTry)
#     rsq <- numeric(nIter)
#     for (i in 1:nIter) {
#       rb <- Rborist(pt, iris[,5], predProb=ppTry[i])
#       rsq[i] = rb$validiation$rsq
#     }
#   ## End(Not run)

Run the code above in your browser using DataLab