Question: Question 2 Supervised learning models The following dataset contains some data points with 3 features x1, x2, x3 and a labely.Apply kNN to predict the

Question 2 Supervised learning models

  1. The following dataset contains some data points with 3 features x1, x2, x3 and a labely.Apply kNN to predict the label of the query point(10,4,4)usingk =3.Show your work including the calculated distances(in 2 decimal places)of the data points to the query point, their respective ranks, the k nearest neighbours, and the prediction result.
Data point x1 x2 x3 y
#1 15 2 2 6.3
#2 4 8 11 4.0
#3 12 6 8 9.3
#4 4 2 7 3.5
#5 8 8 2 4.5
#6 11 4 7 6.9
#7 10 11 -1 8.3
  1. The following dataset contains the same features x1, x2, x3 as in part (a)above, but the label y is categorical (classes P and Q) instead of numerical. Apply kNN to predict the label of the query point (10, 4, 4) using k = 3, and show the predicted result.
Data point x1 x2 x3 y
#1 15 2 2 P
#2 4 8 11 Q
#3 12 6 8 P
#4 4 2 7 P
#5 8 8 2 Q
#6 11 4 7 Q
#7 10 11 -1 P
  1. Thefollowing dataset containssome example dataitems with 3categorical features

x1 (classesAandB),x2(classes C andD),x3(classes E, FandG)andalabely

(classes P, Q, andR). Apply the ID3 algorithm to builda decision tree. Show your work including the calculated entropy values, the information gain values, and the resulting decision tree. In case of a tie, select the first of the candidate features for splitting. Use 4 decimal places for floating-point numbers. [15]

Example # x1 x2 x3 y
#1 A C E P
#2 A C F P
#3 A C G Q
#4 A D E R
#5 A D F P
#6 A D G Q
#7 B C E P
#8 B C F R
#9 B C G Q
#10 B D E R
#11 B D F R

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!