June 2017
Beginner to intermediate
576 pages
15h 22m
English
Since you have the coefficients, you could actually predict the cluster membership manually via code. You would probably want to do this if you were implementing cluster assignment in a production environment. However, it is easier to use a predict method.
Let's fit the model first to the training data. We can print out some of the fitted values just to see what was generated. The last column indicates the cluster assignment for that observation:
fitted <- predict(model, df_normal)SparkR:::registerTempTable(fitted,"fitted_tbl")head(fitted)
