Answered step by step
Verified Expert Solution
Question
1 Approved Answer
This is related to Naive Bayes. The file UniversalBank.csv contains data on 10 customers of Universal Bank. The data include customer demographic information (age, income,
This is related to Naive Bayes.
The file UniversalBank.csv contains data on 10 customers of Universal Bank. The data include customer demographic information (age, income, etc.), the customer's relationship with the bank (mortgage, securities account, etc.), and the customer response to the last personal loan campaign (Personal Loan). 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). ID Online Credit Card Person Loan 1 0 0 0 2 0 1 3 0 1 1 1 1 1 5 0 1 0 6 1 0 1 7 1 0 0 8 1 1 9 1 1 1 10 1 0 1 1 4 0 Question 1. 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. Question 2. Compute the following quantities [P(AB) means the probability of A given B]: i. P(CC = 1|Loan = 1) (the proportion of credit card holders among the loan acceptors) 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) Question 3. Use the quantities computed above to compute the naive Bayes probability P(Loan = 1|CC = 1, Online = 1). The file UniversalBank.csv contains data on 10 customers of Universal Bank. The data include customer demographic information (age, income, etc.), the customer's relationship with the bank (mortgage, securities account, etc.), and the customer response to the last personal loan campaign (Personal Loan). 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). ID Online Credit Card Person Loan 1 0 0 0 2 0 1 3 0 1 1 1 1 1 5 0 1 0 6 1 0 1 7 1 0 0 8 1 1 9 1 1 1 10 1 0 1 1 4 0 Question 1. 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. Question 2. Compute the following quantities [P(AB) means the probability of A given B]: i. P(CC = 1|Loan = 1) (the proportion of credit card holders among the loan acceptors) 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) Question 3. Use the quantities computed above to compute the naive Bayes probability P(Loan = 1|CC = 1, Online = 1)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