spark.kmeans {SparkR}R Documentation

Fit a k-means model

Description

Fit a k-means model, similarly to R's kmeans().

Usage

spark.kmeans(data, formula, ...)

## S4 method for signature 'SparkDataFrame,formula'
spark.kmeans(data, formula, k,
  maxIter = 10, initMode = c("random", "k-means||"))

Arguments

data

SparkDataFrame for training

formula

A symbolic description of the model to be fitted. Currently only a few formula operators are supported, including '~', '.', ':', '+', and '-'. Note that the response variable of formula is empty in spark.kmeans.

k

Number of centers

maxIter

Maximum iteration number

initMode

The initialization algorithm choosen to fit the model

Value

A fitted k-means model

Examples

## Not run: 
##D model <- spark.kmeans(data, ~ ., k=2, initMode="random")
## End(Not run)

[Package SparkR version 2.0.0 Index]