Senin, 10 April 2023

Data Set (Distance (manhattan))

Data Set (Distance (manhattan))
In this post I will give an example of calculating the distance using the manhattan distance.

I have 2 pieces of data.

This data consists of X data and Y data.

Data X consists of = 5, 3, 1, 0, 1

Data Y consists of = 1, 0, 3, 4, 2


We will calculate the data using the Manhattan distance.
The formula we will use is :


To perform the following calculations :


The explanation is:


  • 5 = is the first number of data X
  • 1 = is the first number of data Y
  • So the formula is X's first data minus Y's first data and so on


So the next calculation is like this:


So, the distance between the two data using the manhattan distance is 0

Notes :
  • Calculating the distance using Manhattan, the final result must be absolute
  • If the final result is -1, then the absolute value is 1

Tidak ada komentar:

Posting Komentar