a nearest neighbor pruning using neighborhood graphs.
prune(x, classes, prox = "Gabriel", ignore.ties = TRUE, ...)
a data matrix.
a vector of class labels.
type of proximity graph.
do not prune if there is a tie vote.
arguments passed to the proximity graph.
A list with attributes:
the pruned data.
the indices of the retained data.
the proximity graph.
First a proximity graph is computed on the data. Then points are marked if their neighbors have a different class than they do: if the most common class among the neighbors is different than the point. Then all marked points are removed.