# Improving the Accuracy of Predicting Bank Depositor's Behavior Using a Decision Tree
## 3 Results  
The purpose of this study focuses on improving the sales of long-term deposits through telemarketing by forecasting the likely outcome of each contact. In this section, we show the results obtained by applying the classification techniques to the bank marketing dataset. Accuracy, sensitivity and specificity were computed to evaluate the performance of the J48 classifier in order to find any differences from the original data. Our results show that the best method for predicting the sale of the deposit was the decision tree algorithm (J48) with the binary result as the successful or unsuccessful outcome of each contact. In the experiment, 10% (4119) of instances were randomly selected, and 21 attributes were used. A 10-fold cross-validation scheme was adopted to ensure independence between training and test sets [4]. In Table 2, we show the resulting confusion matrix. Based on these results, we also computed the accuracy, sensitivity and specificity (Figure 3 shows the values for J48). After loading 10% of the original data, as discussed earlier, the dataset was imbalanced and only 451 samples corresponded to the success class, while 3668 samples failed. To solve the problem, a resampling technique was applied. Then, the success instances increased to 481 and the failure instances decreased to 3638. So, by changing the original data instances, after applying a resampling technique, we increased the correctly classified instances and reduced the incorrectly classified instances. Furthermore, the three metrics increment values, by this technique, are shown in Figure 4.  
The main method used in this study was to combine a resampling technique with feature selection by using the J48 classifier. This method led to better results for accurately predicting customer behavior based on the account of long-term deposits. WappedSubsetEval was used to select the useful features and remove the other extra ones; it provided dimension reduction in order to improve speed, accuracy, efficiency and performance. This method helped to obtain better results through the J48 classifier, as shown by the three metrics. Resampling and feature selection have a direct efficacy impact on the accuracy rate of classifier algorithms, as highlighted by [34]. \begin{table}
\begin{tabular}{c c c c c} \hline \hline
**Classifier** & **TN** & **FN** & **FP** & **TP** \\ \hline
**J48** & 3535 & 133 & 243 & 208 \\ \hline
**NB** & 3331 & 337 & 273 & 278 \\ \hline
**LR** & 3570 & 98 & 254 & 197 \\ \hline \hline \end{tabular}
\end{table} 
Table 2: Confusion matrix for the three trained models. Figure 3: Accuracy, specificity and sensitivity for J48 decision tree. When using the attribute evaluator for the J48 model, the 12 selected attributes from the 20 that were input, resulted in an increased number of correctly classified instances, as shown in Table 3.  
Feature (or variable) selection keeps only the useful features, resulting in better classification and also provides a tuned binary tree from the J48 model [29]. The model achieved an accuracy of 94.39%, a sensitivity of 0.975 and 0.709 specificity. The result of the method showed an improvement of customer prediction accuracy (Figure 5). For both techniques, the confusion matrix shows information about the instances classified as false positive (FP), false negative (FN), true positive (TP) and true negative (TN) that are shown in Figure 6. The values for Table 2 are exactly the same as Figure 6. The comparison of the three levels that are used clearly shows the benefit of using both resampling and feature selection, with higher values of TP and TN. \begin{table}
\begin{tabular}{c c} \hline \hline  & **J48** \\ \hline
1 & Age \\ \hline
2 & Education \\ \hline
3 & Contact \\ \hline
4 & Duration \\ \hline
5 & P days \\ \hline
6 & Previous \\ \hline
7 & P outcome \\ \hline
8 & Emp.Var.Rate \\ \hline
9 & Cons.Price.Idx \\ \hline
10 & Cons.Conf.Idx \\ \hline
11 & Euribor3m \\ \hline
12 & Nr.Employed \\ \hline
13 & Y as output \\ \hline \hline \end{tabular}
\end{table}