samplefrompool: Function to sample from a set of partitioning rules

Description Usage Arguments Value Examples

View source: R/SDPSyn.R

Description

Function to sample from a set of partitioning rules

Usage

1
samplefrompool(y, terminalnodes, newterminalnodes)

Arguments

y

a vector of values to pull from

terminalnodes

a vector of terminal nodes

newterminalnodes:

a path to save the graph

Value

a vector of the same size than terminalnodes, obtained by sampling betweenn the values of y such for the same terminal node.

Examples

1
2
3
4
5
6
y=iris$Species;x=iris[,-5];fit.mod<-fitmodel.ctree(x,y);terminalnodes<-getnodesfromrules(x,fit.mod$Rules);
newterminalnodes<-sample(unique(terminalnodes),10,replace=TRUE);
samplefrompool(y,terminalnodes,newterminalnodes)
y<-y[terminalnodes!=7]
terminalnodes<-terminalnodes[terminalnodes!=7]
samplefrompool(y,terminalnodes,newterminalnodes)

DanielBonnery/BigSyn documentation built on June 28, 2020, 7:18 p.m.