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
Get step-by-step solutions from verified subject matter experts
