fitted: Get fitted result from a k-means model

Description Usage Arguments Value Note Examples

Description

Get fitted result from a k-means model, similarly to R's fitted(). Note: A saved-loaded model does not support this method.

Usage

1
2
3
4
fitted(object, ...)

## S4 method for signature 'KMeansModel'
fitted(object, method = c("centers", "classes"))

Arguments

object

a fitted k-means model.

...

additional argument(s) passed to the method.

method

type of fitted results, "centers" for cluster centers or "classes" for assigned classes.

Value

fitted returns a SparkDataFrame containing fitted values.

Note

fitted since 2.0.0

Examples

1
2
3
4
5
6
## Not run: 
model <- spark.kmeans(trainingData, ~ ., 2)
fitted.model <- fitted(model)
showDF(fitted.model)

## End(Not run)

SparkR documentation built on June 3, 2021, 5:05 p.m.