Minggu, 06 Agustus 2017

Manhattan Distance Example

Post an article today about an example of calculating the distance between data points with other data points using the Manhattan distance method. If you want to know the definition and other things related to this distance method please read my article about "List Calculation of distance between data points".

Here. You are given a data set in tabular form like this.

Sepal length
Sepal Width
Petal length
Petal Width
5.5
2.3
4
1.3
6.3
3.3
4.7
1.6
5.2
2.7
3.9
1.4
6.1
2.9
4.7
1.4
7.1
3
5.9
2.1
6.5
3
5.9
2.1
7.2
3.6
6.1
2.5
5.8
2.8
5.1
2.4
7.7
2.6
6.9
2.3
5.6
2.8
4.9
2
















We will measure the distance between the six data with all the data in the table above. Below I prepare the sixth data.

Sepal length
Sepal Width
Petal length
Petal Width
6.5
3
5.9
2.1





Let us calculate the distance between the six data with all the data available using the formula.



1. Calculate the first data distance with the sixth data


2. Calculation of the second data distance with the sixth data


With the same way we can calculate the distance of other data so that after the whole process of calculating the distance between the six data with all the data then obtained the results as the table below.

Sepal length
Sepal Width
Petal length
Petal Width
Distance
5.5
2.3
4
1.3
4.4
6.3
3.3
4.7
1.6
2.2
5.2
2.7
3.9
1.4
4.3
6.1
2.9
4.7
1.4
2.4
7.1
3
5.9
2.1
0.6
6.5
3
5.9
2.1
0
7.2
3.6
6.1
2.5
1.9
5.8
2.8
5.1
2.4
2
7.7
2.6
6.9
2.3
2.8
5.6
2.8
4.9
2
2.2

Tidak ada komentar:

Posting Komentar