Answered step by step
Verified Expert Solution
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 endofchapter 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 Import the training and scoring data sets for this exercise into data frames in RStudio. Ensure that the training data frames name is chTrain and the scoring data frames name is chScore.
Step Load the R library required to create a neural network model.
Step Use the following two commands to create data frames containing the normalized independent variable values for the training and scoring data sets.
chTrainNorm data.framescalechTrain:
chScoreNorm data.framescalechScore:
Step The independent variable values that were normalized using the scale function in step will be used to train the neural network model. Issue the command:
attachchTrainNorm
Step Set the seed value to
Step You will train a neural network model to predict the CreditRisk dependent variable in the chTrain data frame, using the independent variables in the normalized chTrainNorm data frame. The hidden layers size attribute is set to which uses the generally accepted formula:
independent variables dependent variable levels; which is
Issue the command:
chNNModel nnetasfactorchTrain$CreditRisk ~ CreditScoreLatePaymentsMonthsInJobDebtIncomeRatioLoanAmtLiquidAssetsNumCreditLines, datachTrainNorm, size maxit
Step Use the predict function to apply your neural network model chNNModel to the normalized scoring data frame chScoreNorm to predict CreditRisk classes for each observation. Store these predictions in a data frame with a relevant name.
Step Use the predict function to apply your neural network model chNNModel to the normalized scoring data frame chScoreNorm to predict CreditRisk confidence percentages postprobabilities for each observation. Store these predictions in a data frame with a relevant name.
Step Create a data frame with a relevant name that contains the step class predictions, the step confidence percentages, and the unnormalized scoring data chScore 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?
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?
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 Using this models predictions, how many highrisk applicants can have their loans approved by a manager?
Bookmark question for later
Normalizing the data has resulted in most confidence percentages being in this exercises predictions. However, not all predictions have confidence. How many predictions of high credit risk in this neural networks results are not
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?
Bookmark question for later
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started