Predict Credit Risk using Binary Classification -Part 2 of 3

This is a 3 part Blog Series

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

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

Step 1

1.PNG

You can add following code in your R Script- This R script will replicate positive training examples.


# Map 1-based optional input ports to variables


dataset <- maml.mapInputPort(1)

data.set <- dataset[dataset[,21]==1,]
pos <- dataset[dataset[,21]==2,]
for (i in 1:5) data.set <- rbind(data.set,pos)
row.names(data.set) <- NULL
maml.mapOutputPort("data.set")


Now add another R Script for the other part of data set , divided by split data module.

Same R Code as shown above will be applicable to this new “Execute R Script” module

2


Step 2

Now we will add 3 “Normalize Data” Modules as as shown below

4.PNG

You can exclude Credit Risk Column by launching Column Selector as shown below

3.PNG


Step 3

Now the most important step , we need to wisely choose the correct algorithm to train our model(s) , we will be choosing “Two-Class Support Vector Machine”  and “Two-Class Boosted Decision Tree”  .

  • Two Class Support Vector Machine  Creates a binary classification model using the Support Vector Machine algorithm
  • Two-Class Boosted Decision Tree – Creates a binary classifier using a boosted decision tree algorithm

Simply drag these two algorithms and configure their properties as shown below for each one of them.

Adding and configuring Two Class Support Vector Machine

5.PNG

Adding and configuring Two-Class Boosted Decision Tree

6.PNG


Now in the next and final blog post of this series we will train our models and will evaluate the models.

Continue to Next Part(Part 2) of this Blog 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.