Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Unfortunately the error message is still there when I run this line ( p_cc_given_loan = len(cc_loan_acceptors) / len(train_data[train_data['Loan'] == 1]) ZeroDivisionError: division by zero Can

Unfortunately the error message is still there when I run this line ( p_cc_given_loan = len(cc_loan_acceptors) / len(train_data[train_data['Loan'] == 1])

ZeroDivisionError: division by zero

Can you explain more ????

This is your Explanation:

Approach to solving the question:

To compute the requested probabilities, we need to manipulate the train_data DataFrame. Specifically, we need to filter it to select the relevant subsets, and then compute the proportions by dividing the lengths of these subsets by the lengths of other subsets.

For example, to compute P(CC = 1 | Loan = 1),

  1. We first filter the DataFrame to select the rows where Loan = 1 and CCAvg > 0.
  2. We then compute the proportion of these rows relative to the rows where Loan = 1.
  3. We do the same thing for P(Online = 1 | Loan = 1), P(CC = 1 | Loan = 0), P(Online = 1 | Loan = 0), and P(Loan = 1).
  4. To compute P(Loan = 0), we simply count the number of rows where Loan = 0 and divide it by the total number of rows in the data frame.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Intermediate Accounting

Authors: Donald E. Kieso, Jerry J. Weygandt, And Terry D. Warfield

13th Edition

9780470374948, 470423684, 470374942, 978-0470423684

More Books

Students also viewed these Accounting questions

Question

1. Describe the growth of location-based services and commerce.

Answered: 1 week ago