Description Usage Arguments Value Examples
Predict cluster memberships for new data by locating points closest to the mediods of a a clustering procedure. Distance between mediod and newdata is based on the Gower's general similarity coefficient, which applies to mix-type data.
1 2 |
object |
object of class |
org.data |
(optional) the original data used to generate the mediods. |
newdata |
A new input data frame. |
... |
Further arguments passed to mix.dist. |
clustering for new data
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 | ## Not run:
set.seed(12345)
data(iris)
dat <- iris[, -5]
RF.dist <- RFdist(data=dat, ntree = 10, no.rep=20, syn.type = "permute",
importance=FALSE)
# run hclust
HCmod <- hclust(d=RF.dist$RFdist, method="ward.D2", members= NULL)
clusters <- cutree(HCmod, 3)
# get mediods of clustering
med <- mediod(x = RF.dist$RFdist, clusters=clusters, fun = "sum")
print(med)
# predict clusters
pred.clusters <- predict(object= med, org.data = dat, newdata = dat)
table(clusters, pred.clusters)
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.