# Credit Card-Not-Present Fraud Detection and Prevention Using Big Data Analytics Algorithms
## 3 Credit Card-Not-Present Fraud Detection and Prevention Method
### Fraud Detection Process
#### 3.1.1 Dimensionality Feature Reduction
The Levenshtein distance is computed as follows:

\[\mathit{Lev}(x,y)=\left\{ \begin{array}{ll}|x|&if|y|\ =0\\ |y|&if\ |x|=0\\ &ifx|0|=y|0|,\\ \mathit{lev}(tail(x),\ \mathit{tail}(y))&\\ 1+\mathit{min}\left\{\begin{array}{ll}\mathit{lev}(tail(x),y)&\\ \mathit{lev}(x,\ \mathit{tail}(y))&\\ \mathit{lev}(tail(x),tail\ (y))&\\ \end{array}\right.&\mathit{otherwise},\\ \mathit{lev}(tail(x),tail\ (y))&\\ \end{array} \right. \tag{6}\]

Another time-based difference characterization is disagreement decay. Disagreement decay is defined as the probability that changes the value of an attribute \(s\) within time \(t\). The symbol \(d\) represents this probability (s,t). The mathematical statistics can be used to characterize the probability distribution function of this probability given by:

\[d^{\
eq}(A,\Delta t)=\frac{|f_{s\
eq s,n,\Delta t}|}{|f_{s,n,\Delta t}|} \tag{7}\]

The absolute value denotes the number of samples needed to generate an agreement decay. The agreement decay is the probability that an entity retains the same value of an attribute \(s\) over time \(t\). #### 3.1.2 t-Distributed Stochastic Neighbor Embedding

It reduces a high-dimensional dataset to a low-dimensional graph that retains the majority of the original data. It does this by placing each data point on a two- or three-dimensional map. This method finds data clusters, guaranteeing that an embedding keeps its meaning in the data. In this case, t-SNE reduces dimensionality by seeking to keep similar and dissimilar instances close together. Here, t-SNE computes probabilities \(P_{i|j}\) of the similar high-dimensional datasets \(D_{1},\ \ldots,D_{N}\), which are proportional to the similarity of datasets \(D_{i}\) and \(D_{j}\) given by:For \(i\
eq j\), thus define. \[P_{i|j}=\frac{\exp\Bigl{(}-||D_{i}-D_{j}||^{2}/2\omega_{i}^{2}\Bigr{)}}{\sum_{k \
eq i}\exp\Bigl{(}-||D_{i}-D_{k}||^{2}/2\omega_{i}^{2}\Bigr{)}} \tag{8}\]

Therefore, \(P_{i|j}=0\) and \(\sum_{j}P_{i|j}=1\) for all \(i\). The conditional probability \(P_{j|i}\) describes the similarity of datapoint \(D_{j}\) to datapoint \(D_{i}\). Thus, \(D_{i}\) can select \(D_{j}\) as its neighbor. If the neighbors are selected with amount to their probability density under Gaussian centered at \(D_{i}\). Thus, it can be defined as:

\[P_{ij}=\frac{P_{j|i}+P_{i|j}}{2N} \tag{9}\]

Therefore, \(P_{ij}=P_{ii}\). Hence \(P_{ii}=0\), and \(\sum_{i,j}P_{i,j}=1\). Where \(N\) is a high-dimensional dataset, and \(\omega\) is the bandwidth of a Gaussian function. #### 3.1.3 Principal Component Analysis

It is the process of computing the primary components and then utilizing them to adjust the foundation of the data, frequently using only the top few primary components and dismissing the rest. PCA is used for both exploratory data analysis and predictive modelling. It is extensively used to reduce dimensionality by projecting each data point onto only the first few major components to obtain lower-dimensional data while retaining as much variation in the data as feasible. The direction that minimizes the variance of the anticipated data is defined as the first principal component. The major components are in charge of increasing the variation of the projected data. The standardization is especially important before PCA because the latter is very sensitive to the variances of the initial variables. That is, if the ranges of initial variables differ significantly, those with larger ranges will become dominate over those with small ranges (for example, a variable ranging from 0 to 100 will become dominate over a variable ranging from 0 to 1), resulting in biased results. As a result, converting the data to comparable scales can aid in avoiding this problem. For each value of the variable, perform this mathematical operation by subtracting the mean and dividing by the standard deviation. Let us assume \(A_{s}\) is the matrix that defines dataset. As a result, each column \(n\) be a feature and each row m be an example. Therefore, matrix \(A\) is the combination of matrix \(m\times n\).