Presented the data set as below.
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
|
Next we will calculate the distance between the second data with all the data in the table above. For that we take the second data from a table like this.
Sepal length
|
Sepal Width
|
Petal length
|
Petal Width
|
6.3
|
3.3
|
4.7
|
1.6
|
Let us calculate distance between two data with all data using cosine distance method using this formula.
1. Calculate second data distance with first data
2. Calculates second data distance with fifth data
After all data is calculated then got result like table below
Sepal length
|
Sepal Width
|
Petal length
|
Petal Width
|
Distance
|
5.5
|
2.3
|
4
|
1.3
|
53.09452
|
6.3
|
3.3
|
4.7
|
1.6
|
75.23
|
5.2
|
2.7
|
3.9
|
1.4
|
51.49649
|
6.1
|
2.9
|
4.7
|
1.4
|
69.60587
|
7.1
|
3
|
5.9
|
2.1
|
98.15019
|
6.5
|
3
|
5.9
|
2.1
|
89.85717
|
7.2
|
3.6
|
6.1
|
2.5
|
107.8565
|
5.8
|
2.8
|
5.1
|
2.4
|
72.61512
|
7.7
|
2.6
|
6.9
|
2.3
|
117.1933
|
5.6
|
2.8
|
4.9
|
2
|
66.87255
|
Tidak ada komentar:
Posting Komentar