# Ensemble Method of Triple Naive Bayes for Plastic Type Prediction in Sorting System Automation
## 3 Results and Discussion
\begin{table}
\begin{tabular}{c c c c c c} \hline \hline \multicolumn{5}{c}{**(a) NB with Crisp Discretization**} \\ \hline  & \multicolumn{4}{c}{Prediction} \\ \cline{2-5}  & Plastic Type & PET & HDPE & PP & Sum \\ \hline \multirow{3}{*}{Actual} & PET & 26 & 0 & 0 & 26 \\  & HDPE & 2 & 30 & 2 & 34 \\  & PP & 0 & 0 & 30 & 30 \\ \hline \multicolumn{5}{c}{Sum} & 28 & 30 & 32 & 90 \\ \hline \multicolumn{5}{c}{**(b) NB with Linear–Triangular Fuzzy Discretization**} \\ \hline  & \multicolumn{4}{c}{Prediction} \\ \cline{2-5}  & Plastic Type & PET & HDPE & PP & Sum \\ \hline \multirow{3}{*}{Actual} & PET & 23 & 3 & 0 & 26 \\  & HDPE & 0 & 32 & 2 & 34 \\  & PP & 0 & 0 & 30 & 30 \\ \hline \multicolumn{5}{c}{Sum} & 23 & 35 & 32 & 90 \\ \hline \multicolumn{5}{c}{**(c) NB with Linear–Trapezoidal Fuzzy Discretization**} \\ \hline  & \multicolumn{4}{c}{Prediction} \\ \cline{2-5}  & Plastic Type & PET & HDPE & PP & Sum \\ \hline \multirow{3}{*}{Actual} & PET & 22 & 4 & 0 & 26 \\  & HDPE & 0 & 32 & 2 & 34 \\  & PP & 0 & 0 & 30 & 30 \\ \hline \multicolumn{5}{c}{**(d) Ensemble of Triple Naive Bayes**} \\ \hline  & \multicolumn{4}{c}{Prediction} \\ \cline{2-5}  & Plastic Type & PET & HDPE & PP & Sum \\ \hline \multirow{3}{*}{Actual} & PET & 26 & 0 & 0 & 26 \\  & HDPE & 0 & 32 & 2 & 34 \\  & PP & 0 & 0 & 30 & 30 \\ \hline \multicolumn{5}{c}{Sum} & 26 & 32 & 32 & 90 \\ \hline \hline \end{tabular}
\end{table} 
Table 5: Confusion matrix of four proposed NB. in the NB model with crisp discretization exhibits the lowest performance, with accuracy, precision, and recall ranging from 91% to 92%. However, the highest performance is at the fifth resampling, which reaches 100% for all metrics. Similar events also occur in the performance of the two models of NB with fuzzy discretization. The lowest and highest performances for the linear-triangular combination are at the eighth and thirty-first resampling, respectively, with metric values ranging from 86 to 87% and 97 to 98%. In the linear-trapezoidal combination, the lowest and highest performances are at the eighth and thirty-third resampling, respectively, with metric values ranging from 85 to 87% and 97 to 98%. Similar to the performance of the three single NB prediction models, the ensemble model also has different performances in each resampling. Figure 6: Performance of single and ensemble of triple NB in each random resampling. Table 7 presents three critical pieces of information regarding the performance generalization of the four proposed models, which are based on the thirty-five resampling. First, among the three proposed single methods, the performance of the NB with crisp discretization and NB with linear-trapezoidal fuzzy discretization models is the highest and the lowest, respectively. Second, the ensemble model built from the three single NB models, which have performances in the range of 91.51-95.16%, has a performance in the range of 97.07-97.3%. Third, the performance improvement of the ensemble model compared to each single model with NB with crisp discretization, NB with linear-triangular, and NB with linear-trapezoidal is 2.06-2.15%, 3.98-4.49%, and 4.79-5.56%, respectively. This fact also informs us that fuzzy discretization does not always provide better performance than crisp discretization. It is suspected that the crisp discretization that is carried out does not produce vagueness in each category of the variable. However, the performance of the plastic-type prediction model using the NB model with discretization, which has the highest performance among the proposed single models, can be improved through the ensemble method, which is built from a combination of crisp and fuzzy discretization models. Additionally, ANOVA (Table 8) shows whether the four proposed models' performance is distinct, and when using the proposed ensemble models, whether the performance metrics have improved significantly.