Back to Blog

Guilty by Association: The Neighborhood Watch

May 10, 2026 · 2 min read
Guilty by Association: The Neighborhood Watch - Understanding K-Nearest Neighbours: How AI identifies the unknown by looking at its closest neighbors in the mental map.

In the agency, we have a saying: you are who you sit with. If we can’t see your passport, we’ll just look at your neighbors.

The Scenario

Imagine you are a counter-intelligence officer in a crowded airport lounge. You see a man sitting alone, reading a newspaper. He has no luggage, no ID, and no obvious affiliation. Is he a tourist, or a courier?

To find out, you don’t look at him—you look at the people around him. Within a three-meter radius, there are five other people.

You run their faces through the database:

  • Person 1: Known associate of a rival agency.
  • Person 2: Undercover courier from the Eastern bloc.
  • Person 3: A civilian tourist.
  • Person 4: A black-market arms dealer.
  • Person 5: Another known rival agent.

Four out of the five “neighbors” are high-risk targets. The logic is simple: if you are surrounded by sharks, you probably aren’t a goldfish. This is K-NEAREST NEIGHBOURS (KNN). You classify the unknown by looking at the majority of its closest neighbors in the field.

The Reality

K-Nearest Neighbours is one of the simplest and most intuitive algorithms in AI. It doesn’t build a complex “rulebook.” Instead, it plots every piece of data on a massive mental map. When a new, unknown piece of data arrives, the algorithm simply looks for the “K” closest existing points.

If you set K=5 and four of those five points are labeled “Fraudulent Transaction,” the algorithm flags the new data as fraud. It assumes that similar things live in the same neighborhood.

The Why

KNN is powerful because it requires no “training” in the traditional sense—it just remembers everything. It’s perfect for situations where the rules are constantly changing but the “neighborhoods” remain consistent. It’s the “Guilty by Association” rule turned into a mathematical formula.

The Takeaway

K-Nearest Neighbours identifies the unknown by looking at who its closest neighbors are. You are the company you keep.


AI specialists call it: K-Nearest Neighbours (KNN) K-Nearest Neighbours is a non-parametric, supervised learning classifier, which uses proximity to make classifications or predictions about the grouping of an individual data point.

💬 If an AI looked at your five closest friends today, what “Label” would it give you?

Part 21 (K-Nearest Neighbours) of 25 | #DeepLearningForHumans

Have a project in mind?

Let's talk about how we can help.

Got a project idea? →