代做Continual Assessment 4 Fall 2023代写Python编程

- 首页 >> OS编程
 

Continual Assessment 4

Fall 2023

Instructions: (1) Python Codes, (2) Printed Output (3) Answers to questions are REQUIRED TO BE SUBMITTED TO EARN FULL SCORES. Please ensure I can open your file to see the codes and output. Make sure to answer all the questions.

Share your Google Colab Notebook via Gmail.

You can refer to lecture notes, homework, and all Python codes available on Canvas.

Question 1

· What proportion of loans in lending_club_loan data are defaulted?

· What proportion of loans in lending_club_loan data are not defaulted?

Question 2: Refer to the data dictionary

· Provide the hypothesized relationships between “default” and all the explanatory variables.

· Write 1-2 sentences to explain the hypothesized relationships

Y= ‘default’

X = loan_amnt

       term_months

       installment

       High_grade

       rent_dummy

 annual_inc

       dti

       open_acc

       pub_rec

 revol_bal

 revol_util

 total_acc

 mort_acc

 pub_rec_bankruptcies

Question 3

· Estimate a logistic regression (based on the model in Question 2).

· Create and complete the following table:

Variable Name

Hypothesized Relationship

Regression Result Relationship

Consistent (Yes)

Counter Intuitive (No)

Statistical Significance Yes/No

(p value < 5%)

(p value < 0.05)

Variable 1

+/-

+/-

Yes/No

Yes/No

Question 4

· What is the logistic regression classifier accuracy?

· What is logistic regression confusion matrix (label matrix with Actual and Predicted, 0 and 1)

· What is the logistic regression 0 and 1 model precision and recall information?

· What is the AUC score of this model ( 2 decimal place)

Question 5

· Estimate a decision tree model with tree depth of 3

· What is the decision tree model classifier accuracy?

· What is the decision tree model confusion matrix (label matrix with Actual and Predicted, 0 and 1).

· What is the precision and recall information of the decision tree 0 and 1 model?

· What is the decision tree AUC score of this model ( 2 decimal places)

     Question 6

· What is the KNN model classifier accuracy?

· What is the KNN model confusion matrix (label matrix with Actual and Predicted, 0 and 1).

· What is the KNN 0 and 1 model precision and recall information?

· What is the KNN AUC score of this model ( 2 decimal places)

     Question 7

· Based on precision = 1 and recall=1, which model performs the best?

· Create a table and compare

 

Precision = 1 percentage

Recall = 1 percentage

Logistic (GLM)

?

?

Decision Tree

?

?

KNN

?

?







站长地图