In the previous sections, we saw how to cluster the similar houses together to determine the neighborhood. Using GMM, it is also possible to cluster the houses toward finding the neighborhood except the model training that takes different training parameters as follows:
val K = 5 val maxIteration = 20 val model = new GaussianMixture() .setK(K)// Number of desired clusters .setMaxIterations(maxIteration)//Maximum iterations .setConvergenceTol(0.05) // Convergence tolerance. .setSeed(12345) // setting seed to disallow randomness .run(landRDD) // fit the model using the training set
You should refer to the previous example and just reuse the previous steps of getting the trained data. Now ...