Rborist (version 0.3-7)

preformat: Preformatting for Training with Warm Starts

Description

Presorts and formats training frame into a form suitable for subsequent training by rfArb caller or rfTrain command. Wraps this form to spare unnecessary recomputation when iteratively retraining, for example, under parameter sweep.

Usage

# S3 method for default
preformat(x,
                   verbose=FALSE,
                   ...)

Value

an object of class Deframe consisting of:

  • rleFrame run-length encoded representation of class RLEFrame consisting of:

    • rankedFrame run-length encoded representation of class RankedFrame consisting of:

      • nRow the number of observations encoded.

      • runVal the run-length encoded values.

      • runRow the corresponding row indices.

      • rleHeight the number of encodings, per predictor.

      • topIdx the accumulated end index, per predictor.

    • numRanked packed representation of sorted numerical values of class NumRanked consisting of:

      • numVal distinct numerical values.

      • numHeight value offset per predictor.

    • facRanked packed representation of sorted factor values of class FacRanked consisting of:

      • facVal distinct factor values, zero-based.

      • facHeight value offset per predictor.

  • nRow the number of training observations.

  • signature an object of type Signature consisting of:

    • predForm predictor class names.

    • level per-predictor levels, regardless whether realized.

    • factor per-predictor realized levels.

    • colNames predictor names.

    • rowNames observation names.

Arguments

x

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

verbose

indicates whether to output progress of preformatting.

...

unused.

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