Learn R Programming

BayesTreePrior (version 1.0.1)

GetListUniqueSplits: Unique splits that leads to children with more than $minpart$ nodes.

Description

Unique splits that leads to children with more than $minpart$ nodes.

Usage

GetListUniqueSplits(x, minpart = 1, MIA = FALSE)

Arguments

x
vector containing the observations of a variable.
minpart
minimum number of observations in the children nodes.
MIA
set to TRUE if you want Missing Incorporated in Attributes (MIA) imputation to be used.

Value

If $MIA$ is TRUE and $minpart>1$, the possible splits could be different depending on whether we transfer the NAs to the left child or the right child; if this is the case then the function returns a list $(v1,v2)$, where $v1$ is the vector containing the unique splits that leads to $minpart$ nodes when transferring the NAs to the left child and $v2$ is the vector containing the unique splits that leads to children with more than $minpart$ nodes when transferring the NAs to the left child. Otherwise, it returns the vector containing the unique splits that leads to children with more than $minpart$ nodes.

Examples

Run this code
GetListUniqueSplits(c(1,4,7,3,0,2,2,3,4,7,7,7),minpart=1)
GetListUniqueSplits(c(1,4,7,3,0,2,2,3,4,7,7,7),minpart=3)
GetListUniqueSplits(c(1,4,7,3,0,2,2,3,4,7,7,7,NA,NA,NA),minpart=1, MIA=TRUE)
GetListUniqueSplits(c(1,4,7,3,0,2,2,3,4,7,7,7,NA,NA,NA),minpart=3, MIA=TRUE)

Run the code above in your browser using DataLab