Skip to content

Instantly share code, notes, and snippets.

@briverse17
Created December 23, 2019 16:14
Show Gist options
  • Save briverse17/c04b86eaf7a3aeceaa529726738c799f to your computer and use it in GitHub Desktop.
Save briverse17/c04b86eaf7a3aeceaa529726738c799f to your computer and use it in GitHub Desktop.
def initMedoids(self, X):
'''
Parameters
----------
X: input data.
'''
self.medoids = []
#Starting medoids will be random members from data set X
indexes = np.random.randint(0, len(X)-1,self.k)
self.medoids = X[indexes]
for i in range(0,self.k):
self.medoids_cost.append(0)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment