Now that the data is normalized, we can move on to model building.
SparkR contains a k-means model which is very similar in syntax to the base k-means model. There is an additional parameter, InitMode, in which you can specify that a random seed be generated for generating the starting cluster. As of this version of SparkR, you cannot manually set a seed. Therefore, be aware that the clusters generated may be slightly different each time the model is run.
Additionally, you can specify the outcome variable (glucose) as well as the variables to be clustered, so that you can evaluate the fit of the cluster model.
For illustration purposes, we will generate a model of five clusters.
Use summary(model) to display the ...