# 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
We might, for example, utilize logistic regression to predict the link between distinct lawful and illegitimate transactions. Given a collection of variables, logistic regression estimates the likelihood of falling into a specific level of categorical response. It is necessary to calculate the log-odds that are given by:

\[\ell=\beta_{0}+\beta_{1}x_{1}+\beta_{2}\ x_{2} \tag{14}\]

where \(x_{1}\) and \(x_{2}\) are predictors and coefficients \(\beta_{i}\) are the parameters of the model. To calculate corresponding odds, we use the following equation:

\[o=b^{\beta_{0}+\beta_{1}x_{1}+\beta_{2}\ x_{2}} \tag{15}\]

where b is the base of the logarithm and exponent. From this, fraud prevention can be obtained as:

\[P_{p}=\frac{\beta_{0}+\beta_{1}x_{1}+\beta_{2}\ x_{2}}{\beta_{0}+\beta_{1}x_{ 1}+\beta_{2}\ x_{2}+1} \tag{16}\]

Thus, the logistic function can be defined as this, when there is a single explanatory variable x:

\[p(x)=\frac{1}{1+e^{-(\beta_{0}+\beta_{1}x_{1})}}. \tag{17}\]Based on the previous equation for probability of fraud prevention function, we can define the inverse of the logistic function, g, the logit:

\[g(p(x))=logit\ p(x)=ln\bigg{(}\frac{p(x)}{1-p(x)}\bigg{)}=\beta_{0}+\beta_{1}x_{ 1}, \tag{18}\]

which then is exponentiated and transformed to the following form:

\[\frac{p(x)}{1-p(x)}=e^{\beta_{0}+\beta_{1}x_{1}} \tag{19}\]

The odds of the dependent variable equaling a case, which serves as a link function between the probability and the linear regression expression is defined by:

\[odds=e^{\beta_{0}+\beta_{1}x} \tag{20}\]

When there is a continuous independent variable, the odds ratio can be calculated as:

\[Z=S\sum T^{*} \tag{13}\]0

In addition, for multiple explanatory variables, the perdition can be defined as:

\[Z=S\sum T^{*} \tag{13}\]1

where m is explanatory of multiple regression, from which we acquire as:

\[Z=S\sum T^{*} \tag{13}\]2

After considering the Logistic Regression function itself, it is important to know how the model for machine learning algorithm is constructed. Here is the generalized linear model function with parameter \(\theta\):

\[Z=S\sum T^{*} \tag{13}\]3

where X is independent variable, Y is random variable, which may be 1 or 0, it is exponential and from which we can acquire the conditional probability of input and output variables given the parameter \(\theta\):

\[Z=S\sum T^{*} \tag{13}\]4

We acquire the likelihood function assuming that all the observations in the sample are independently Bernoulli distributed:

\[Z=S\sum T^{*} \tag{13}\]5

The log likelihood is typically maximized with a normalizing factor N\({}^{-1}\),

\[Z=S\sum T^{*} \tag{13}\]6

which is maximized using gradient descent, one of the optimization techniques. Assuming the (x, y) pairs are drawn uniformly from the underlying distribution, then in the limit of large \(N\),

\[Z=S\sum T^{*} \tag{13}\]7

\(H(Y,\ X)\) denotes the conditional probability, and DkL denotes the Kullback-Leibler divergence. This leads to the conclusion that by maximizing a model's log-likelihood, you are reducing its KL divergence from the maximal entropy distribution. Searching intuitively for the model with the fewest assumptions in its parameters. The transaction request is initiated when the user purchases things or pays for services. The Logistic Regression approach is then used to develop our prediction model. In order to train the model, we use the creditcard.csv dataset and user information from the database. When our new transactions are included into the algorithm, the model predicts if the requested transaction is valid or exhibits anomalous behavior. If the model predicts a genuine transaction, the transaction will be completed and the money will be retained. However, if the transaction is irregular, the system will send a verification code to the user's cell phone. Furthermore, if the user inputs the correct code, the transaction will be completed and saved in the dataset.