3.3.2. Confusion Matrix

In the field of machine learning and the problem of statistical classification, the confusion matrix is commonly applied to evaluate the efficacy of an algorithm. Table 2 presents an example of a confusion matrix. From the table, the true positive (*tp*) value and true negative (*tn*) value represent accurate classifications. The false positive (*fp*) value or false negative (*fn*) value refers to erroneous classifications.

**Table 2.** Confusion matrix.


The commonly used metrics of the effectiveness of classification are generated from four elements of the confusion matrix (accuracy, precision, sensitivity, specificity and area under the receiver operating characteristic curve (AUC)).

The predictive accuracy of a classification algorithm is calculated as follows.

$$Accuracy = \frac{tp + tn}{tp + fp + tn + fn} \tag{14}$$

Two extended versions of accuracy are precision and sensitivity. Precision measures the reproducibility of a measurement, whereas sensitivity—also called recall—measures the completeness. Precision in Equation (15) is defined as the number of true positives as a proportion of the total number of true positives and false positives that are provided by the classifier.

$$Precision = \frac{tp}{tp + fp} \tag{15}$$

Sensitivity in Equation (16) is the number of correctly classified positive examples divided by the number of positive examples in the data. In identifying positive labels, sensitivity is useful for estimating the effectiveness of a classifier.

$$Sensitivity = \frac{tp}{tp + fn} \tag{16}$$

Another performance metric is specificity. The specificity of a test is the ability of the test to determine correctly those cases. This metric is estimated by calculating the number of true negatives as a proportion of the total number of true negatives and false positives in examples. Equation (17) is the formula for specificity.

$$Specificity = \frac{tn}{tn + fp} \tag{17}$$

A receiver operating characteristic (ROC) curve is the most commonly used tool for visualizing the performance of a classifier, and AUC is the best way to capture its performance as a single number. The ROC curve captures a single point, the area under the curve (AUC), in the analysis of model performance [72]. The AUC, sometimes referred to as the balanced accuracy [73] is easily obtained using Equation (18).

$$AlIC = \frac{1}{2} \left[ \left( \frac{tp}{tp + fn} \right) + \left( \frac{tn}{tn + fp} \right) \right] \tag{18}$$

#### **4. Metaheuristic-Optimized Multi-Level Classification System**

#### *4.1. Benchmarking of the Enhanced Metaheuristic Optimization Algorithm*

This section evaluates the efficiency of the enhanced FA by testing benchmark functions to elucidate the characteristics of optimization algorithms. Ten complex benchmark functions with different characteristics and dimensions [74,75] were used herein to evaluate the performance of the enhanced FA. This investigation used 200 for the number of fireflies and 1000 for the maximum number of iterations.

Table 3 presents numerical benchmark functions and their optimal values that are obtained, using the enhanced FA. The results indicate that the enhanced FA yielded all of the optimal values, which were very close to the analytically obtained values. Therefore, the proposed enhanced FA is promising.



**Table 3.** *Cont.*
