https://github.com/cran/PPCI
Tip revision: 20aefc9955133b9d3a2f3ea6366edd542e26701d authored by David Hofmeyr on 16 February 2018, 12:43:08 UTC
version 0.1.1
version 0.1.1
Tip revision: 20aefc9
tree_prune.Rd
\name{tree_prune}
\alias{tree_prune}
\title{Prune a Hierarchical Clustering Model}
\description{
Removes the subtree rooted at the specified node from a hierarchical clustering model generated by one of mcdc, mddc and ncutdc.
}
\usage{
tree_prune(sol, node)
}
\arguments{
\item{sol}{a clustering solution arising from one of the functions mcdc, mddc and ncutdc.}
\item{node}{the node at which to prune the hierarchy. can be either an integer specifying the node number in sol$nodes or a vector of length two specifying c(depth, position at depth) of the node.}
}
\value{
a list with the same components as sol.
}
\examples{
## load the optidigits dataset
data(optidigits)
## cluster using minimum normalised cut hyperplanes,
## assuming no domain knowledge begin with 12 clusters
sol <- ncutdc(optidigits$x, 12)
## the node numbered 11 has been split,
## yet it appears there may not be multiple clusters present.
## inspect this node more closely
node_plot(sol, 11)
## remove this node from the model
sol_new <- tree_prune(sol, 11)
## compare the solutions using external cluster validity metrics
cluster_performance(sol$cluster, optidigits$c)
cluster_performance(sol_new$cluster, optidigits$c)
}
\keyword{file}
