Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
0% found this document useful (0 votes)
6 views

KNN Algorithm

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as XLSX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
6 views

KNN Algorithm

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as XLSX, PDF, TXT or read online on Scribd
You are on page 1/ 15

KNN - algorithm, supervised, classifications.

height weight result


160cm 2kg malnourished height
160m 50kg healthy 127
126cm 30kg healthy 182
130cm 60kg malnourished 126
173
172
174
169
170
weight result
51 Under
62 Normal
69 Normal
64 Normal
65 Normal
56 Under
58 Normal 1.414214
57 ?
7.62
8.25
4.12
1.41
Instance Sepal Length Sepal Width Petal Length Petal Width Variety Distance Sorted Distances
1 5.4 3.4 1.7 0.2 Setosa 2.74 #NAME?
2 6.1 3 4.9 1.8 Virginica 1.00 #NAME?
3 5.1 2.5 3 1.1 Versicolor 1.44 #NAME?
4 6.5 2.8 4.6 1.5 Versicolor 0.96 #NAME?
5 6.4 2.7 5.3 1.9 Virginica 1.51 #NAME?
6 5.4 3.4 1.5 0.4 Setosa 2.86 #NAME?
7 5 2.3 3.3 1 Versicolor 1.35 #NAME?
8 6.8 3.2 5.9 2.3 Virginica 2.31 #NAME?
9 5.7 3 4.2 1.2 ?
10 6.7 3.3 5.7 2.1 ?

K = 3 AND K = 5

Instance Sepal Length Sepal Width Petal Length Petal Width Variety Distance Sorted Distances
1 5.4 3.4 1.7 0.2 Setosa 4.62 #NAME?
2 6.1 3 4.9 1.8 Virginica 1.09 #NAME?
3 5.1 2.5 3 1.1 Versicolor 3.39 #NAME?
4 6.5 2.8 4.6 1.5 Versicolor 1.36 #NAME?
5 6.4 2.7 5.3 1.9 Virginica 0.81 #NAME?
6 5.4 3.4 1.5 0.4 Setosa 4.71 #NAME?
7 5 2.3 3.3 1 Versicolor 3.30 #NAME?
8 6.8 3.2 5.9 2.3 Virginica 0.32 #NAME?
9 5.7 3 4.2 1.2 ?
10 6.7 3.3 5.7 2.1 ?
Neighbor Class Class Count Class Count K=3 K=5
Versicolor Setosa 0 Setosa 0 Versicolor Versicolor
Virginica Versicolor 2 Versicolor 2
Versicolor Virginica 1 Virginica 1
Versicolor
Virginica

Neighbor Class Class Count Class Count K=3 K=5


