## 2 Materials and Methods
### Data Preprocessing
#### 2.2.1 Feature Encoding, Imputing Missing Values, and Feature Scaling  
The categorical features in the dataset were not numeric; therefore, we needed to turn them into numbers [19]. For the ordinal categorical features such as \"the plaintiff's educational background\" and \"the defendant's educational background\", ordinal coding was used, which meant that each category was assigned an integer number [20] based on the prior information [21]. For the nominal categorical features such as \"the victim is in poor health\", \"the plaintiff is in debt\", and \"the defendant is in debt\", one-hot encoding [19] was used. In theory, one-hot encoding takes each of the categories as a feature: a categorical feature with k categories is encoded as a feature vector of length k [19]. However, all nominal categorical features in our dataset shown in Table 1 were encoded as a feature vector of length 1, because those features were all binary categorical features. Figure 1: An example of how we extracted legal factors from the judgment documents. \begin{table}
\begin{tabular}{c c c} \hline \hline
**Serial Number** & **Feature** & **Type** \\ \hline
1 & The total number of plaintiffs who are the victim’s parents in the same case & Numerical \\ \hline
2 & The total number of plaintiffs who are the victim’s spouse in the same case & Numerical \\ \hline
3 & The total number of plaintiffs who are the victim’s children in the same case & Numerical \\ \hline
4 & The total number of plaintiffs in the same case & Numerical \\ \hline
5 & The age of the victim & Numerical \\ \hline
6 & The victim is the only child of the plaintiff & Nominal categorical \\ \hline
7 & The victim is in poor health & Nominal categorical \\ \hline
8 & The plaintiff is the victim’s parents & Nominal categorical \\ \hline
9 & The plaintiff is the victim’s spouse & \\ \hline
10 & (including the duration of marriage) & Ordinal categorical \\ \hline
11 & The plaintiff is the victim’s child & Ordinal categorical \\ \hline
12 & The number of relatives that the plaintiff needs to support & Numerical \\ \hline
13 & The plaintiff’s educational background & Ordinal categorical \\ \hline
14 & The plaintiff’s occupation & Nominal categorical \\ \hline
15 & The plaintiff’s income & Numerical \\ \hline
16 & The amount of real estate that the plaintiff possesses & Numerical \\ \hline
17 & The number of automobiles that the plaintiff possesses & Numerical \\ \hline
18 & The number of motorcycles that the plaintiff possesses & Numerical \\ \hline
19 & The number of investments that the plaintiff holds & Numerical \\ \hline
20 & The plaintiff is in debt & Nominal categorical \\ \hline
21 & The plaintiff belongs to disadvantaged and vulnerable groups & Nominal categorical \\ \hline
22 & The number of children that the defendant raises & Numerical \\ \hline
23 & The number of relatives that the defendant needs to support & Numerical \\ \hline
24 & The defendant’s educational background & Ordinal categorical \\ \hline
25 & The defendant’s occupation & Nominal categorical \\ \hline
26 & The defendant’s income & Numerical \\ \hline
27 & The amount of real estate that the defendant possesses & Numerical \\ \hline
28 & The number of automobiles that the defendant possesses & Numerical \\ \hline
29 & The number of motorcycles that the defendant possesses & Numerical \\ \hline
30 & The number of investments that the defendant holds & Numerical \\ \hline
31 & The defendant is in debt & Nominal categorical \\ \hline
32 & The defendant belongs to disadvantaged and vulnerable groups & Nominal categorical \\ \hline
33 & The sum of mental suffering damages that all plaintiffs claim in the same case & Numerical \\ \hline
34 & The mental suffering damages that plaintiff claims & Numerical \\ \hline \end{tabular}
\end{table} 
Table 1: The description of features in dataset. Next, it was required to handle the missing values problem with imputation methods, because most learning algorithms are, in general, unable to deal with missing values [22].