Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Mobile Communications

Authors: Jochen Schiller

2nd edition

978-0321123817, 321123816, 978-8131724262

More Books

Students also viewed these Programming questions

Question

an izod impact test was performed on 2 0 specimens of pvc pipe

Answered: 1 week ago