Predict Credit Risk using Binary Classification -Part 3 of 3

This is a 3 part Blog Series

  1. Part 1 of 3 – Predict Credit Risk using Binary Classification (First Post)
  2. Part 2 of 3 – Predict Credit Risk using Binary Classification (Second Post)
  3. Part 3 of 3 – Predict Credit Risk using Binary Classification (This Post)

Moving forward with the next steps in our experiment , lets add a custom R script

Step 1  Now add the “Train Model” Modules to the canvas and connect them with previously added algorithms as shown in the image below, you are required to choose Credit Risk as column name as we need to predict Credit Risk.

7.PNG


Step 2 Now add the Score Model modules , by providing output from Train Model and then from other part of previously splitted data which was passed to “R Module”.

8.PNG


Step 3  Now we need to add the Evaluate Model module as shown below

9.PNG


Step 4 Now we need to combine all the results of both module of “Evalute Model” , for this we need to add “Add Rows” module, after adding rows add a “Execure R Script” Module and add the following R script in to it.

10

R Script

# Map 1-based optional input ports to variables# Map 1-based optional input ports to variablesdataset <- maml.mapInputPort(1)
a <- matrix(c("SVM","weighted",           "SVM","unweighted",   "Boosted Decision Tree","weighted",   "Boosted Decision Tree","unweighted"), nrow=4,ncol=2,byrow=T)data.set <- cbind(a,dataset) names(data.set)[1:2] <- c("Algorithm","Training")
maml.mapOutputPort("data.set")


Step 5 Now add Select Column Module to select specific columns as shown below

we have selected Algorithm, Training, Accuracy columns to analyse output and then click on “Run

11

Now click on the output node of last module you just added and click on visualize

12.PNG

Finally you can now compare the result of multiple algorithms with different accuracy.

13.PNG


 

 

This is a 3 part Blog Series

  1. Part 1 of 3 – Predict Credit Risk using Binary Classification (First Post)
  2. Part 2 of 3 – Predict Credit Risk using Binary Classification (Second Post)
  3. Part 3 of 3 – Predict Credit Risk using Binary Classification (This Post)

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.