You are given the following five three-dimensional training data instances (along with one- dimensional output)
• x1 = 5, x2 = 7, x3 = 3, y = 4
• x1 = 2, x2 = 4, x3 = 9, y = 8
• x1 = 3, x2 = 8, x3 = 1, y = 2
• x1 = 7, x2 = 7, x3 = 2, y = 3
• x1 = 1, x2 = 9, x3 = 7, y = 8
Using the K-nearest neighbour technique for performing regression, what will be the predicted y value corresponding to the query point
(x1 = 5, x2 = 3, x3 = 4), for K = 2?
For the dataset given above, what will be the predicted y value corresponding to the query point (x1 = 5, x2 = 3, x3 = 4),
for K = 3?
Answers
Answered by
1
Answer:
1) y = 3.5
2) y = 5
Explanation:
1) When K = 2, the nearest points are x1 = 5, x2 = 3, x3 = 4 and k = 2. Taking the average of
the outputs of these two points, we have y = (4 + 3)/2 = 3.5.
2) Similarly, when k = 3, we additionally consider the point x1 = 5, x2 = 3, x3 = 4 to get output,
y = (4 + 3 + 8)/3 = 5.
Have a good day : )
Answered by
0
Answer:
y-2.5
y-2.33
Explanation:
When K = 2,
the closest points are x1 = 2, x2 = 5 and x1 = 6, x2 = 7.
Taking the common of the outputs of those two points,
y = (2 + 3)/2 = 2.5.
when K = 3,
consider the purpose x1 = 6, x2 = 3 to urge output,
y = (2 + 3 + 2)/3 = 2.33.
#SPJ3
Similar questions