Skip to content

Instantly share code, notes, and snippets.

@briverse17
Created December 23, 2019 16:10
Show Gist options
  • Save briverse17/3810f5d339470ab12ff3d58ad256c15f to your computer and use it in GitHub Desktop.
Save briverse17/3810f5d339470ab12ff3d58ad256c15f to your computer and use it in GitHub Desktop.
class k_medoids:
def __init__(self, k = 2, max_iter = 300, has_converged = False):
'''
Class constructor
Parameters
----------
- k: number of clusters.
- max_iter: number of times centroids will move
- has_converged: to check if the algorithm stop or not
'''
self.k = k
self.max_iter = max_iter
self.has_converged = has_converged
self.medoids_cost = []
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment