pmml.kmeans {pmml} | R Documentation |
Generate the PMML representation for a kmeans object (cluster) from package stats. The kmeans object (a cluster described by k centroids) is converted into a PMML representation.
## S3 method for class 'kmeans' pmml(model, model.name="KMeans_Model", app.name="Rattle/PMML", description="KMeans cluster model", copyright=NULL, transforms=NULL, unknownValue=NULL, algorithm.name="KMeans: Hartigan and Wong", ...)
model |
a kmeans object. |
model.name |
a name to be given to the model in the PMML code. |
app.name |
the name of the application that generated the PMML code. |
description |
a descriptive text for the Header element of the PMML code. |
copyright |
the copyright notice for the model. |
transforms |
data transformations represented in PMML via package pmmlTransformations. |
unknownValue |
value to be used as the 'missingValueReplacement' attribute for all MiningFields. |
algorithm.name |
the variety of kmeans used. |
... |
further arguments passed to or from other methods. |
A kmeans object is obtained by applying the kmeans
function from the stats
package. This method typically requires the user to normalize all the variables, these
operations can be done using the pmmlTransformations
package so that the normalization
information is included in the pmml model format.
R project: K-Means Clustering
http://stat.ethz.ch/R-manual/R-devel/library/stats/html/kmeans.html
ds <- rbind(matrix(rnorm(100, sd = 0.3), ncol = 2), matrix(rnorm(100, mean = 1, sd = 0.3), ncol = 2)) colnames(ds) <- c("Dimension1", "Dimension2") cl <- kmeans(ds, 2) pmml(cl)