In short

At 4 and 8 qubits both Random Forest routes score about 0.99 and PCA scores 0.78–0.83. The RF routes win on every single split, are about ten times steadier, and even win with half the qubits.

This section answers the main research question: does an RF pre-stage beat PCA before a VQC at the same qubit count? It compares the two RF arms, votes and leaf, against PCA + VQC at 4 and 8 qubits on the 50 test splits.

ConditionAccuracyF1PrecisionRecallAUC
votes 4q0.992 (0.002)0.991 (0.002)0.995 (0.002)0.988 (0.003)0.999 (0.000)
RF only0.991 (0.002)0.990 (0.002)0.996 (0.002)0.985 (0.003)1.000 (0.000)
votes 8q0.991 (0.002)0.990 (0.002)0.995 (0.002)0.985 (0.003)0.999 (0.001)
leaf 4q0.985 (0.002)0.985 (0.002)0.976 (0.003)0.993 (0.002)0.999 (0.000)
leaf 8q0.984 (0.002)0.983 (0.002)0.972 (0.005)0.995 (0.002)0.999 (0.001)
linear SVM0.974 (0.003)0.973 (0.003)0.969 (0.005)0.977 (0.004)0.992 (0.002)
RBF SVM0.833 (0.007)0.786 (0.011)0.988 (0.003)0.653 (0.014)0.983 (0.003)
PCA 8q0.830 (0.022)0.812 (0.024)0.856 (0.054)0.778 (0.053)0.931 (0.014)
PCA 4q0.776 (0.018)0.788 (0.021)0.712 (0.024)0.886 (0.051)0.909 (0.030)

Mean (standard deviation) of each metric per final condition over 50 test splits, ordered by accuracy.

Both RF arms reached approximately 0.98–0.99 accuracy at both qubit counts, while PCA + VQC reached approximately 0.830 at 8 qubits and 0.776 at 4 qubits. The best accuracy belongs to the 4-qubit RF votes arm, with 0.992. At equal qubit counts, the votes arm beat PCA by 0.216 accuracy at 4 qubits and 0.160 at 8 qubits, while the leaf arm beat PCA by 0.210 and 0.153 respectively. For every RF + VQC to PCA + VQC pair the difference was significant after a Bonferroni correction for all five metrics.

Per-fold accuracy of RF + VQC against PCA + VQC on the same fold, coloured by qubit count.

Every RF arm beat every PCA arm on all 50 of the 50 splits, with even the smallest margin being 0.10 accuracy. Every point lies on the RF side of the diagonal, which shows that the gap holds for every split and not just for the average. This includes RF at 4 qubits against PCA at 8 qubits, which means the RF arms beat the PCA arms even with half the qubits.

Per-fold test accuracy of each final condition (bar = median).

The RF arms only had a standard deviation of approximately 0.002, while the PCA arms had 0.018 and 0.022 for 4 and 8 qubits respectively, roughly 10 times lower for the RF arms. PCA at 4 qubits favours recall over precision, with scores of 0.886 and 0.712. A precision of 0.712 means that 29% of the samples it labelled as malware were actually benign; since the purpose is to detect malware, false positives would likely cost an analyst time.

The RF arms had an AUC of 0.999, while the PCA arms’ AUC was only 0.909 and 0.931 for 4 and 8 qubits. This means PCA + VQC separates the classes worse in and of itself, so its lower accuracy is not only caused by a badly placed decision threshold.

The votes arm performed slightly better than the leaf arm in accuracy, by about 0.005–0.008, which is small but still significant. Neither RF arm was universally better: the leaf arm had a higher recall of about 0.99, while the votes arm had a higher precision of 0.995.

Both RF pre-stages significantly outperformed the PCA arms at both qubit counts, and as such the hypothesis is supported, for this dataset, 4 and 8 qubits and an exact noiseless simulation (see limitations).

Next: performance across qubit counts