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")