cancel
Showing results for 
Search instead for 
Did you mean: 
Machine Learning
cancel
Showing results for 
Search instead for 
Did you mean: 

How to input initial centroids to K-Means or GMM Clustering in SparkML ?

HariK1
New Contributor II

Hi, I want to use KMeans Model or Gaussian Mixture Model algorithm for clustering using the SparkML library, in which I want to specify the initial centroids. The option of giving initial centroids is there in the Spark MLlib (RDD based APIs) however not available in the Pyspark DataFrame based APIs (SparkML). Since Spark MLlib is in the maintenance mode, I do not want to use it and instead use SaprkML library. Is anyone knows a workaround? Thank You.

3 REPLIES 3

Kaniz
Community Manager
Community Manager

HI @Hari Manassery Koduvely​, This page describes clustering algorithms in MLlib. The guide for clustering in the RDD-based API also has relevant information about these algorithms.

HariK1
New Contributor II

Hi @Kaniz Fatma​ , thanks for your response. Since MLlib is currently in the maintenance mode we don't want to use it in production and hence want to use SparkML (data frame based APIs). Here is the problem. In SparkML libraries there is no mention of how to input user specified centroids for K-Means or GMM. That was my question.

HariK1
New Contributor II

@Kaniz Fatma​ I still haven't got an answer to my question!!!

Welcome to Databricks Community: Lets learn, network and celebrate together

Join our fast-growing data practitioner and expert community of 80K+ members, ready to discover, help and collaborate together while making meaningful connections. 

Click here to register and join today! 

Engage in exciting technical discussions, join a group with your peers and meet our Featured Members.