Description Usage Arguments Value Examples
Function to sample from a set of partitioning rules
1 | samplefrompool(y, terminalnodes, newterminalnodes)
|
y |
a vector of values to pull from |
terminalnodes |
a vector of terminal nodes |
newterminalnodes: |
a path to save the graph |
a vector of the same size than terminalnodes, obtained by sampling betweenn the values of y such for the same terminal node.
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)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.