PreFormat.default: Preformatting for Training with Warm Starts

Description Usage Arguments Value Author(s) Examples

View source: R/PreFormat.default.R

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

1
2
## Default S3 method:
PreFormat(x, verbose)

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.

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.

Author(s)

Mark Seligman at Suiji.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
  ## Not run: 
    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
    }
  
## End(Not run)

Rborist documentation built on Nov. 1, 2019, 7:45 p.m.