File size: 1,961 Bytes
0f755ec
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
import numpy as np
import matplotlib.pyplot as plt

# --- FINAL CONFIRMED SCORES ---
results = {
    "Deep Learning (CNN)": 0.7770,
    "Quantum (Standard)": 0.7994,
    "Classical (RF Baseline)": 0.9120,
    "Quantum (Residual Specialist)": 0.6532,
    "Ensemble (RF + Quantum)": 0.9154
}

# Sort for the graph
sorted_results = dict(sorted(results.items(), key=lambda item: item[1]))

print("🚀 GENERATING FINAL VICTORY ARTIFACTS...")

# 1. THE BAR CHART
plt.figure(figsize=(12, 6))
# Colors: Gray for failures, Blue for Baseline, Green for Specialist, Gold for WIN
colors = ['gray', 'gray', 'gray', 'blue', 'gold'] 
# We need to map these colors to the sorted keys, which might change order
# Let's assign colors manually based on the key name for safety
bar_colors = []
for key in sorted_results.keys():
    if "Ensemble" in key: bar_colors.append('#FFD700') # Gold
    elif "Baseline" in key: bar_colors.append('#1f77b4') # Blue
    elif "Specialist" in key: bar_colors.append('#2ca02c') # Green
    else: bar_colors.append('#d62728') # Red/Gray

bars = plt.barh(list(sorted_results.keys()), list(sorted_results.values()), color=bar_colors)

# Add labels
for bar in bars:
    width = bar.get_width()
    # Bold the winner
    weight = 'bold' if width > 0.9120 else 'normal'
    plt.text(width + 0.005, bar.get_y() + bar.get_height()/2, f'{width:.4f}', 
             va='center', fontsize=12, fontweight=weight)

plt.title("Final Result: Quantum Residual Learning Boosts SOTA", fontsize=14, fontweight='bold')
plt.xlabel("AUC Score (Higher is Better)")
plt.xlim(0.6, 0.95) # Zoom in to show the difference
plt.axvline(x=0.9120, color='blue', linestyle='--', alpha=0.5, label='Classical Ceiling (0.9120)')
plt.legend(loc='lower right')
plt.grid(axis='x', alpha=0.3)
plt.tight_layout()

plt.savefig('final_victory_chart.png')
print("📸 Saved 'final_victory_chart.png'")

print("\n✅ PROJECT COMPLETE.")
print(f"   Final Boost: +{0.9154 - 0.9120:.5f} AUC")