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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started