predict.pkbc | R Documentation |
Obtain predictions of membership for spherical observations based on a
mixture of Poisson kernel-based densities estimated by pkbc
## S4 method for signature 'pkbc'
predict(object, k, newdata = NULL)
object |
Object of class |
k |
Number of clusters to be used. |
newdata |
a data.frame or a matrix of the data. If missing the
clustering data obtained from the |
Returns a list with the following components
Memb: vector of predicted memberships of newdata
Probs: matrix where entry (i,j) denotes the probability that observation i belongs to the k-th cluster.
pkbc()
for the clustering algorithm
pkbc for the class object definition.
# generate data
dat <- rbind(matrix(rnorm(100), ncol = 2), matrix(rnorm(100, 5), ncol = 2))
res <- pkbc(dat, 2)
# extract membership of dat
predict(res, k = 2)
# predict membership of new data
newdat <- rbind(matrix(rnorm(10), ncol = 2), matrix(rnorm(10, 5), ncol = 2))
predict(res, k = 2, newdat)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.