Virginica Setosa 0 Setosa 0 Virginica Virginica
Virginica Versicolor 0 Versicolor 2
Virginica Virginica 3 Virginica 3
Versicolor
Versicolor
Instance Height Weight Age Target Distance Sorted Distances Neighbor Class Class Count
1 2.1 3.5 1.8 Apple 1.82 #NAME? Cherry Apple 1
2 1.2 0.7 2.2 Banana 3.07 #NAME? Apple Banana 0
3 3.3 4.4 3.1 Apple 1.52 #NAME? Cherry Cherry 1
4 2.2 2 1.7 Banana 1.97 #NAME? Apple
5 1.9 3.2 2 Cherry 1.72 #NAME? Apple
6 3 4 2.7 Apple 1.21 #NAME?
7 0.9 1.1 0.6 Banana 3.85 #NAME?
8 2.4 2.8 2.3 Cherry 1.14 #NAME?
9 1.8 2.2 1.9 Apple 1.97 #NAME?
10 2.5 3 3 Cherry 0.64 #NAME?
11 1 1.2 1 Banana 3.48 #NAME?
12 2.6 3.6 3 Apple 0.88 #NAME?
13 3.1 2.9 3.2 ?
14 1.5 1.7 1.4 ?
15 2.7 3.4 2.9 ?
16 1.3 2.5 2.2 ?
17 3.2 4.1 3.3 ?
Class Count K = 3 K = 5
Apple 3 Apple Apple
Banana 0
Cherry 1
Instance Height Weight Age Target Distance Sorted Distances Neighbor Class Class Count
1 2.1 3.5 1.8 Apple 1.94 #NAME? Apple Apple 1
2 1.2 0.7 2.2 Banana 1.32 #NAME? Banana Banana 3
3 3.3 4.4 3.1 Apple 3.66 #NAME? Banana Cherry 0
4 2.2 2 1.7 Banana 0.82 #NAME? Banana
5 1.9 3.2 2 Cherry 1.66 #NAME? Banana
6 3 4 2.7 Apple 3.04 #NAME?
7 0.9 1.1 0.6 Banana 1.17 #NAME?
8 2.4 2.8 2.3 Cherry 1.68 #NAME?
9 1.8 2.2 1.9 Apple 0.77 #NAME?
10 2.5 3 3 Cherry 2.29 #NAME?
11 1 1.2 1 Banana 0.81 #NAME?
12 2.6 3.6 3 Apple 2.72 #NAME?
13 3.1 2.9 3.2 ?
14 1.5 1.7 1.4 ?
15 2.7 3.4 2.9 ?
16 1.3 2.5 2.2 ?
17 3.2 4.1 3.3 ?
Class Count K = 3 K=5
Apple 1 Banana Banana
Banana 4
Cherry 0
Instance Height Weight Age Target Distance
Sorted Distances
Neighbor Class Class Count
1 2.1 3.5 1.8 Apple 1.26 #NAME? Apple Apple 2
2 1.2 0.7 2.2 Banana 3.17 #NAME? Cherry Banana 0
3 3.3 4.4 3.1 Apple 1.18 #NAME? Apple Cherry 1
4 2.2 2 1.7 Banana 1.91 #NAME? Cherry
5 1.9 3.2 2 Cherry 1.22 #NAME? Apple
6 3 4 2.7 Apple 0.70 #NAME?
7 0.9 1.1 0.6 Banana 3.72 #NAME?
8 2.4 2.8 2.3 Cherry 0.90 #NAME?
9 1.8 2.2 1.9 Apple 1.80 #NAME?
10 2.5 3 3 Cherry 0.46 #NAME?
11 1 1.2 1 Banana 3.37 #NAME?
12 2.6 3.6 3 Apple 0.24 #NAME?
13 3.1 2.9 3.2 ?
14 1.5 1.7 1.4 ?
15 2.7 3.4 2.9 ?
16 1.3 2.5 2.2 ?
17 3.2 4.1 3.3 ?
Class Count K=3 K=5
Apple 3 Apple Apple
Banana 0
Cherry 1
Instance Height Weight Age Target Distance
Sorted Distances
Neighbor Class Class Count
1 2.1 3.5 1.8 Apple 1.34 #NAME? Apple Apple 1
2 1.2 0.7 2.2 Banana 1.80 #NAME? Cherry Banana 1
3 3.3 4.4 3.1 Apple 2.90 #NAME? Cherry Cherry 1
4 2.2 2 1.7 Banana 1.14 #NAME? Banana
5 1.9 3.2 2 Cherry 0.94 #NAME? Apple
6 3 4 2.7 Apple 2.32 #NAME?
7 0.9 1.1 0.6 Banana 2.16 #NAME?
8 2.4 2.8 2.3 Cherry 1.14 #NAME?
9 1.8 2.2 1.9 Apple 0.66 #NAME?
10 2.5 3 3 Cherry 1.53 #NAME?
11 1 1.2 1 Banana 1.79 #NAME?
12 2.6 3.6 3 Apple 1.88 #NAME?
13 3.1 2.9 3.2 ?
14 1.5 1.7 1.4 ?
15 2.7 3.4 2.9 ?
16 1.3 2.5 2.2 ?
17 3.2 4.1 3.3 ?
Class Count K=3 K=5
Apple 2 Apple Apple
Banana 1
Cherry 1
Instance Height Weight Age Target Distance
Sorted Distances
Neighbor Class Class Count
1 2.1 3.5 1.8 Apple 1.95 #NAME? Apple Apple 3
2 1.2 0.7 2.2 Banana 4.10 #NAME? Apple Banana 0
3 3.3 4.4 3.1 Apple 0.37 #NAME? Apple Cherry 2
4 2.2 2 1.7 Banana 2.82 #NAME? Cherry
5 1.9 3.2 2 Cherry 2.05 #NAME? Cherry
6 3 4 2.7 Apple 0.64 #NAME?
7 0.9 1.1 0.6 Banana 4.65 #NAME?
8 2.4 2.8 2.3 Cherry 1.82 #NAME?
9 1.8 2.2 1.9 Apple 2.74 #NAME?
10 2.5 3 3 Cherry 1.34 #NAME?
11 1 1.2 1 Banana 4.31 #NAME?
12 2.6 3.6 3 Apple 0.84 #NAME?
13 3.1 2.9 3.2 ?
14 1.5 1.7 1.4 ?
15 2.7 3.4 2.9 ?
16 1.3 2.5 2.2 ?
17 3.2 4.1 3.3 ?
Class Count K=3 K=5
Apple 3 Apple Apple
Banana 0
Cherry 2

You might also like