Question: IN PYTHON ONLY For this case, you need to apply the decision rules and cutoff probability of 0 . 5 from Section to classify the

IN PYTHON ONLY
For this case, you need to apply the decision rules and cutoff probability of 0.5 from Section
to classify the two loans in Table 10 of the articleShould This Loan be Approved or Denied?: A Large Dataset with Class Assignment Guidelines
as higher risk or lower risk for loan approval by writing Python code to reproduce results (not format) in Tables 7(a),8,9 of this article using the SBA case data SBAcase.11.13.17.csv. The variable Selected indicates which observations are the training data and which are the testing data (1= training data to be used to build the model, 0= testing data to validate the model). Partition the data using this variable.
Ignore parts a b, c and d.
(e) For the California-based example, the final model with the risk indicators in Table 8 is used to estimate the probability of default for the two loan applications. Use Python to predict the probability of default for Carmichael Realty (Loan 1) and SV Consulting (Loan 2). Applying the decision rules and cutoff probability of 0.5 from Section 4.3
Links to an external site.
, how should these two loans be classified as, lower risk (approve) or higher risk (deny)?
(f) The default cutoff value of 0.5 is used in conjunction with the probability of default. Compute the threshold that should be used if we want to make a classification based on the odds of default, and the threshold for the corresponding logit.
(g) When a higher riskmore likely to default loan is misclassified as lower riskmore likely to pay in full loan, the misclassification cost is much higher than when a lower riskmore likely to pay in full loan is misclassified as higher riskmore likely to default. To minimize the expected cost of misclassification, should the cutoff value for classification (which is currently at 0.5) be increased or decreased?
(h) Review Python documentation: sklearn.linear_model.LogisticRegression
Links to an external site.
and example code from the class.Fit a logistic regression model to reproduce results (not format) in Tables 7(a),8,9 of this article using the SBA case data SBAcase.11.13.17.csv by using (1) sklearn LogisticRegression() liblinear solver and (2) sklearn LogisticRegression() Default Solver 'lbfgs'. Adjust parameters such as "penalty" and "tol" as needed.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!