Question: CODE in R , using universalbank.csv (https://github.com/gchoi/Dataset/blob/master/UniversalBank.csv) The file UniversalBank.csv contains data on 5000 customers. The data include customer demographic information (age, income, etc.), the

CODE in R , using universalbank.csv (https://github.com/gchoi/Dataset/blob/master/UniversalBank.csv)

The file UniversalBank.csv contains data on 5000 customers. The data include customer demographic information (age, income, etc.), the customers relationship with the bank (mortgage, securities account, etc.), and the customer response to the last personal loan campaign (Personal Loan). Among these 5000 customers, only 480 (= 9.6%) accepted the personal loan that was offered to them in the earlier campaign.

In R, perform the following steps as discussed in Ch06 on the data.

Step 2: Exploring data, rescaling data, creating training and test datasets (Remove zipcode, create dummies for education. Rescaling the data. Create training partition (60%) and testing partition (40%) with randomized partitioning. Set a seed so the results can be reproduced. What is the percentage of customers who accepted the personal loan? How about this percentage in training and testing partitions, respectively?)

Step 3: Training a model on the data (Use the function knn() from the class package for the kNN algorithm. Try with any initial number for k. Remember use all dummy variables for knn and ignore customer id as part of predictors.)

Step 4: Evaluating model performance (Evaluate the model performance with confusion matrix. Identify accuracy, sensitivity, and specificity.)

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