## 4 Case Study
### Modeling
#### 4.3.1 First Experiment  
From the eight variables of dataset A (the features are described in Table 1 in Appendix A) collected to characterize an officer, only four of them will be considered to build a group of different models based on three of the main characteristics from the officers (two of the variables were merged). For each of these three new variables responsible to characterize an officer, we decided to choose different dependent variables for modeling. In Table 4, the distribution of those variables can be found. The logic behind this selection focused mostly on business reasons:  
* **Demographic of the users:** would be allocated to the demographic variables of the officers;
* **Experience of the officers:** the _time_in_company_ variable should be based on what stage the user is in if it is their first loan with this company, what type of loan it is, and the behavior of the users, here analyzed as SMS and app features;
* **Field of studies:** which should be related to with the academic background of the users and a mix of characteristics from the loan such as the amount, reason, or the bank entity where the loan was deposited. \begin{table}
\begin{tabular}{r r r r r r r} \hline \hline  & \multicolumn{6}{c}{**Dataset A**} \\ \hline  & **user\_age** & **marital\_status** & **nr\_children** & **employ\_status** & **educ\_status** & **officer\_age** \\ \hline Mean & 34.53 & 0.61 & 1.52 & 0.54 & 1.80 & 26.19 \\ Std dev & 14.03 & 0.56 & 1.87 & 0.64 & 0.41 & 3.28 \\ Min & 18.00 & 0.00 & 0.00 & 0.00 & 0.00 & 21.00 \\
1 st Q & 29.00 & 0.00 & 0.00 & 0.00 & 2.00 & 25.00 \\
2 nd Q & 34.00 & 1.00 & 1.00 & 0.00 & 2.00 & 26.00 \\
3 rd Q & 39.00 & 1.00 & 2.00 & 1.00 & 2.00 & 27.00 \\ Max & 1822.00 & 3.00 & 100.00 & 4.00 & 2.00 & 35.00 \\ \hline \hline \end{tabular}
\end{table} 
Table 2: Table of descriptive statistics for dataset A. \begin{table}
\begin{tabular}{r r r r r r} \hline \hline  & \multicolumn{6}{c}{**Dataset B**} \\ \hline  & **user\_age** & **marital\_status** & **nr\_children** & **employ\_status** & **education\_status** \\ \hline Mean & 35.01 & 0.62 & 1.55 & 0.79 & 1.81 \\ Std dev & 11.81 & 0.56 & 1.84 & 1.16 & 0.40 \\ Min & 18.00 & 0.00 & 0.00 & 0.00 & 0.00 \\
1 st Q & 30.00 & 0.00 & 0.00 & 0.00 & 2.00 \\
2 nd Q & 34.00 & 1.00 & 1.00 & 1.00 & 2.00 \\
3 rd Q & 40.00 & 1.00 & 2.00 & 1.00 & 2.00 \\ Max & 1024.00 & 3.00 & 100.00 & 7.00 & 2.00 \\ \hline \hline \end{tabular}
\end{table} 
Table 3: Table of descriptive statistics for dataset B. Since the desired output for the models is the probability of a certain characteristic of each of the three variables that build the profile of the officers to result in the best chance of payment from the user, it would be necessary to predict not only what characteristic would be optimal for each loan but also if it results in payment or not. For this, and already having dataset A divided into three subsets based on what was mentioned previously in Table 4, the subsets were filtered into new subsets where the three variables related to the officers would be constant. For example, the subset from the field of studies would be filtered by social sciences, natural/formal sciences, humanities, and applied sciences and professions, resulting in four new subsets. These subsets will be used in modeling to test and predict if the loan is paid or not. The characteristics that are being pursued are now input variables as well to predict the target variable _paid_, where a probability of payment will be associated with that particular characteristic. For example, the loan addressed to the field of study of social science would have a probability of 60% of payment. All the subsets mentioned are trained and tested using SVM, neural networks, decision trees, and naive Bayes. The values from the metrics used to analyze the results should be between 0 and 1. The nearest to 1 the metrics are, the better a model can perform.