Skip to content

Commit 28c80d5

Browse files
notebooks
1 parent a38b677 commit 28c80d5

3 files changed

Lines changed: 4467 additions & 449 deletions

File tree

examples/aptanet_finetuning_tutorial.ipynb

Lines changed: 137 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,16 @@
3636
},
3737
{
3838
"cell_type": "code",
39-
"execution_count": 40,
39+
"execution_count": 1,
4040
"id": "d4f7d00b",
41-
"metadata": {},
41+
"metadata": {
42+
"execution": {
43+
"iopub.execute_input": "2026-04-04T23:37:03.552084Z",
44+
"iopub.status.busy": "2026-04-04T23:37:03.551951Z",
45+
"iopub.status.idle": "2026-04-04T23:37:03.554781Z",
46+
"shell.execute_reply": "2026-04-04T23:37:03.554185Z"
47+
}
48+
},
4249
"outputs": [],
4350
"source": [
4451
"import warnings\n",
@@ -48,9 +55,16 @@
4855
},
4956
{
5057
"cell_type": "code",
51-
"execution_count": 41,
58+
"execution_count": 2,
5259
"id": "3737da88",
53-
"metadata": {},
60+
"metadata": {
61+
"execution": {
62+
"iopub.execute_input": "2026-04-04T23:37:03.556117Z",
63+
"iopub.status.busy": "2026-04-04T23:37:03.555978Z",
64+
"iopub.status.idle": "2026-04-04T23:37:20.131154Z",
65+
"shell.execute_reply": "2026-04-04T23:37:20.130642Z"
66+
}
67+
},
5468
"outputs": [],
5569
"source": [
5670
"import numpy as np\n",
@@ -61,15 +75,22 @@
6175
},
6276
{
6377
"cell_type": "code",
64-
"execution_count": 42,
78+
"execution_count": 3,
6579
"id": "a2f6701d",
66-
"metadata": {},
80+
"metadata": {
81+
"execution": {
82+
"iopub.execute_input": "2026-04-04T23:37:20.132910Z",
83+
"iopub.status.busy": "2026-04-04T23:37:20.132658Z",
84+
"iopub.status.idle": "2026-04-04T23:37:20.210792Z",
85+
"shell.execute_reply": "2026-04-04T23:37:20.210244Z"
86+
}
87+
},
6788
"outputs": [
6889
{
6990
"name": "stdout",
7091
"output_type": "stream",
7192
"text": [
72-
"Number of samples: 25\n"
93+
"Number of samples: 250\n"
7394
]
7495
}
7596
],
@@ -105,15 +126,22 @@
105126
},
106127
{
107128
"cell_type": "code",
108-
"execution_count": 43,
129+
"execution_count": 4,
109130
"id": "44cc1cbf",
110-
"metadata": {},
131+
"metadata": {
132+
"execution": {
133+
"iopub.execute_input": "2026-04-04T23:37:20.212145Z",
134+
"iopub.status.busy": "2026-04-04T23:37:20.211994Z",
135+
"iopub.status.idle": "2026-04-04T23:37:20.892765Z",
136+
"shell.execute_reply": "2026-04-04T23:37:20.892066Z"
137+
}
138+
},
111139
"outputs": [
112140
{
113141
"name": "stdout",
114142
"output_type": "stream",
115143
"text": [
116-
"Feature matrix shape: (25, 690)\n"
144+
"Feature matrix shape: (250, 690)\n"
117145
]
118146
}
119147
],
@@ -145,9 +173,16 @@
145173
},
146174
{
147175
"cell_type": "code",
148-
"execution_count": 44,
176+
"execution_count": 5,
149177
"id": "d782bca8",
150-
"metadata": {},
178+
"metadata": {
179+
"execution": {
180+
"iopub.execute_input": "2026-04-04T23:37:20.894377Z",
181+
"iopub.status.busy": "2026-04-04T23:37:20.894232Z",
182+
"iopub.status.idle": "2026-04-04T23:37:25.060475Z",
183+
"shell.execute_reply": "2026-04-04T23:37:25.059787Z"
184+
}
185+
},
151186
"outputs": [],
152187
"source": [
153188
"from sklearn.model_selection import GridSearchCV\n",
@@ -157,9 +192,16 @@
157192
},
158193
{
159194
"cell_type": "code",
160-
"execution_count": 45,
195+
"execution_count": 6,
161196
"id": "f8a0d947",
162-
"metadata": {},
197+
"metadata": {
198+
"execution": {
199+
"iopub.execute_input": "2026-04-04T23:37:25.062280Z",
200+
"iopub.status.busy": "2026-04-04T23:37:25.062030Z",
201+
"iopub.status.idle": "2026-04-04T23:37:25.066542Z",
202+
"shell.execute_reply": "2026-04-04T23:37:25.065999Z"
203+
}
204+
},
163205
"outputs": [
164206
{
165207
"name": "stdout",
@@ -196,9 +238,16 @@
196238
},
197239
{
198240
"cell_type": "code",
199-
"execution_count": 46,
241+
"execution_count": 7,
200242
"id": "ae896e5c",
201-
"metadata": {},
243+
"metadata": {
244+
"execution": {
245+
"iopub.execute_input": "2026-04-04T23:37:25.068145Z",
246+
"iopub.status.busy": "2026-04-04T23:37:25.067972Z",
247+
"iopub.status.idle": "2026-04-04T23:38:24.629169Z",
248+
"shell.execute_reply": "2026-04-04T23:38:24.628375Z"
249+
}
250+
},
202251
"outputs": [
203252
{
204253
"name": "stdout",
@@ -213,7 +262,7 @@
213262
"text": [
214263
"\n",
215264
"Best parameters: {'dropout': 0.2, 'hidden_dim': 64, 'lr': 0.0005, 'n_hidden': 7}\n",
216-
"Best cross-validation score: 0.6019\n"
265+
"Best cross-validation score: 0.5600\n"
217266
]
218267
}
219268
],
@@ -236,9 +285,16 @@
236285
},
237286
{
238287
"cell_type": "code",
239-
"execution_count": 47,
288+
"execution_count": 8,
240289
"id": "6130027a",
241-
"metadata": {},
290+
"metadata": {
291+
"execution": {
292+
"iopub.execute_input": "2026-04-04T23:38:24.631902Z",
293+
"iopub.status.busy": "2026-04-04T23:38:24.631466Z",
294+
"iopub.status.idle": "2026-04-04T23:38:24.634673Z",
295+
"shell.execute_reply": "2026-04-04T23:38:24.634089Z"
296+
}
297+
},
242298
"outputs": [],
243299
"source": [
244300
"from scipy.stats import loguniform, randint, uniform\n",
@@ -247,9 +303,16 @@
247303
},
248304
{
249305
"cell_type": "code",
250-
"execution_count": 48,
306+
"execution_count": 9,
251307
"id": "4a2e277e",
252-
"metadata": {},
308+
"metadata": {
309+
"execution": {
310+
"iopub.execute_input": "2026-04-04T23:38:24.636338Z",
311+
"iopub.status.busy": "2026-04-04T23:38:24.636164Z",
312+
"iopub.status.idle": "2026-04-04T23:38:24.641042Z",
313+
"shell.execute_reply": "2026-04-04T23:38:24.640374Z"
314+
}
315+
},
253316
"outputs": [],
254317
"source": [
255318
"# Define parameter distributions for random search\n",
@@ -279,18 +342,31 @@
279342
},
280343
{
281344
"cell_type": "code",
282-
"execution_count": 49,
345+
"execution_count": 10,
283346
"id": "8049a472",
284-
"metadata": {},
347+
"metadata": {
348+
"execution": {
349+
"iopub.execute_input": "2026-04-04T23:38:24.642734Z",
350+
"iopub.status.busy": "2026-04-04T23:38:24.642563Z",
351+
"iopub.status.idle": "2026-04-04T23:39:17.969297Z",
352+
"shell.execute_reply": "2026-04-04T23:39:17.968795Z"
353+
}
354+
},
285355
"outputs": [
286356
{
287357
"name": "stdout",
288358
"output_type": "stream",
289359
"text": [
290-
"Fitting 3 folds for each of 10 candidates, totalling 30 fits\n",
360+
"Fitting 3 folds for each of 10 candidates, totalling 30 fits\n"
361+
]
362+
},
363+
{
364+
"name": "stdout",
365+
"output_type": "stream",
366+
"text": [
291367
"\n",
292-
"Best parameters: {'dropout': np.float64(0.30990986410335564), 'hidden_dim': 128, 'lr': np.float64(1.9010245319870364e-05), 'max_epochs': 150, 'n_hidden': 8}\n",
293-
"Best cross-validation score: 0.6019\n"
368+
"Best parameters: {'dropout': np.float64(0.34044600469728353), 'hidden_dim': 256, 'lr': np.float64(0.00020034427927560734), 'max_epochs': 50, 'n_hidden': 4}\n",
369+
"Best cross-validation score: 0.5600\n"
294370
]
295371
}
296372
],
@@ -313,35 +389,49 @@
313389
},
314390
{
315391
"cell_type": "code",
316-
"execution_count": 50,
392+
"execution_count": 11,
317393
"id": "523f4ce6",
318-
"metadata": {},
394+
"metadata": {
395+
"execution": {
396+
"iopub.execute_input": "2026-04-04T23:39:17.970826Z",
397+
"iopub.status.busy": "2026-04-04T23:39:17.970656Z",
398+
"iopub.status.idle": "2026-04-04T23:39:17.973029Z",
399+
"shell.execute_reply": "2026-04-04T23:39:17.972577Z"
400+
}
401+
},
319402
"outputs": [],
320403
"source": [
321404
"from sklearn.metrics import accuracy_score, classification_report"
322405
]
323406
},
324407
{
325408
"cell_type": "code",
326-
"execution_count": 51,
409+
"execution_count": 12,
327410
"id": "0cf0bed1",
328-
"metadata": {},
411+
"metadata": {
412+
"execution": {
413+
"iopub.execute_input": "2026-04-04T23:39:17.974421Z",
414+
"iopub.status.busy": "2026-04-04T23:39:17.974278Z",
415+
"iopub.status.idle": "2026-04-04T23:39:18.063373Z",
416+
"shell.execute_reply": "2026-04-04T23:39:18.062801Z"
417+
}
418+
},
329419
"outputs": [
330420
{
331421
"name": "stdout",
332422
"output_type": "stream",
333423
"text": [
334-
"Training Accuracy: 0.6000\n",
424+
"Training Accuracy: 0.5600\n",
335425
"\n",
336426
"Classification Report:\n",
337427
" precision recall f1-score support\n",
338428
"\n",
339-
" 0.0 0.60 1.00 0.75 15\n",
340-
" 1.0 0.00 0.00 0.00 10\n",
429+
" 0.0 0.00 0.00 0.00 110\n",
430+
" 1.0 0.56 1.00 0.72 140\n",
341431
"\n",
342-
" accuracy 0.60 25\n",
343-
" macro avg 0.30 0.50 0.38 25\n",
344-
"weighted avg 0.36 0.60 0.45 25\n",
432+
" accuracy 0.56 250\n",
433+
" macro avg 0.28 0.50 0.36 250\n",
434+
"weighted avg 0.31 0.56 0.40 250\n",
345435
"\n"
346436
]
347437
}
@@ -369,15 +459,22 @@
369459
},
370460
{
371461
"cell_type": "code",
372-
"execution_count": 52,
462+
"execution_count": 13,
373463
"id": "1ed76399",
374-
"metadata": {},
464+
"metadata": {
465+
"execution": {
466+
"iopub.execute_input": "2026-04-04T23:39:18.065146Z",
467+
"iopub.status.busy": "2026-04-04T23:39:18.064996Z",
468+
"iopub.status.idle": "2026-04-04T23:39:20.496084Z",
469+
"shell.execute_reply": "2026-04-04T23:39:20.495442Z"
470+
}
471+
},
375472
"outputs": [
376473
{
377474
"name": "stdout",
378475
"output_type": "stream",
379476
"text": [
380-
"Pipeline Training Accuracy: 0.4000\n"
477+
"Pipeline Training Accuracy: 0.5600\n"
381478
]
382479
}
383480
],
@@ -430,7 +527,7 @@
430527
"name": "python",
431528
"nbconvert_exporter": "python",
432529
"pygments_lexer": "ipython3",
433-
"version": "3.11.9"
530+
"version": "3.12.3"
434531
}
435532
},
436533
"nbformat": 4,

0 commit comments

Comments
 (0)