*2.2. ANN*

The back error-propagation algorithm is one of the most used algorithms in engineering prediction models, being mainly used in layered feed forward ANNs. This algorithm is trained considering several series of examples (database), which encompass input arrangements and the desired output ranges. In this kind of algorithm, the input is introduced to the network, and the error between the current and the desired output is propagated backward in the network to calibrate the weights to improve the predictions accuracy. Several ANNs were developed to find the one that best fit the proposed problem. The ANNs were developed using MATLAB®, with the 'feedforwardnet' command, as it is suitable for regression problems where the objective is to estimate a specific numerical result with a single output, and with 80% of the data for training, 10% for validation, and the remaining 10% for testing. The activation function of the hidden layers was the 'tansig' function, and the last layer's activation function, the 'purelin' function. 'Tansig' is a hyperbolic tangent sigmoid activation function generally used in intermediate layers of ANNs, since it is entirely derivable and compatible with most training algorithms used. 'Purelin', in turn, is a linear activation function used in regression problems. The algorithms used in the network training are the default ones for the 'feedforwardnet' command in MATLAB®.

Although ANNs are tested immediately after training, it was decided to test the developed ANNs in estimating the machining times of the 100 parts contained on the database 'testdata'. In this way, the performance of the ANNs are evaluated against the same input data and not against random data. The evaluation of the network's performance is conducted by calculating the mean error (*ME*), the mean absolute error (*MAE*), the mean squared error (*MSE*), and the percentage error (*PE*) between the real and estimated values. The maximum error (EMax) is also analyzed.

The mean error (*ME*) was calculated according to the expression:

$$ME = \frac{\sum\_{t=1}^{n} \mathfrak{e}\_{t}}{n} \tag{1}$$

where *et* is calculated as the difference between the real time (*Zt*) and the estimated time (*Z<sup>e</sup> <sup>t</sup>* ), according to the expression:

$$x\_t = Z\_t - Z\_t^\varepsilon \tag{2}$$

The mean absolute error (*MAE*), in turn, is obtained according to:

$$MAE = \frac{\sum\_{t=1}^{n} |e\_t|}{n} \tag{3}$$

Expression (4) was used to calculate the mean square error (*MSE*):

$$MSE = \frac{\sum\_{t=1}^{n} e\_t^2}{n} \tag{4}$$

The percentage error was calculated according to the expression:

$$PE = \frac{|Z\_t^\varepsilon - Z\_t|}{Z\_t} \times 100\tag{5}$$
