Machine Learning For Credit Card Fraud D
Machine Learning For Credit Card Fraud D
16819-16824
© Research India Publications. http://www.ripublication.com
16819
International Journal of Applied Engineering Research ISSN 0973-4562 Volume 13, Number 24 (2018) pp. 16819-16824
© Research India Publications. http://www.ripublication.com
The processing steps are discussed in Table 1 to detect the best algorithm for the given dataset
Table 1: Processing steps
Algorithm steps:
Step 1: Read the dataset.
Step 2: Random Sampling is done on the data set to make it balanced.
Step 3: Divide the dataset into two parts i.e., Train dataset and Test dataset.
Step 4: Feature selection are applied for the proposed models.
Step 5: Accuracy and performance metrics has been calculated to know the efficiency for different algorithms.
Step6: Then retrieve the best algorithm based on efficiency for the given dataset.
16820
International Journal of Applied Engineering Research ISSN 0973-4562 Volume 13, Number 24 (2018) pp. 16819-16824
© Research India Publications. http://www.ripublication.com
3.1 Logistic Regression: Logistic function is used in the logistic regression in which
cost function quantifies the error, as it models response is
Logistic Regression is one of the classification algorithm,
compared with the true value.
used to predict a binary values in a given set of independent
variables (1 / 0, Yes / No, True / False). To represent binary / X(θ)=−1/m*(∑ yilog(hθ(xi))+(1−yi)log(1−hθ(xi))) (3.6)
categorical values, dummy variables are used. For the purpose
Where
of special case in the logistic regression is a linear regression,
when the resulting variable is categorical then the log of odds hθ(xi) : logistic function
are used for dependent variable and also it predicts the
yi : outcome variable Gradient descent is a learning algorithm
probability of occurrence of an event by fitting data to a
logistic function. Such as
3.2 Decision Tree Algorithm:
O = e^(I0 + I1*x) / (1 + e^(I0 + I1*x)) (3.1) Decision tree is a type of supervised learning algorithm
(having a pre-defined target variable) that is mostly used in
Where,
classification problems. It works for both categorical and
O is the predicted output continuous input and output variables. In this technique, we
split the population or sample into two or more homogeneous
I0 is the bias or intercept term
sets (or sub-populations) based on most significant splitter /
I1 is the coefficient for the single input value (x). differentiator in input variables.
TYPES OF DECISION TREE
Each column in the input data has an associated I coefficient 1. Categorical Variable Decision Tree: Decision Tree
(a constant real value) that must be learned from the training which has categorical target variable then it called as
data. categorical variable decision tree.
y = e^(b0 + b1*x) / (1 + e^(b0 + b1*x)) (3.2) 2. Continuous Variable Decision Tree: Decision Tree has
continuous target variable then it is called as Continuous
Logistic regression is started with the simple linear regression
Variable Decision Tree
equation in which dependent variable can be enclosed in a link
function i.e.,to start with logistic regression, I’ll first write the
simple linear regression equation with dependent variable
TERMINOLOGY OF DECISION TREE:
enclosed in a link function:
1. Root Node: It represents entire population or sample
A(O) = β0 + β(x) (3.3)
and this further gets divided into two or more
homogeneous sets.
Where 2. Splitting: It is a process of dividing a
node into two or more sub-nodes.
A() : link function
3. Decision Node: When a sub-node splits into further sub-
O : outcome variable
nodes, then it is called decision node.
x : dependent variable
4. Leaf/ Terminal Node: Nodes do not split
A function is established using two things: is called Leaf or Terminal node.
1) Probability of Success(pr) and 2) Probability of 5. Pruning: When we remove sub-nodes of a decision
Failure(1-pr). node, this process is called pruning. You can say
opposite process of splitting.
pr should meet following criteria: a) probability must always
be positive (since p >= 0) b) probability must 6. Branch / Sub-Tree: A sub section of
always be less than equals to 1 (since pr <= 1). By applying entire tree is called branch or sub-tree.
exponential in the first criteria and the value is always greater
7. Parent and Child Node: A node, which is divided into
than equals to 1.
sub-nodes is called parent node of sub-nodes where as
pr = exp(βo + β(x)) = e^(βo + β(x)) (3.4) sub-nodes are the child of parent node.
For the second criteria, same exponential is divided by adding
1 to it so that the value will be less than equals to 1
WORKING OF DECISION TREE
pr = e^(βo + β(x)) / e^(βo + β(x)) + 1 (3.5)
Decision trees use multiple algorithms to decide to split a node
in two or more sub- nodes. The creation of sub-nodes
increases the homogeneity of resultant sub-nodes. In other
words, we can say that purity of the node increases with
respect to the target variable. Decision tree splits the nodes on
16821
International Journal of Applied Engineering Research ISSN 0973-4562 Volume 13, Number 24 (2018) pp. 16819-16824
© Research India Publications. http://www.ripublication.com
all available variables and then selects the split which results Table 2: Algorithm steps for finding the Best algorithm
in most homogeneous sub-nodes.
Step 1: Import the dataset
1. Gini Index
Step 2: Convert the data into data frames format
2. Information Gain
Step3: Do random oversampling using ROSE package
3. Chi Square
Step4: Decide the amount of data for training data and
4. Reduction of Variance testing data
Step5: Give 70% data for training and remaining data for
testing.
Step6: Assign train dataset to the models
Step7: Choose the algorithm among 3 different algorithms
and create the model
Step8: Make predictions for test dataset for each algorithm
Step9: Calculate accuracy for each algorithm
Step10: Apply confusion matrix for each variable
Step11: Compare the algorithms for all the variables and find
out the best algorithm.
16822
International Journal of Applied Engineering Research ISSN 0973-4562 Volume 13, Number 24 (2018) pp. 16819-16824
© Research India Publications. http://www.ripublication.com
16823
International Journal of Applied Engineering Research ISSN 0973-4562 Volume 13, Number 24 (2018) pp. 16819-16824
© Research India Publications. http://www.ripublication.com
16824