|
2 | 2 | "cells": [ |
3 | 3 | { |
4 | 4 | "cell_type": "code", |
5 | | - "execution_count": 1, |
| 5 | + "execution_count": 50, |
6 | 6 | "metadata": {}, |
7 | 7 | "outputs": [], |
8 | 8 | "source": [ |
9 | 9 | "import numpy as np\n", |
10 | 10 | "import pandas as pd\n", |
11 | 11 | "from sklearn.cluster import KMeans\n", |
12 | | - "import math\n", |
13 | 12 | "import csv\n", |
14 | 13 | "import math\n", |
15 | 14 | "import matplotlib.pyplot\n", |
|
19 | 18 | }, |
20 | 19 | { |
21 | 20 | "cell_type": "code", |
22 | | - "execution_count": 2, |
| 21 | + "execution_count": 51, |
23 | 22 | "metadata": {}, |
24 | 23 | "outputs": [], |
25 | 24 | "source": [ |
|
36 | 35 | }, |
37 | 36 | { |
38 | 37 | "cell_type": "code", |
39 | | - "execution_count": 3, |
| 38 | + "execution_count": 52, |
40 | 39 | "metadata": {}, |
41 | 40 | "outputs": [], |
42 | 41 | "source": [ |
|
152 | 151 | }, |
153 | 152 | { |
154 | 153 | "cell_type": "code", |
155 | | - "execution_count": 23, |
| 154 | + "execution_count": 53, |
156 | 155 | "metadata": {}, |
157 | 156 | "outputs": [], |
158 | 157 | "source": [ |
|
210 | 209 | }, |
211 | 210 | { |
212 | 211 | "cell_type": "code", |
213 | | - "execution_count": 24, |
| 212 | + "execution_count": 54, |
214 | 213 | "metadata": {}, |
215 | 214 | "outputs": [], |
216 | 215 | "source": [ |
|
235 | 234 | }, |
236 | 235 | { |
237 | 236 | "cell_type": "code", |
238 | | - "execution_count": 25, |
| 237 | + "execution_count": 55, |
239 | 238 | "metadata": {}, |
240 | 239 | "outputs": [], |
241 | 240 | "source": [ |
|
249 | 248 | " L_Erms_Val = []\n", |
250 | 249 | " L_Erms_TR = []\n", |
251 | 250 | " L_Erms_Test = []\n", |
| 251 | + " L_Acc_Val = []\n", |
| 252 | + " L_Acc_TR = []\n", |
| 253 | + " L_Acc_Test = []\n", |
252 | 254 | " W_Mat = []\n", |
253 | 255 | "\n", |
254 | 256 | " for i in range(0,_loop_range):\n", |
|
269 | 271 | " #-----------------TrainingData Accuracy---------------------#\n", |
270 | 272 | " TR_TEST_OUT = GetValTest( _TRAINING_PHI, W_T_Next) \n", |
271 | 273 | " Erms_TR = GetErms(TR_TEST_OUT, _TrainingTarget)\n", |
| 274 | + " L_Acc_TR.append(float(Erms_TR.split(',')[0]))\n", |
272 | 275 | " L_Erms_TR.append(float(Erms_TR.split(',')[1]))\n", |
273 | 276 | "\n", |
274 | 277 | " #-----------------ValidationData Accuracy---------------------#\n", |
275 | 278 | " VAL_TEST_OUT = GetValTest( _VAL_PHI, W_T_Next) \n", |
276 | 279 | " Erms_Val = GetErms(VAL_TEST_OUT, _ValDataAct)\n", |
| 280 | + " L_Acc_Val.append(float(Erms_Val.split(',')[0]))\n", |
277 | 281 | " L_Erms_Val.append(float(Erms_Val.split(',')[1]))\n", |
278 | 282 | "\n", |
279 | 283 | " #-----------------TestingData Accuracy---------------------#\n", |
280 | 284 | " TEST_OUT = GetValTest( _TEST_PHI, W_T_Next) \n", |
281 | 285 | " Erms_Test = GetErms(TEST_OUT, _TestDataAct)\n", |
| 286 | + " L_Acc_Test.append(float(Erms_Test.split(',')[0]))\n", |
282 | 287 | " L_Erms_Test.append(float(Erms_Test.split(',')[1]))\n", |
283 | 288 | " \n", |
284 | 289 | " print ('----------Gradient Descent Solution--------------------')\n", |
285 | 290 | " print (\"E_rms Training = \" + str(np.around(min(L_Erms_TR),5)))\n", |
286 | 291 | " print (\"E_rms Validation = \" + str(np.around(min(L_Erms_Val),5)))\n", |
287 | | - " print (\"E_rms Testing = \" + str(np.around(min(L_Erms_Test),5)))" |
| 292 | + " print (\"E_rms Testing = \" + str(np.around(min(L_Erms_Test),5)))\n", |
| 293 | + " print (\"Accuracy Training = \" + str(np.around(max(L_Acc_TR),5)))\n", |
| 294 | + " print (\"Accuracy Validation = \" + str(np.around(max(L_Acc_Val),5)))\n", |
| 295 | + " print (\"Accuracy Testing = \" + str(np.around(max(L_Acc_Test),5)))" |
288 | 296 | ] |
289 | 297 | }, |
290 | 298 | { |
|
296 | 304 | }, |
297 | 305 | { |
298 | 306 | "cell_type": "code", |
299 | | - "execution_count": 26, |
| 307 | + "execution_count": 56, |
300 | 308 | "metadata": {}, |
301 | 309 | "outputs": [], |
302 | 310 | "source": [ |
|
308 | 316 | }, |
309 | 317 | { |
310 | 318 | "cell_type": "code", |
311 | | - "execution_count": 27, |
| 319 | + "execution_count": 57, |
312 | 320 | "metadata": {}, |
313 | 321 | "outputs": [], |
314 | 322 | "source": [ |
|
333 | 341 | }, |
334 | 342 | { |
335 | 343 | "cell_type": "code", |
336 | | - "execution_count": 28, |
| 344 | + "execution_count": 58, |
337 | 345 | "metadata": {}, |
338 | 346 | "outputs": [ |
339 | 347 | { |
|
356 | 364 | "Testing Phi: (157, 5)\n", |
357 | 365 | "Validation Phi: (158, 5)\n", |
358 | 366 | "----------Gradient Descent Solution--------------------\n", |
359 | | - "E_rms Training = 0.49933\n", |
360 | | - "E_rms Validation = 0.49939\n", |
361 | | - "E_rms Testing = 0.47696\n" |
| 367 | + "E_rms Training = 0.49923\n", |
| 368 | + "E_rms Validation = 0.49557\n", |
| 369 | + "E_rms Testing = 0.4937\n", |
| 370 | + "Accuracy Training = 54.58136\n", |
| 371 | + "Accuracy Validation = 56.96203\n", |
| 372 | + "Accuracy Testing = 59.87261\n" |
362 | 373 | ] |
363 | 374 | } |
364 | 375 | ], |
|
378 | 389 | }, |
379 | 390 | { |
380 | 391 | "cell_type": "code", |
381 | | - "execution_count": 29, |
| 392 | + "execution_count": 59, |
382 | 393 | "metadata": {}, |
383 | 394 | "outputs": [ |
384 | 395 | { |
|
401 | 412 | "Testing Phi: (157, 5)\n", |
402 | 413 | "Validation Phi: (158, 5)\n", |
403 | 414 | "----------Gradient Descent Solution--------------------\n", |
404 | | - "E_rms Training = 0.49949\n", |
405 | | - "E_rms Validation = 0.49925\n", |
406 | | - "E_rms Testing = 0.47915\n" |
| 415 | + "E_rms Training = 0.49978\n", |
| 416 | + "E_rms Validation = 0.49704\n", |
| 417 | + "E_rms Testing = 0.49491\n", |
| 418 | + "Accuracy Training = 51.73776\n", |
| 419 | + "Accuracy Validation = 55.6962\n", |
| 420 | + "Accuracy Testing = 57.96178\n" |
407 | 421 | ] |
408 | 422 | } |
409 | 423 | ], |
|
427 | 441 | }, |
428 | 442 | { |
429 | 443 | "cell_type": "code", |
430 | | - "execution_count": 30, |
| 444 | + "execution_count": 60, |
431 | 445 | "metadata": {}, |
432 | 446 | "outputs": [], |
433 | 447 | "source": [ |
|
439 | 453 | }, |
440 | 454 | { |
441 | 455 | "cell_type": "code", |
442 | | - "execution_count": 31, |
| 456 | + "execution_count": 73, |
443 | 457 | "metadata": {}, |
444 | 458 | "outputs": [], |
445 | 459 | "source": [ |
|
462 | 476 | }, |
463 | 477 | { |
464 | 478 | "cell_type": "code", |
465 | | - "execution_count": 18, |
| 479 | + "execution_count": null, |
466 | 480 | "metadata": {}, |
467 | 481 | "outputs": [ |
468 | 482 | { |
|
480 | 494 | "Validation Data: (1017, 14306)\n", |
481 | 495 | "Testing Target: (14305,)\n", |
482 | 496 | "Testing Data: (1017, 14305)\n", |
483 | | - "BigSigma: (1017, 1017)\n", |
484 | | - "Training Phi: (114450, 5)\n", |
485 | | - "Testing Phi: (14305, 5)\n", |
486 | | - "Validation Phi: (14306, 5)\n", |
487 | | - "----------Gradient Descent Solution--------------------\n", |
488 | | - "E_rms Training = 0.54717\n", |
489 | | - "E_rms Validation = 0.55033\n", |
490 | | - "E_rms Testing = 0.55555\n" |
| 497 | + "BigSigma: (1017, 1017)\n" |
491 | 498 | ] |
492 | 499 | } |
493 | 500 | ], |
|
508 | 515 | }, |
509 | 516 | { |
510 | 517 | "cell_type": "code", |
511 | | - "execution_count": 32, |
| 518 | + "execution_count": null, |
512 | 519 | "metadata": {}, |
513 | | - "outputs": [ |
514 | | - { |
515 | | - "name": "stdout", |
516 | | - "output_type": "stream", |
517 | | - "text": [ |
518 | | - "=========================\n", |
519 | | - "====== GSC Data =========\n", |
520 | | - "==== Subtraction ======\n", |
521 | | - "=========================\n", |
522 | | - "RawData : (509, 143062)\n", |
523 | | - "Training Target: (114450,)\n", |
524 | | - "Training Data: (509, 114450)\n", |
525 | | - "Validation Target: (14306,)\n", |
526 | | - "Validation Data: (509, 14306)\n", |
527 | | - "Testing Target: (14305,)\n", |
528 | | - "Testing Data: (509, 14305)\n", |
529 | | - "BigSigma: (509, 509)\n", |
530 | | - "Training Phi: (114450, 5)\n", |
531 | | - "Testing Phi: (14305, 5)\n", |
532 | | - "Validation Phi: (14306, 5)\n", |
533 | | - "----------Gradient Descent Solution--------------------\n", |
534 | | - "E_rms Training = 0.52324\n", |
535 | | - "E_rms Validation = 0.5284\n", |
536 | | - "E_rms Testing = 0.52343\n" |
537 | | - ] |
538 | | - } |
539 | | - ], |
| 520 | + "outputs": [], |
540 | 521 | "source": [ |
541 | 522 | "# Now we are merging the image specifications with the dataset, we will use this dataset to train\n", |
542 | 523 | "# test or validate data.\n", |
|
0 commit comments