Question:
This item requires the dataset UniversalBank.xls which can be found on the subject Interact site.The following is a business analytical problem faced by financial institutions and banks. The objective is to determine the measurements for personal loan acceptance.The dataset UniversalBank.xls contains data on 5000 customers of Universal Bank. The data include customer demographic information (age, income, etc.), the customer’s relationship with the bank (mortgage, securities account 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 this exercise we focus on two predictors.
Online (whether or not the customer is an active user of online banking services) and Credit Card (abbreviated CC below) (does the customer hold a credit card issued by the bank), and the outcome Personal Loan (abbreviated Loan below). Partition the data into training (60%) and validation (40%) sets. a. Create a pivot table for the training data with Online as a column variable, CC as a row variable, and Loan as a secondary row variable. The values inside the cells should convey the count (how many records are in that cell).
b. Consider the task of classifying a customer who owns a bank credit card and is actively using online banking services. Analyse the pivot table and calculate the probability that this customer will accept the loan offer. Note: This is the probability of loan acceptance (Loan=1) conditional on having a bank credit card (CC=1) and being an active user of online banking services (Online=1).
c. Design two separate pivot tables for the training data. One will have Loan (rows) as a function of Online (columns)
and the other will have Loan (rows) as a function of CC. Compute the following quantities [P(A | B) means “the probability of A given B”]:
i. P(CC=1 | Loan=1) (the proportion of credit card holders among the loan acceptors) 9/6/2017 interact.csu.edu.au/sakai-msi-tool/content/bbv.html?subjectView=true&siteId=ITC516_201760_SM_I
http://interact.csu.edu.au/sakai-msi-tool/content/bbv.html?subjectView=true&siteId=ITC516_201760_SM_I 2/2
ii. P(Online=1 | Loan=1)
iii. P(Loan=1) (the proportion of loan acceptors)
iv. P(CC=1 | Loan=0)
v. P(Online=1 | Loan=0)
vi. P(Loan=0)
d. Using the quantities computed in (c), compute the Naive Bayes probability P(Loan=1 | CC=1, Online=1).
e. Based on the calculations above, suggest the best possible strategy for the customer to get the loan.
Answer:
utility_name |
utility |
x1 |
x2 |
x3 |
x4 |
x5 |
x6 |
x7 |
Arizona |
1 |
1.06 |
9.2 |
151 |
54.4 |
1.6 |
9077 |
0 |
Boston |
2 |
0.89 |
10.3 |
202 |
57.9 |
2.2 |
5088 |
25.3 |
Central |
3 |
1.43 |
15.4 |
113 |
53 |
3.4 |
9212 |
0 |
Common |
4 |
1.02 |
11.2 |
168 |
56 |
0.3 |
6423 |
34.3 |
Consolid |
5 |
1.49 |
8.8 |
192 |
51.2 |
1 |
3300 |
15.6 |
Florida |
6 |
1.32 |
13.5 |
111 |
60 |
-2.2 |
11127 |
22.5 |
Hawaiian |
7 |
1.22 |
12.2 |
175 |
67.6 |
2.2 |
7642 |
0 |
Idaho |
8 |
1.1 |
9.2 |
245 |
57 |
3.3 |
13082 |
0 |
Kentucky |
9 |
1.34 |
13 |
168 |
60.4 |
7.2 |
8406 |
0 |
Madison |
10 |
1.12 |
12.4 |
197 |
53 |
2.7 |
6455 |
39.2 |
Nevada |
11 |
0.75 |
7.5 |
173 |
51.5 |
6.5 |
17441 |
0 |
NewEngla |
12 |
1.13 |
10.9 |
178 |
62 |
3.7 |
6154 |
0 |
Northern |
13 |
1.15 |
12.7 |
199 |
53.7 |
6.4 |
7179 |
50.2 |
Oklahoma |
14 |
1.09 |
12 |
96 |
49.8 |
1.4 |
9673 |
0 |
Pacific |
15 |
0.96 |
7.6 |
164 |
62.2 |
-0.1 |
6468 |
0.9 |
Puget |
16 |
1.16 |
9.9 |
252 |
56 |
9.2 |
15991 |
0 |
SanDiego |
17 |
0.76 |
6.4 |
136 |
61.9 |
9 |
5714 |
8.3 |
Southern |
18 |
1.05 |
12.6 |
150 |
56.7 |
2.7 |
10140 |
0 |
Texas |
19 |
1.16 |
11.7 |
104 |
54 |
-2.1 |
13507 |
0 |
Wisconsi |
20 |
1.2 |
11.8 |
148 |
59.9 |
3.5 |
7287 |
41.1 |
United |
21 |
1.04 |
8.6 |
204 |
61 |
3.5 |
6650 |
0 |
Virginia |
22 |
1.07 |
9.3 |
174 |
54.3 |
5.9 |
10093 |
26.6 |
Scores |
PatternComponent |
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
1 |
-0.14681 |
-0.70669 |
-0.75677 |
0.746348 |
-0.40144 |
-0.27811 |
-0.65496 |
-0.51257 |
2 |
1.077714 |
0.901811 |
0.997612 |
0.902638 |
0.104851 |
-0.43158 |
-0.21367 |
0.873982 |
3 |
-2.56795 |
0.28826 |
-0.76582 |
-1.06681 |
-0.37014 |
1.297427 |
-0.19554 |
0.325817 |
4 |
-0.71929 |
0.225861 |
1.054173 |
1.264202 |
0.423513 |
-0.69916 |
-0.26952 |
0.04484 |
5 |
-0.22515 |
1.852307 |
0.783558 |
-0.06193 |
-2.90996 |
0.115744 |
0.322883 |
-0.38728 |
6 |
-2.1641 |
1.189428 |
-0.85295 |
0.075487 |
0.681841 |
-0.5868 |
1.1804 |
-0.01879 |
7 |
0.469769 |
1.929283 |
-0.81214 |
-1.47625 |
0.994879 |
-0.62837 |
0.068106 |
0.085819 |
8 |
0.661049 |
-1.93032 |
0.097153 |
-0.90812 |
-0.29943 |
-1.59888 |
-0.40484 |
-0.26835 |
9 |
-0.46803 |
0.132706 |
-0.02153 |
-1.96018 |
0.506949 |
0.759626 |
-0.57081 |
-0.44338 |
10 |
-1.03749 |
-0.25632 |
2.001069 |
0.521806 |
-0.02076 |
-0.29226 |
-0.32322 |
0.322351 |
11 |
1.549026 |
-3.25469 |
-0.95497 |
0.854991 |
-0.07518 |
0.358497 |
0.606845 |
0.302978 |
12 |
1.022203 |
1.58695 |
-0.45779 |
-0.74948 |
0.016521 |
0.147105 |
-0.12064 |
0.378133 |
13 |
-0.88136 |
-0.64475 |
2.794535 |
0.036814 |
0.486605 |
0.415582 |
0.003814 |
0.049824 |
14 |
-1.75141 |
-0.87198 |
-1.19806 |
1.127915 |
-0.3573 |
0.825742 |
-0.63921 |
0.038565 |
15 |
1.420146 |
1.111869 |
-1.00231 |
0.888121 |
0.102005 |
-1.00218 |
-0.33612 |
-0.45045 |
16 |
1.148568 |
-2.67019 |
0.437914 |
-2.10617 |
-0.27087 |
-0.2002 |
0.298053 |
-0.02607 |
17 |
3.240586 |
0.733439 |
-0.32994 |
0.976614 |
0.77662 |
1.659772 |
-0.02112 |
-0.46544 |
18 |
-0.44848 |
-0.16647 |
-0.8535 |
-0.11825 |
0.330688 |
0.209125 |
-0.25597 |
0.692308 |
19 |
-1.93239 |
-0.73061 |
-1.91167 |
0.797673 |
-0.03147 |
-0.52232 |
0.310062 |
-0.11621 |
20 |
-0.93865 |
0.514652 |
1.293427 |
0.227153 |
1.146288 |
0.034353 |
0.311918 |
-0.75316 |
21 |
2.08224 |
1.323621 |
-0.35397 |
-0.33871 |
-0.56149 |
-0.23258 |
0.132563 |
0.408149 |
22 |
0.609819 |
-0.55817 |
0.811969 |
0.366143 |
-0.27271 |
0.649468 |
0.770989 |
-0.08108 |
Principal Components |
FeatureComponent |
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
x1 |
-0.44555 |
0.232177 |
0.067128 |
-0.5555 |
-0.40084 |
0.00654 |
0.205782 |
-0.48108 |
x2 |
-0.57119 |
0.100535 |
0.071234 |
-0.3321 |
0.335942 |
0.13326 |
-0.15027 |
0.628551 |
x3 |
0.348691 |
-0.1613 |
0.467331 |
-0.40908 |
-0.26857 |
-0.5375 |
-0.11763 |
0.302943 |
x4 |
0.288901 |
0.409184 |
-0.1426 |
-0.33374 |
0.680071 |
-0.2989 |
0.064293 |
-0.24782 |
x5 |
0.355361 |
-0.28293 |
0.281464 |
-0.3914 |
0.162637 |
0.71917 |
-0.05155 |
-0.12223 |
x6 |
-0.05383 |
-0.60309 |
-0.33199 |
-0.19087 |
0.131972 |
-0.14953 |
0.660502 |
0.103396 |
x7 |
-0.16797 |
0.085361 |
0.737684 |
0.333487 |
0.249646 |
-0.02644 |
0.488792 |
-0.08467 |
x8 |
0.33584 |
0.539885 |
-0.13442 |
-0.0396 |
-0.29267 |
0.252353 |
0.489147 |
0.43301 |
Variances |
|
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
Variance |
2.172946 |
1.900267 |
1.323475 |
0.996743 |
0.64902 |
0.571659 |
0.216503 |
0.169386 |
Variance Percentage |
27.16183 |
23.75334 |
16.54343 |
12.45929 |
8.112755 |
7.145739 |
2.706288 |
2.11733 |
Cumulative Variance % |
27.16183 |
50.91517 |
67.4586 |
79.91789 |
88.03064 |
95.17638 |
97.88267 |
100 |