Question: Please implement in Matlab (or any other software) the K-nearest neighbor algorithm. More particularly, please implement the algorithm for K=1,K=2,K=3,K=4,K=5,K=6,K=7. Use the data from the

Please implement in Matlab (or any other software) the K-nearest neighbor algorithm. More particularly, please implement the algorithm for K=1,K=2,K=3,K=4,K=5,K=6,K=7. Use the data from the table given below. For training set you will take the first 9 entries of the class "owner" and the first 9 entries of the class "nonowner". For testing set you will take the last 3 entries of the class "owner" and the last 3 entries of the class "nonowner". Note: There are two classes in the data. ( 1= owner, 2= non-owner), and two features (variables) x1=income, x2 = Lot_Size You have to submit your code as well the result for the six test points [to what class the algorithm classifies the datapoint Vs. the real class the datapoint belongs to]
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
