predict.dkmeans: distributed predict method for a kmeans model

Description Usage Arguments Details Value Author(s) Examples

View source: R/dkmeans.R

Description

This function finds cluster label of a set of samples according to a given set of centers specified in the model object.

Usage

1
2
## S3 method for class 'dkmeans'
predict(object, newdata, trace=FALSE, ...)

Arguments

object

an object returned by dkmeans function

newdata

a darray (dense or sparse) or a matrix which contains the samples.

trace

when this argument is true, intermediate steps of the progress are displayed.

...

additional arguments to be passed (None are supported).

Details

This function applies the centers found by dkmeans on a new set of samples in order to label them.

Value

This function returns a darray or a matrix based on the type of newdata which contains the corresponding label of each sample.

Author(s)

Vishrut Gupta, Arash Fard

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
 ## Not run: 
    iris2 <- iris
    iris2$Species <- NULL

    library(kmeans.ddR)

    X <- as.darray(data.matrix(iris2))

    mykm <- dkmeans(X,centers=3)

    newdata <- matrix(c(5,4,3,5,7,1,0,8),2,4)
    labels <- predict(mykm,newdata)
 
## End(Not run)

kmeans.ddR documentation built on May 29, 2017, 6:09 p.m.