Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

The data sets used for this end - of - chapter exercise will need to be normalized in order to create a neural network that

The data sets used for this end-of-chapter exercise will need to be normalized in order to create a neural network that can produce reliable predictions. This will be accomplished using the scale() function in R, which has not been covered in the text. The modifications to ensure that nnet() produces usable results will therefore be prescribed in the following steps. Complete each step and then answer the exercise questions below.
Step 1. Import the training and scoring data sets for this exercise into data frames in RStudio. Ensure that the training data frames name is ch11Train and the scoring data frames name is ch11Score.
Step 2. Load the R library required to create a neural network model.
Step 3. Use the following two commands to create data frames containing the normalized independent variable values for the training and scoring data sets.
ch11TrainNorm <- data.frame(scale(ch11Train[2:8]))
ch11ScoreNorm <- data.frame(scale(ch11Score[2:8]))
Step 4. The independent variable values that were normalized using the scale() function in step 3 will be used to train the neural network model. Issue the command:
attach(ch11TrainNorm)
Step 5. Set the seed value to 43.
Step 6. You will train a neural network model to predict the Credit_Risk dependent variable in the ch11Train data frame, using the independent variables in the normalized ch11TrainNorm data frame. The hidden layers size attribute is set to 7, which uses the generally accepted formula:
((7 independent variables +5 dependent variable levels)/2)+1; which is (12/2)+1=7
Issue the command:
ch11NNModel <- nnet(as.factor(ch11Train$Credit_Risk) ~ Credit_Score+Late_Payments+Months_In_Job+Debt_Income_Ratio+Loan_Amt+Liquid_Assets+Num_Credit_Lines, data=ch11TrainNorm, size=7, maxit=1000)
Step 7. Use the predict() function to apply your neural network model (ch11NNModel) to the normalized scoring data frame (ch11ScoreNorm) to predict Credit_Risk classes for each observation. Store these predictions in a data frame with a relevant name.
Step 8. Use the predict() function to apply your neural network model (ch11NNModel) to the normalized scoring data frame (ch11ScoreNorm) to predict Credit_Risk confidence percentages (post-probabilities) for each observation. Store these predictions in a data frame with a relevant name.
Step 9. Create a data frame with a relevant name that contains the step 7 class predictions, the step 8 confidence percentages, and the unnormalized scoring data (ch11Score). View this data frame in RStudio, then answer the following questions.
Using the neural networks predictions as generated using the steps outlined in this exercise, how many loan applicants will have their loans denied? 23
162
79
11
23
Bookmark question for later
Using the neural networks predictions as generated using the steps outlined in this exercise, and assuming that loan officers can automatically approve all loans predicted to be low or very low risk, how many loans will be automatically approved by loan officers? 142
142
16
114
126
Bookmark question for later
The bank has a policy that a manager can approve a loan for an applicant who is predicted to be high risk, but only if that applicants moderate risk prediction is greater than 30%. Using this models predictions, how many high-risk applicants can have their loans approved by a manager?
12
2
0
3
Bookmark question for later
Normalizing the data has resulted in most confidence percentages being 100% in this exercises predictions. However, not all predictions have 100% confidence. How many predictions of high credit risk in this neural networks results are not 100%?
77
12
2
79
Bookmark question for later
Based on the predictions generated by this model for this scoring data, what is the lowest credit score a person could have and still achieve a classification of Low?
710
700
662
650
Bookmark question for later

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

Students also viewed these Databases questions

Question

RP-5 What happens in the synaptic gap?

Answered: 1 week ago

Question

Describe the seven standard parts of a letter.

Answered: 1 week ago

Question

Explain how to develop effective Internet-based messages.

Answered: 1 week ago

Question

Identify the advantages and disadvantages of written messages.

Answered: 1 week ago