Edgar Pino

Draft

Types Of Distance Measures

December 18, 2021

I’ve been exploring a few different types of distance measures in machine learning and their differences. This is a short post about that. I’m going to define what a distance measure is and some of the popular ones you might encounter.

What is a distance measure?

A distance measure is simple and almost requires no definition. They are simply a way to calculate the similarity between 2 data points. Yes, that’s it!

You may have used k-nearest neighbors algorithm. It’s method of prediction on a new sample is by calculating the distance between the new data point and all existing data points on the training dataset.

Differences Types of Disatnce Measures

Let’s go over 3 of the distance measures I thought were interesting and why.

Manhattan Distance

Hamming Distance

Euclidean Distance


Edgar Pino

Sr. Machine Learning Engineer @Pluralsight. Interested in distributed systems, machine learning, and the web. Follow me on Twitter.