spark.kmeans {SparkR} | R Documentation |
Fit a k-means model, similarly to R's kmeans().
spark.kmeans(data, formula, ...) ## S4 method for signature 'SparkDataFrame,formula' spark.kmeans(data, formula, k, maxIter = 10, initMode = c("random", "k-means||"))
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 |
A fitted k-means model
## Not run:
##D model <- spark.kmeans(data, ~ ., k=2, initMode="random")
## End(Not run)