Test: Create a Candidate Split Object

Description Usage Arguments Format Details Value Fields Methods Author(s) Examples

Description

Test is a class of R6. It is the candicate split of a node. Named by Amir Saffari 's paper.

Usage

1
Test$new(xvar.index, xvar.value, numClasses = 0)

Arguments

xvar.index

A integer indicates which x variable is used to split.

xvar.value

A numeric indicates what value of the chosen x variable is used to split. Means: x[xvar.index] < xvar.value.

numClasses

A nonnegative integer indicates how many classes when solve a classifation problem. Default 0 for regression. If numClasses > 0, then do classifation.

Format

R6Class object.

Details

Note that Test may only be seen in leaf nodes of an ORT tree. See details in description of each field or method.

Value

Object of R6Class, Object of Candidate Split.

Fields

statsL

A SuffStats object in left hand of a split.

statsR

A SuffStats object in right hand of a split.

Methods

update(x, y)

When a sample comes in current node, update ORT with the sample's x variables and y value.

  • x - The x variables of a sample. Note it is an numeric vector other than a scalar.

  • y - The y value of a sample.

Author(s)

Quan Gu

Examples

1
2
3
4
5
6
t1 <- Test$new(3, 2.2, 0)
t1$update(c(0,0,2,4), 1.2)
t1$update(c(0,0,1,4), 1.4)
t1$update(c(1,1,3,3), 2.7)
t1$statsL$pred()
t1$statsR$pred()

ZJUguquan/OnlineRandomForest documentation built on May 20, 2019, 2:57 p.m.