Question: 2)** `KNN` algorithm to classify the earners (` 50K`, low/high) for High-earners in the 1994 United States Census data above. Select only the quantitative variables

2)** `KNN` algorithm to classify the earners (`<=50K, >50K`, low/high) for High-earners in the 1994 United States Census data above. Select only the quantitative variables `age,education.num, capital.gain, capital.loss, hours.per.week`. Use `cl=train$income` and `k=1`(use the closest neighbor) in the `knn` argumnts. Print the confusion matrix. State the accuracy.

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 Mathematics Questions!