| predict.hca | R Documentation |
Returns the cluster whose centre is closest, for a new dataset. A dendrogram says nothing about observations it was not built on, so the rule is the usual one: the clusters of the cut are summarised by their centres, and a new observation joins the nearest.
## S3 method for class 'hca'
predict(object, newdata, k = NULL, ...)
object |
The clustering (created by |
newdata |
A new dataset (a |
k |
The number of clusters the dendrogram is cut into. Defaults to the cut
|
... |
Other parameters. |
A vector of cluster numbers.
HCA, predict.kmeans
require (datasets)
data (iris)
d = splitdata (iris, 5)
model = HCA (d$train.x, k = 3, method = "ward")
table (predict (model, d$test.x), d$test.y)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.