-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathtest.ts
More file actions
151 lines (150 loc) · 4.54 KB
/
test.ts
File metadata and controls
151 lines (150 loc) · 4.54 KB
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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
const decisionBoundaryPlot = {
data: [
// Heatmap for decision boundaries (simulated grid of class predictions)
{
z: [
[0, 0, 0, 0, 1, 1, 1, 1],
[0, 0, 0, 1, 1, 1, 1, 1],
[0, 0, 0, 1, 1, 2, 2, 2],
[0, 0, 1, 1, 2, 2, 2, 2],
[0, 0, 1, 2, 2, 2, 2, 2],
[0, 1, 1, 2, 2, 2, 2, 2],
[1, 1, 2, 2, 2, 2, 2, 2],
[1, 1, 2, 2, 2, 2, 2, 2],
], // Grid of class labels (0, 1, 2) simulating neural network predictions
x: [-2, -1.5, -1, -0.5, 0, 0.5, 1, 1.5], // X coordinates for heatmap grid
y: [-2, -1.5, -1, -0.5, 0, 0.5, 1, 1.5], // Y coordinates for heatmap grid
type: "heatmap",
colorscale: [
[0, "#7aa2a1"], // Lighter shade of Catppuccin Green for Class 0 region
[0.5, "#8a9efe"], // Lighter shade of Catppuccin Lavender for Class 1 region
[1, "#ab86f7"], // Lighter shade of Catppuccin Mauve for Class 2 region
],
showscale: false, // Hide color scale bar since legend will show class info
opacity: 0.5, // Semi-transparent to allow overlap visibility with scatter points
},
// Scatter plot for three sets of data points
{
x: [-1.5, -1, -0.5, -1.2, -0.8],
y: [-1.5, -1, -1.2, -0.5, -0.8],
type: "scatter",
mode: "markers",
name: "Class 0 (Green)",
marker: {
color: "#a6e3a1", // Catppuccin Green for first set of dots
size: 10,
line: {
color: "#cdd6f4", // Catppuccin Text for outline
width: 1,
},
},
},
{
x: [0.5, 0, -0.5, 0.2, -0.2],
y: [0.5, 1, 0, 0.8, -0.5],
type: "scatter",
mode: "markers",
name: "Class 1 (Lavender)",
marker: {
color: "#b4befe", // Catppuccin Lavender for second set of dots
size: 10,
line: {
color: "#cdd6f4", // Catppuccin Text for outline
width: 1,
},
},
},
{
x: [1, 1.5, 0.8, 1.2, 0.5],
y: [0.5, 1, 1.5, -0.5, 1.2],
type: "scatter",
mode: "markers",
name: "Class 2 (Mauve)",
marker: {
color: "#cba6f7", // Catppuccin Mauve for third set of dots
size: 10,
line: {
color: "#cdd6f4", // Catppuccin Text for outline
width: 1,
},
},
},
],
layout: {
title: {
text: "Scatter Plot with Decision Boundaries",
x: 0.5,
xanchor: "center",
font: {
family: "Roboto Mono, Fira Code, monospace",
size: 20,
color: "#cdd6f4", // Catppuccin Text for readability
},
},
xaxis: {
title: {
text: "Feature 1",
font: {
family: "Roboto Mono, Fira Code, monospace",
size: 14,
color: "#cdd6f4", // Catppuccin Text
},
},
gridcolor: "#45475a", // Catppuccin Surface1 for subtle grid
linecolor: "#45475a", // Catppuccin Surface1 for axis line
ticks: "outside",
tickfont: {
family: "Roboto Mono, Fira Code, monospace",
size: 12,
color: "#cdd6f4", // Catppuccin Text
},
range: [-2, 2], // Set range to cover the grid
},
yaxis: {
title: {
text: "Feature 2",
font: {
family: "Roboto Mono, Fira Code, monospace",
size: 14,
color: "#cdd6f4", // Catppuccin Text
},
},
gridcolor: "#45475a", // Catppuccin Surface1 for subtle grid
linecolor: "#45475a", // Catppuccin Surface1 for axis line
ticks: "outside",
tickfont: {
family: "Roboto Mono, Fira Code, monospace",
size: 12,
color: "#cdd6f4", // Catppuccin Text
},
range: [-2, 2], // Set range to cover the grid
},
width: 1080,
height: 810,
plot_bgcolor: "#1e1e2e", // Catppuccin Base for dark background (plot area)
paper_bgcolor: "#1e1e2e", // Catppuccin Base for surrounding area
font: {
family: "Roboto Mono, Fira Code, monospace",
color: "#cdd6f4", // Catppuccin Text as default font color
},
showlegend: true,
legend: {
font: {
family: "Roboto Mono, Fira Code, monospace",
size: 12,
color: "#cdd6f4", // Catppuccin Text
},
bgcolor: "#313244", // Catppuccin Surface0 for slightly lighter legend background
bordercolor: "#45475a", // Catppuccin Surface1 for border
borderwidth: 1,
x: 1,
xanchor: "right",
y: 1,
},
},
config: {
responsive: true,
staticPlot: true, // Disable interactivity for static screenshots
},
};
console.log(JSON.stringify(decisionBoundaryPlot, null, 2));