Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Step 2 . Load the R library required to create a neural network model. Step 3 . Use the following two commands to create data

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?
162
79
11
23

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

Recommended Textbook for

More Books

Students also viewed these Databases questions

Question

What are the use cases for data warehousing and RDBMS?

Answered: 1 week ago