Skip to main content

Command Palette

Search for a command to run...

K - medoid algorithm

Published
•1 min read•View as Markdown
V

Greetings! I'm Vishnu Vinay, a Computer Science and Engineering graduate holding a B. Tech degree. Currently immersed in the captivating world of Artificial Intelligence, I am on a quest for knowledge while pursuing a graduate certificate in Artificial Intelligence with Machine Learning. My passion lies in sharing insights and discoveries in the fields of AI, Machine Learning, Artificial General Intelligence, and Robotics through engaging blog posts. Proficient in Python, ML libraries, and algorithms, I find joy in developing and deploying ML models, with a focus on leveraging AWS Sagemaker. Join me on this exciting journey of unraveling the mysteries of AI through the lens of coding, exploration, and the ever-evolving landscape of machine learning. Let's embark on this knowledge-sharing adventure together!

  • Unsupervised learning algorithm

  • Similar to K-means with some changes which are mentioned below:

    1. Make an actual point in data as medoid (center of a cluster) i.e., Medoid is an example point in the cluster while mean might not be an actual data point.

    2. Use L1 score (Manhattan distance) instead of L2 score (Squared Euclidean distance). Manhattan distance = |x1 - y1| + |x2 - y2| + ... + |xn - yn|.

Steps:-

  1. Select k random medoids.

  2. Assign each data point to one of the clusters depending upon their distance to the medoids.

  3. Find replacements for the current medoids.

    • For finding a new medoid we would take the replacement of a point within the cluster.

    • Replacement is found by taking a random point from a cluster and checking if the overall clustering cost is lesser than the previous point’s cost.

    • Finding the manhattan distance between all the points from all the clusters and the replacement point.

  4. Repeat step 2 for a maximum number of iterations.

More from this blog

Untitled Publication

31 posts