AI Glossary / AI and machine learning / Intermediate

Medoid

Definition

A medoid is an actual member of a group of observations chosen to minimize the total dissimilarity to the other members. It provides a representative example of the group and is used in clustering methods such as k-medoids.

What it means

A group can be summarized by a numerical average, but that average may not correspond to anything that actually exists. The average of several customer profiles might describe no real customer. A medoid, by definition, is selected from the observed items.

The choice depends on the dissimilarity measure. That measure might be a geometric distance, a difference between sequences or a carefully designed comparison between records. Change the measure and the most representative member may change.

A medoid is not necessarily the most frequent item, the highest-quality item or the item nearest an arithmetic mean. It is representative according to a particular sum-of-dissimilarities objective.

How it works

For each candidate member, calculate its dissimilarity to every member of the group and add those values. A member with the smallest total is a medoid. More than one member can tie.

In k-medoids clustering, the task is to select several medoids and assign observations to them so that the overall assignment cost is small. Algorithms search for good choices without necessarily enumerating every possible combination.

The ability to work with a dissimilarity matrix is useful when a meaningful numerical average is unavailable. However, constructing and storing pairwise dissimilarities can become expensive for large collections, and the quality of the measure remains crucial.

Three practical examples

  • A support team selects a real ticket that represents a cluster of similar requests for an analyst to read.
  • A product-research team chooses representative survey records using a suitable mixed-data dissimilarity measure.
  • A time-series project selects an observed pattern as a cluster representative when an arithmetic average would distort the shape.

Think of it this way

Think of choosing one attendee whose travel location is collectively convenient to the rest of a group. The chosen location must belong to an actual attendee, rather than being an imaginary point between towns.

The analogy captures representation and total distance. It does not mean the medoid is fairest for every person: minimizing the total can still leave one member very far away.

Worked example

Selecting an observed representative

Consider the values 1, 2, 3, 4 and 20. Use absolute difference as dissimilarity. The total distance from 1 is 1 + 2 + 3 + 19 = 25. From 2 it is 1 + 1 + 2 + 18 = 22.

From 3 the total is 2 + 1 + 1 + 17 = 21. From 4 it is 3 + 2 + 1 + 16 = 22. From 20 it is 19 + 18 + 17 + 16 = 70.

The medoid is therefore 3, with the smallest total of 21. The arithmetic mean is 30 divided by 5, or 6, which is not an observed value.

This example also shows why a medoid can be less influenced by an extreme observation than the mean. It does not prove immunity to outliers in every dataset or under every dissimilarity measure.

Illustrative case study

Fictional case: reviewing recurring support issues

Linden Devices, an invented manufacturer, has a collection of support tickets represented by text embeddings. Analysts cluster similar tickets and inspect each cluster's medoid as a starting example.

One representative ticket is easy to understand but omits an uncommon safety-related complaint elsewhere in the cluster. The team therefore reviews both representative and unusual tickets, rather than treating the medoid as a complete description.

The case illustrates efficient orientation and its limits. It makes no claim about a real manufacturer's service results, and it does not suggest that a representative example can replace review of consequential exceptions.

Common misconceptions and mistakes

A medoid and a centroid are different concepts: a medoid is an observed member, while a centroid is often an average in a numerical space. A medoid need not be unique.

Calling it robust does not mean that bad data or a poor distance measure cannot affect it. Nor does a representative member show the full diversity, minority patterns or extremes within its group.

Business use

Medoids are useful when decision makers need a concrete example they can inspect, explain or act on. They can support dataset summarization, customer research, ticket analysis and prototype selection.

Choose the dissimilarity measure with the business purpose in mind, and check that preprocessing does not allow one feature to dominate unintentionally. Report cluster size and spread alongside the representative. For large datasets, compare scalable approximations with a smaller exact benchmark. Where rare cases matter, inspect them separately: a method optimizing overall representativeness can naturally underemphasize exceptional but important observations.

People also ask

Must a medoid appear in the dataset?

Yes, it is selected from the observed members.

Can two observations both be medoids?

Yes, equal minimum total dissimilarity can produce a tie.

Is k-medoids always better than k-means?

No. Their objectives, computational costs and suitability for the data differ.

Check your understanding

A summary profile is created by averaging all customer ages and spending amounts, but no customer has that profile. Is it a medoid?

Answer: No. A medoid must be an actual observation selected using the chosen dissimilarity objective. An average profile is a different kind of summary.

Related terms

  • Centroid
  • Clustering
  • Outlier
  • K-medoids
  • dissimilarity matrix
  • representative sampling

Learn next

Learn next how feature scaling changes distances and cluster representatives. Then compare a medoid, a mean and an outlier within the same small group to see which aspects of the data each summary preserves.

  • Outlier

More in AI and machine learning

  • MAUVE (metric) - MAUVE is a measure for comparing two collections of generated and reference examples, developed for evaluating open-ended text generation.
  • Maximum inner-product search - Maximum inner-product search is the task of finding the stored vector with the largest dot product with a query vector.
  • Means - ends analysis - Means - ends analysis is a problem-solving strategy that compares the current situation with a desired goal, identifies an important difference and chooses...
  • Memory map - A memory map is a file-access technique where a file on disk is mapped directly into a program's address space, so the program reads and writes it like...
  • Meta-learning - Meta-learning, often called learning to learn, is training a model on many tasks so it adapts to a new task from very few examples, rather than starting...
  • Meta-optimization - Meta-optimization is the use of an optimization process to improve the configuration or behavior of another optimization process.

Sources

Primary implementation documentation: scikit-learn-extra KMedoids, https://scikit-learn-extra.readthedocs.io/en/latest/generated/sklearn_extra.cluster.KMedoids.html ; source, https://github.com/scikit-learn-contrib/scikit-learn-extra . Relevant official documentation on observed medoids, distance objectives and memory use was consulted; independent editorial review is recorded, without publication approval. Calculation and fictional case are original.

Previous: Mediation (statistics) Next: Mega-Merger

  • Home
  • Daily AI Updates
  • Blog
  • AIFBL Academy
  • AI Glossary
  • Products and Tools
  • Store
  • Free CFO AI Prompt Pack
  • About Shihan Sheriff
  • Privacy Policy
  • Terms of Use
  • Refund Policy
  • Cookie Policy
  • Earnings Disclaimer