Nearest Neighbour Coding Challenge. Euclidean Distance.


The notes above are from a couple days ago when Simon was trying to explain to me, where the formula for calculating similarity s = 1/1+c comes from. He linked it to the Euclidean distance formula and explained how Eucledean distance is related to the Pythagorean theorem.


The similarity formula comes from the Nearest Neighbour Recommendation Engine Coding Challenge by Daniel Shiffman that Simon was doing.  the coding challenge was about creating a movie recommendation engine using the a “nearest neighbor” algorithm and thus calculating a similarity score between two data points.

Here Simon explains how that code works:


One Reply to “Nearest Neighbour Coding Challenge. Euclidean Distance.”

  1. (Didn’t watch the entire coding challenge video, but guessing…) since there are ten variables that need to be compared in the coding challenge, it’s a bit like finding the distance between two points in a 10D (think 2D + eight more dimensions) space. The variables on the right side of the equation might be z, y, x, w, v, u, v, t, s, r in this case. But it still works the same, basically.

    Liked by 2 people

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s