as.kmeans: Conversion of a RevoScaleR rxKmeans object to a kmeans Object

Description

Converts objects containing RevoScaleR-computed k-means clusters to an R kmeans object.

Usage

 ## S3 method for class `rxKmeans':
as.kmeans  (x, ...)

Arguments

x

object of class "rxKmeans".

...

additional arguments (currently not used).

Details

This function converts an existing object of class "rxKmeans" an object of class "kmeans". The underlying structure of the output object will be a subset of that produced by an equivalent call to kmeans. Often, this method can be used to coerce an object for use with the pmml package. RevoScaleR model objects that contain transforms or a transformFunc are not supported.

Value

an object of class "kmeans".

Author(s)

Microsoft Corporation Microsoft Technical Support

See Also

as.lm, as.glm, as.rpart, as.xtabs, rxKmeans.

Examples


 ## Not run:

# If the pmml package is installed 
library(pmml)
form <- ~ height + weight
set.seed(17)
irow <- unique(sample.int(nrow(women), 4L, replace = TRUE))[seq(2)]
centers <- women[irow,, drop = FALSE]
rxKmeansObj <- rxKmeans(form, data = women, centers = centers)
pmml(as.kmeans(rxKmeansObj))
## End(Not run)