Rborist (version 0.2-3)

PreFormat: 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

# S3 method for default
PreFormat(x, verbose)

Value

PreFormat

a list consisting of three objects:

predFrame a list of presorted and formatted predictor information: blockFac a matrix of zero-based factor predictor values. blockFacSparse a sparse block of factor predictor values. blockNum a matrix of dense numeric predictor values. blockNumSparse a sparse block of numeric predictor values. nPredFac the number of factor predictors. nRow the number of training rows. nPredFac the number of factor-valued predictors. facCard a vector of the factor cardinalities. nPredNum the number of numerical predictors. summaryRLE a run-length encoded version of the training observations. obsHash a hashed version of the training observations, used to ensure that subsequent invocations of Rborist employ the same observations used to train.

Arguments

x

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

verbose

indicates whether to output progress of preformatting.

Author

Mark Seligman at Suiji.

Examples

Run this code
  if (FALSE) {
    data(iris)
    pt <- PreFormat(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
    }
  }

Run the code above in your browser using DataLab