Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

pmml.kmeans

Generate the PMML representation for a kmeans object from the package stats.


Description

The kmeans object (a cluster described by k centroids) is converted into a PMML representation.

Usage

## S3 method for class 'kmeans'
pmml(
  model,
  model_name = "KMeans_Model",
  app_name = "SoftwareAG PMML Generator",
  description = "KMeans cluster model",
  copyright = NULL,
  transforms = NULL,
  missing_value_replacement = NULL,
  algorithm_name = "KMeans: Hartigan and Wong",
  ...
)

Arguments

model

A kmeans object.

model_name

A name to be given to the PMML model.

app_name

The name of the application that generated the PMML.

description

A descriptive text for the Header element of the PMML.

copyright

The copyright notice for the model.

transforms

Data transformations.

missing_value_replacement

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.

Details

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 transforms so that the normalization information is included in PMML.

Author(s)

Graham Williams

References

Examples

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)
cl_pmml <- pmml(cl)

pmml

Generate PMML for Various Models

v2.4.0
GPL-3 | file LICENSE
Authors
Dmitriy Bolotov [aut, cre], Tridivesh Jena [aut], Graham Williams [aut], Wen-Ching Lin [aut], Michael Hahsler [aut], Hemant Ishwaran [aut], Udaya B. Kogalur [aut], Rajarshi Guha [aut], Software AG [cph]
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.