|
36 | 36 | }, |
37 | 37 | { |
38 | 38 | "cell_type": "code", |
39 | | - "execution_count": 40, |
| 39 | + "execution_count": 1, |
40 | 40 | "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 | + }, |
42 | 49 | "outputs": [], |
43 | 50 | "source": [ |
44 | 51 | "import warnings\n", |
|
48 | 55 | }, |
49 | 56 | { |
50 | 57 | "cell_type": "code", |
51 | | - "execution_count": 41, |
| 58 | + "execution_count": 2, |
52 | 59 | "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 | + }, |
54 | 68 | "outputs": [], |
55 | 69 | "source": [ |
56 | 70 | "import numpy as np\n", |
|
61 | 75 | }, |
62 | 76 | { |
63 | 77 | "cell_type": "code", |
64 | | - "execution_count": 42, |
| 78 | + "execution_count": 3, |
65 | 79 | "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 | + }, |
67 | 88 | "outputs": [ |
68 | 89 | { |
69 | 90 | "name": "stdout", |
70 | 91 | "output_type": "stream", |
71 | 92 | "text": [ |
72 | | - "Number of samples: 25\n" |
| 93 | + "Number of samples: 250\n" |
73 | 94 | ] |
74 | 95 | } |
75 | 96 | ], |
|
105 | 126 | }, |
106 | 127 | { |
107 | 128 | "cell_type": "code", |
108 | | - "execution_count": 43, |
| 129 | + "execution_count": 4, |
109 | 130 | "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 | + }, |
111 | 139 | "outputs": [ |
112 | 140 | { |
113 | 141 | "name": "stdout", |
114 | 142 | "output_type": "stream", |
115 | 143 | "text": [ |
116 | | - "Feature matrix shape: (25, 690)\n" |
| 144 | + "Feature matrix shape: (250, 690)\n" |
117 | 145 | ] |
118 | 146 | } |
119 | 147 | ], |
|
145 | 173 | }, |
146 | 174 | { |
147 | 175 | "cell_type": "code", |
148 | | - "execution_count": 44, |
| 176 | + "execution_count": 5, |
149 | 177 | "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 | + }, |
151 | 186 | "outputs": [], |
152 | 187 | "source": [ |
153 | 188 | "from sklearn.model_selection import GridSearchCV\n", |
|
157 | 192 | }, |
158 | 193 | { |
159 | 194 | "cell_type": "code", |
160 | | - "execution_count": 45, |
| 195 | + "execution_count": 6, |
161 | 196 | "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 | + }, |
163 | 205 | "outputs": [ |
164 | 206 | { |
165 | 207 | "name": "stdout", |
|
196 | 238 | }, |
197 | 239 | { |
198 | 240 | "cell_type": "code", |
199 | | - "execution_count": 46, |
| 241 | + "execution_count": 7, |
200 | 242 | "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 | + }, |
202 | 251 | "outputs": [ |
203 | 252 | { |
204 | 253 | "name": "stdout", |
|
213 | 262 | "text": [ |
214 | 263 | "\n", |
215 | 264 | "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" |
217 | 266 | ] |
218 | 267 | } |
219 | 268 | ], |
|
236 | 285 | }, |
237 | 286 | { |
238 | 287 | "cell_type": "code", |
239 | | - "execution_count": 47, |
| 288 | + "execution_count": 8, |
240 | 289 | "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 | + }, |
242 | 298 | "outputs": [], |
243 | 299 | "source": [ |
244 | 300 | "from scipy.stats import loguniform, randint, uniform\n", |
|
247 | 303 | }, |
248 | 304 | { |
249 | 305 | "cell_type": "code", |
250 | | - "execution_count": 48, |
| 306 | + "execution_count": 9, |
251 | 307 | "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 | + }, |
253 | 316 | "outputs": [], |
254 | 317 | "source": [ |
255 | 318 | "# Define parameter distributions for random search\n", |
|
279 | 342 | }, |
280 | 343 | { |
281 | 344 | "cell_type": "code", |
282 | | - "execution_count": 49, |
| 345 | + "execution_count": 10, |
283 | 346 | "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 | + }, |
285 | 355 | "outputs": [ |
286 | 356 | { |
287 | 357 | "name": "stdout", |
288 | 358 | "output_type": "stream", |
289 | 359 | "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": [ |
291 | 367 | "\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" |
294 | 370 | ] |
295 | 371 | } |
296 | 372 | ], |
|
313 | 389 | }, |
314 | 390 | { |
315 | 391 | "cell_type": "code", |
316 | | - "execution_count": 50, |
| 392 | + "execution_count": 11, |
317 | 393 | "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 | + }, |
319 | 402 | "outputs": [], |
320 | 403 | "source": [ |
321 | 404 | "from sklearn.metrics import accuracy_score, classification_report" |
322 | 405 | ] |
323 | 406 | }, |
324 | 407 | { |
325 | 408 | "cell_type": "code", |
326 | | - "execution_count": 51, |
| 409 | + "execution_count": 12, |
327 | 410 | "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 | + }, |
329 | 419 | "outputs": [ |
330 | 420 | { |
331 | 421 | "name": "stdout", |
332 | 422 | "output_type": "stream", |
333 | 423 | "text": [ |
334 | | - "Training Accuracy: 0.6000\n", |
| 424 | + "Training Accuracy: 0.5600\n", |
335 | 425 | "\n", |
336 | 426 | "Classification Report:\n", |
337 | 427 | " precision recall f1-score support\n", |
338 | 428 | "\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", |
341 | 431 | "\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", |
345 | 435 | "\n" |
346 | 436 | ] |
347 | 437 | } |
|
369 | 459 | }, |
370 | 460 | { |
371 | 461 | "cell_type": "code", |
372 | | - "execution_count": 52, |
| 462 | + "execution_count": 13, |
373 | 463 | "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 | + }, |
375 | 472 | "outputs": [ |
376 | 473 | { |
377 | 474 | "name": "stdout", |
378 | 475 | "output_type": "stream", |
379 | 476 | "text": [ |
380 | | - "Pipeline Training Accuracy: 0.4000\n" |
| 477 | + "Pipeline Training Accuracy: 0.5600\n" |
381 | 478 | ] |
382 | 479 | } |
383 | 480 | ], |
|
430 | 527 | "name": "python", |
431 | 528 | "nbconvert_exporter": "python", |
432 | 529 | "pygments_lexer": "ipython3", |
433 | | - "version": "3.11.9" |
| 530 | + "version": "3.12.3" |
434 | 531 | } |
435 | 532 | }, |
436 | 533 | "nbformat": 4, |
|
0 commit comments