plot.ranktree {ConsRankClass}R Documentation

Plot tree-based structure or pruning sequence of ranktree

Description

Plot the tree coming from the ranktree or the pruning sequence of the ranktree

Usage

## S3 method for class 'ranktree'
plot(
  x,
  plot.type = "tree",
  dispclass = FALSE,
  valtree = NULL,
  taos = TRUE,
  ...
)

Arguments

x

An object of the class "ranktree"

plot.type

One among "tree" or "pruningseq"

dispclass

Display the median ranking above terminal nodes. Default option: FALSE

valtree

If plot.type="pruningseq", it shows the Tau_x rank correlation coefficient or the error along the pruning sequence on the training set. If valtree is the output of the function validatetree, it shows either the Tau_x rank correlation coefficient or the error along the pruning sequence of also the decision tree (validated by wither test set or cross-validation)

taos

If plot.type="pruningseq", it plots the Tau_x rank correlation coefficient along the pruning sequence. If taos=FALSE, it plots the error.

...

System reserved (No specific usage)

Value

the plot of either the tree or the pruning sequence

Author(s)

Antonio D'Ambrosio antdambr@unina.it

See Also

ranktree, validatetree

Examples

data("Univranks")
tree <- ranktree(Univranks$rankings,Univranks$predictors,num=50)
plot(tree,dispclass=TRUE)
  

data(EVS)
EVS$rankings[is.na(EVS$rankings)] <- 3
set.seed(654)
training=sample(1911,1434)
tree <- ranktree(EVS$rankings[training,],EVS$predictors[training,],decrmin=0.001,num=50)
plot(tree,dispclass=TRUE)
#test set validation
vtreetest <- validatetree(tree,testX=EVS$predictors[-training,],EVS$rankings[-training,]) 
dtree <- getsubtree(tree,vtreetest$best_tau)
plot(dtree,dispclass=TRUE)
#see the global weigthted tau_X rank correlation coefficients
plot(tree,plot.type="pruningseq",valtree=vtreetest)
#see the error rates
plot(tree,plot.type="pruningseq",valtree=vtreetest, taos=FALSE)



[Package ConsRankClass version 1.0.0 Index]