# Synthesizing Individual Consumers' Credit Historical Data Using Generative Adversarial Networks
## 3 Materials and Methods
### Neural Network Architecture
#### 3.3.1 Input Data Embedding  
We have divided the dataset into seven subgroups to keep the patterns that might exist in those who have delinquencies and set the order of accounts as the conditional  
\begin{table}
\begin{tabular}{c c c c} \hline \hline
**No** & **Column** & **Description** & **Type** \\ \hline
1 & ID & Car owner ID & - \\
2 & BTH\_YR & Birth year & Numerical \\
3 & GENDER & Gender & Categorical \\
4 & ORDER* & Order of account & Categorical \\
5 & SECTOR\_ID & Financial sectors & Categorical \\
6 & INST\_ID & Financial institution & Categorical \\
7 & CR\_CD\_1 & Credit card type & Categorical \\
8 & CR\_CD\_2 & Cardholder type & Categorical \\
9 & CR\_YM & Credit card issue date & Numerical \\
10 & CR\_DUR* & Holding period(mo) & Numerical \\
11 & LN\_CD\_1 & Loan type & Categorical \\
12 & LN\_CD\_2 & 0: Short-term; 1: Long-term & Categorical \\
13 & LN\_AMT & Average balance during the period & Numerical \\
14 & LN\_YM & Loan issue date & Categorical \\
15 & LN\_DUR* & Loan outstanding period(mo) & Numerical \\
16 & DQ\_CD\_1 & Delinquency type & Categorical \\
17 & DQ\_AMT & Average balance during the period & Numerical \\
18 & DQ\_YM & Delinquency original date & Numerical \\
19 & DQ\_DUR* & Delinquency period(mo) & Numerical \\ \hline \hline \end{tabular}
\end{table}
Table 2: Line-History Table.  
Figure 1: Structure of Conditional GAN for synthetic consumer credit data.  
variable. As seen in Figure 2, the group with three loans seems to have most car owners in their late 30 s to 50 s. On the other hand, the group with five loans has most in their late 20 s and 50 s. A detailed discussion on this is beyond the scope of this paper, but it is clear that one's financial activities are highly associated with one's age, the type of the accounts, and its issue date and duration. With an assumption that the numerical variables are multimodal distribution, we estimate the number of modes and cluster the numerical variables using the Gaussian Mixture Model (GMM).  
As described in Figure 3, we cluster the numerical variables using GMM as follows: first, set the probability that a sample \(s_{i,j,1},\ \cdots,\ s_{i,j,m}\), belongs to each cluster as \(p_{i,j,1},\ \cdots,\ p_{i,j,m}\), and the mean and standard deviation for each distribution as \(\mu_{i,j,1},\ \cdots,\ \mu_{i,j,m}\) and \(\sigma_{i,j,1},\ \cdots,\ \sigma_{i,j,m}\), respectively. Since \(p_{i,j,1},\ \cdots,\ p_{i,j,m}\) is a normalized probability distribution of the sum of \(m\) Gaussian distributions, we normalize a sample \(s_{i,j}\), as \(v_{i,j}\), and finally, a numerical sample \(s_{i,j}\), is denoted with a vector \(p_{i,j},\ v_{i,j}\). For categorical variables, we used a light version of Gumbel- SoftMax, adding a uniformly distributed noise to one-hot vectors to make them dense or differentiable [15; 17; 22]. A categorical sample \(s_{i,j}\), after one-hot encoded and added by a noise drawn from a uniform distribution, is denoted as \(d_{i,j}\).  
Afterward, we rebuild the table by binding the column vectors in the form of \(p_{i,j,1},\ \ldots,\ p_{i,j,m},\ v_{i,j,1},\ \ldots,\ v_{i,j,m},\ d_{i,j}\). This form applies to the output of the Generator, and it becomes an input for the Discriminator. Once labeled either real or fake, the vectors are converted back to the original form of data; for numerical variables \(s_{i,j}=\ 2v_{i,j,k}\sigma_{i,j,k}+\mu_{i,j,k}\), where \(k\) lies between 1 to \(m\), inclusive; for categorical variables, by simply taking the index of the largest element of \(d_{i,j}\).  
Figure 2: Multimodal distribution of the Birth Year of the group with three loans and five loans. The predicted number of clusters show the distinct distribution of the two groups.