K nearest neighbor and bayes’ theorem (anwer needs in 3 hours)

 

1. Data on the amount of the customers’ shopping by using an account card and whether they decided to upgrade their account from silver status to platinum status after receiving the upgrade offer is shown in Table 2.

a. Construct the k nearest neighbor scheme for predicting upgrades based on the data given in Table 2, and interpret the confusion matrix.

2. The data are given in part 1 estimate the probability of upgrade for each division of the purchase amount using Bayes’ theorem