# EliNAC: Autoencoder Approach for Electronic Invoices Data Clustering
## 4 Performance Evaluation
### Performance Evaluation of ELINAC in Clustering Short-Text Data  
ELINAC was trained using an 80/20 train-test-split. Although the number of epochs for clustering may vary, the model ran for 100 epochs to evaluate the training metrics progression for our NF-e dataset. The number of epochs needed for optimal clustering is discussed further in this section. The network's hidden layers use the rectifier activation function (i.e., relu), which applies the rectified linear unit to the node's input. The model is optimized by the Adam algorithm [47], a stochastic gradient descent method based on adaptive estimation of first and second-order moments that is computationally efficient and suited for problems with large data [47], with a default learning rate of 0.001. The first step to validating the ELINAC is to evaluate its training process using conventional autoencoder metrics and then compare it to the clustering metrics behavior when training the same data. Figure 6 presents the values for the Mean Absolute Error (MAE, defined in Equation (2)) and the Mean Squared Error (MSE, defined in Equation (3)) over epochs. The results present a typical behavior for autoencoder training, where the curve starts with a sharp decrease until it rectifies and converges. This means that the ELINAC has a conventional training behavior for the data used for this research. \[\text{MAE}=\frac{1}{N}\sum_{i=1}^{N}|y_{i}-\hat{y}| \tag{2}\]  
\[\text{MSE}=\frac{1}{N}\sum_{i=1}^{N}(y_{i}-\hat{y})^{2} \tag{3}\]  
The resulting reconstruction error also evaluates ELINAC's short-text data clustering process to identify outliers. Figure 7 presents the reconstruction error value increase \begin{table}
\begin{tabular}{c c} \hline \hline
**Algorithm** & **Parameters** \\ \hline K-means & \(n\_init=2\), \(max\_iter=5\) \\ Hierarchical Clustering & \(linkage=average,affinity=cosine\) \\ DBSCAN & \(min\_samples=1\) and \(eps=0.513/0.968\) \\ ELINAC & \(optimizer=Adam(0.001),loss=mse,activation=relu\) \\ \hline \hline \end{tabular}
\end{table} 
Table 4: Parameters set used in algorithms. over each row of the dataset when sorted from lowest to highest. In a conventional outlier approach, the records in the sharp increase towards the end would be labeled as outliers. Therefore, the resulting reconstruction error follows the expected behavior to identify outliers. The training results presented in Figures 6 and 7 showed that the ELINAC has a typical training curve and produces the reconstruction error value with the same pattern used purely for outlier detection. This makes sense as ELINAC was modeled based on the autoencoder. The next step to validate the ELINAC is to evaluate the behavior of the clustering metrics when training the model with the same input data as before. Figure 8 presents the variation of the Completeness and Homogeneity metrics in relation to epochs training, illustrating a comparative analysis with specific clusters (Figure 8a) and generalist clusters (Figure 8b). As the number of epochs increases, we observed that there is stability for the completeness metric and dispersion for the homogeneity metric, as presented in Figure 8a. This is because specific clusters have a small average size, meaning that the homogeneity of a cluster is more prone to change when records are incorrectly assigned. It should be noted that, for generalist clusters (Figure 8b), there is stability in accuracy regardless of the metric used. This makes sense because larger clusters are less prone to variations. The variation for the Mutual Info and Fowlkes-Mallows metrics in relation to epochs training is shown in Figure 9, comparing the behavior for specific clusters (Figure 9a) and generalist clusters (Figure 9b). The Mutual metric presents very consistent results with a slight increase towards the end, but not enough to justify the loss in other metrics. For the Fowlkes-Mallows metric, it is possible to notice a sharp decline after the first epoch, espe  
Figure 6: Evaluation of ELINAC training curves for (**a**) MSE and (**b**) MAE.