Question: IN PYTHON ONLY For this case, you need to apply the decision rules and cutoff probability of 0 . 5 from Section 4 . 3
IN PYTHON ONLY
For this case, you need to apply the decision rules and cutoff probability of from Section
Links to an external site.
to classify the two loans in Table of the articleShould This Loan be Approved or Denied?: A Large Dataset with Class Assignment Guidelines
Links to an external site.
Links to an external site.
as higher risk or lower risk for loan approval by writing Python code to reproduce results not format in Tables a of this article using the SBA case data SBAcasecsv The variable Selected indicates which observations are the training data and which are the testing data training data to be used to build the model, testing data to validate the model Partition the data using this variable.
a Review Python documentation: statsmodels
Links to an external site.
and example code from the class.Fit a logistic regression model to reproduce results not format in Tables a of this article using the SBA case data SBAcasecsv by using STATMODELS smglm or smfglm
The logit model produces an estimated probability of being a Classify as if this estimated probability cutoff, egThe following code from Table in the example code may be helpful to perform this classification:
logit smGLMtrainy trainX familysmfamilies.Binomial
result logitfit
predictions result.predictvalidX
predictionsnominal if x else for x in predictions
logitresult pdDataFrameactual: validy
p: predictions,
p: predictions,
predicted: predictionsnominal
b Refer to Table of the article. Write the estimated equation that associates the outcome variable ie default or not with predictors RealEstate, Portion, and Recession, in three formats:
i The logit as a function of the predictors see of DMBA Chapter
ii The odds as a function of the predictors see of DMBA Chapter
iii The probability as a function of the predictors see of DMBA Chapter
c Explain why risk indicators in Table were selected using pvalues in Table a
d Interpret parameter coefficient estimates of the model in Table with a focus on the odds of default. Answer the following questions by interpreting parameter estimates of the model in Table and specifying odds and probabilities of default for these risk indicators.
i Is a loan backed by real estate more likely or less likely to default by how much Explain using parameter estimates.
ii Is a loan active during recession more likely or less likely to default by how much Explain using parameter estimates.
iii How much does the portion of a loan guaranteed by SBA increase or decrease the likelihood of default? Explain using parameter estimates.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
