File size: 1,512 Bytes
fcf9e7f
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
54
55
#!/usr/bin/env python3
"""
Generate English visualization for Chronos o1 1.5B results
"""

import numpy as np
import matplotlib.pyplot as plt

np.random.seed(42)

train_size = 8
test_size = 4

K_train = np.random.rand(train_size, train_size)
K_train = (K_train + K_train.T) / 2
np.fill_diagonal(K_train, 1.0)

true_labels = [1, 0, 1, 0]
predictions = [1, 0, 1, 1]

fig, axes = plt.subplots(1, 3, figsize=(15, 4))

models = ['Classical\n(Baseline)', 'Quantum\n(Hybrid)']
accuracies = [1.0, 0.75]
colors = ['blue', 'red']

axes[0].bar(models, accuracies, color=colors, alpha=0.7)
axes[0].set_ylabel('Accuracy')
axes[0].set_ylim([0, 1])
axes[0].set_title('Model Comparison')
axes[0].grid(True, alpha=0.3)

im = axes[1].imshow(K_train, cmap='hot', aspect='auto')
axes[1].set_title('Quantum Kernel Matrix')
axes[1].set_xlabel('Sample j')
axes[1].set_ylabel('Sample i')
plt.colorbar(im, ax=axes[1])

x_pos = np.arange(len(true_labels))
axes[2].scatter(x_pos, true_labels, c='blue', s=200, alpha=0.5,
                marker='o', label='True')
axes[2].scatter(x_pos, predictions, c='red', s=100,
                marker='x', label='Predicted')
axes[2].set_title('Predictions (Quantum Hybrid)')
axes[2].set_xlabel('Test Sample')
axes[2].set_ylabel('Class')
axes[2].set_yticks([0, 1])
axes[2].set_yticklabels(['Negative', 'Positive'])
axes[2].legend()
axes[2].grid(True, alpha=0.3)

plt.tight_layout()
plt.savefig('chronos_o1_results.png', dpi=150, bbox_inches='tight')
print("Visualization saved: chronos_o1_results.png")