make_dtree: Make dtree

Description Usage Arguments Details Examples

Description

Make a dtree from one of two constructors:

Usage

1
2
make_dtree(nodeIds, leftChildIds, rightChildIds, splitVars = NULL,
  splitVals = NULL, data = NULL)

Arguments

nodeIds

A vector of node Ids

leftChildIds

A vector of left-child node Ids

rightChildIds

A vector of right-child node Ids

parentNodeIds

A vector of parent node Ids

Details

Returns a dtree object

Examples

1
2
3
4
5
library(data.table)

make_dtree(nodeIds=c(1), leftChildIds=c(NA_integer_), rightChildIds=c(NA_integer_))
make_dtree(nodeIds=c(1), leftChildIds=c(2), rightChildIds=c(3), splitVars=c("foo"), splitVals=c(3.5))
make_dtree(nodeIds=c(1,2,3), leftChildIds=c(2,NA,NA), rightChildIds=c(3,NA,NA), splitVars=c("foo",NA,NA), splitVals=c(3.5,NA,NA))

ben519/btree documentation built on May 12, 2019, 10:56 a.m.