In [1]:
import os
# Change to parent dir to allow importation of modules
if os.path.split(os.getcwd())[1] != 'CITS4404':
os.chdir('..')
from eLCS.Timer import Timer
from eLCS.OfflineEnvironment import OfflineEnvironment
from eLCS.Algorithm import Algorithm
from eLCS.Constants import cons
"""To run e-LCS, run this module.
A properly formatted configuration file, including all run parameters must be included with the path to that
file given below. In this example, the configuration file has been included locally, so only the file name is required.
"""
helpstr = """Failed attempt to run e-LCS. Please ensure that a configuration file giving all run parameters has been specified."""
# Specify the name and file path for the configuration file.
config_txt = os.path.join('config', 'eLCS_config.yaml')
# Obtain all run parameters from the configuration file and store them in the 'Constants' module.
dataset_path = os.path.join('data', 'eLCS')
cons.setConstants(config_txt, dataset_path=dataset_path)
# Initialize the 'Timer' module which tracks the run time of algorithm and it's different components.
timer = Timer()
cons.referenceTimer(timer)
# Initialize the 'Environment' module which manages the data presented to the algorithm. While e-LCS learns iteratively (one inistance at a time
env = OfflineEnvironment()
cons.referenceEnv(
env) # Passes the environment to 'Constants' (cons) so that it can be easily accessed from anywhere within the code.
cons.parseIterations() # Identify the maximum number of learning iterations as well as evaluation checkpoints.
# Run the e-LCS algorithm.
eLCS = Algorithm()
# Get the output of runtime parameters from the eLCS
runtimeParams = eLCS.getRuntimeParams()
----------------------------------------------------------------------------
eLCS Code Demo 5: The Complete eLCS Algorithm - Niche GA + Subsumption
----------------------------------------------------------------------------
Environment: Formatting Data...
DataManagement: Loading Data... data/eLCS/6Multiplexer_Data_Complete.txt
DataManagement: Phenotype Column Location = 6
DataManagement: Number of Attributes = 6
DataManagement: Number of Instances = 64
DataManagement: Analyzing Phenotype...
DataManagement: Phenotype Detected as Discrete.
DataManagement: Detecting Classes...
DataManagement: Following Classes Detected:['0', '1']
Class: 0 count = 32
Class: 1 count = 32
DataManagement: Detecting Attributes...
DataManagement: Identified 6 discrete and 0 continuous attributes.
DataManagement: Characterizing Attributes...
----------------------------------------------------------------------------
eLCS: Initializing Algorithm...
Learning Checkpoints: [5000, 10000]
Maximum Iterations: 10000
Beginning eLCS learning iterations.
------------------------------------------------------------------------------------------------------------------------------------------------------
Epoch: 1 Iteration: 64 MacroPop: 30 MicroPop: 32 AccEstimate: 0.6875 AveGen: 0.4895833333333333 Time: 9.662310282389323e-05
Epoch: 2 Iteration: 128 MacroPop: 45 MicroPop: 64 AccEstimate: 0.796875 AveGen: 0.484375 Time: 0.00020528237024943033
Epoch: 3 Iteration: 192 MacroPop: 65 MicroPop: 98 AccEstimate: 0.8125 AveGen: 0.48809523809523797 Time: 0.00033968687057495117
Epoch: 4 Iteration: 256 MacroPop: 73 MicroPop: 122 AccEstimate: 0.765625 AveGen: 0.49453551912568305 Time: 0.0005188981691996256
Epoch: 5 Iteration: 320 MacroPop: 82 MicroPop: 142 AccEstimate: 0.78125 AveGen: 0.5046948356807512 Time: 0.0007106820742289225
Epoch: 6 Iteration: 384 MacroPop: 83 MicroPop: 166 AccEstimate: 0.828125 AveGen: 0.5230923694779115 Time: 0.0009011427561442057
Epoch: 7 Iteration: 448 MacroPop: 99 MicroPop: 197 AccEstimate: 0.828125 AveGen: 0.5346869712351944 Time: 0.0011168281237284342
Epoch: 8 Iteration: 512 MacroPop: 112 MicroPop: 225 AccEstimate: 0.859375 AveGen: 0.5459259259259258 Time: 0.0013681888580322266
Epoch: 9 Iteration: 576 MacroPop: 122 MicroPop: 249 AccEstimate: 0.890625 AveGen: 0.544176706827309 Time: 0.0016385197639465332
Epoch: 10 Iteration: 640 MacroPop: 130 MicroPop: 275 AccEstimate: 0.890625 AveGen: 0.5436363636363634 Time: 0.0019282023111979166
Epoch: 11 Iteration: 704 MacroPop: 135 MicroPop: 299 AccEstimate: 0.890625 AveGen: 0.5457079152731323 Time: 0.0022458751996358235
Epoch: 12 Iteration: 768 MacroPop: 141 MicroPop: 325 AccEstimate: 0.90625 AveGen: 0.5558974358974356 Time: 0.0025641759236653644
Epoch: 13 Iteration: 832 MacroPop: 147 MicroPop: 347 AccEstimate: 0.90625 AveGen: 0.5557156580211334 Time: 0.0028789242108662925
Epoch: 14 Iteration: 896 MacroPop: 154 MicroPop: 371 AccEstimate: 0.90625 AveGen: 0.554806828391734 Time: 0.0032089551289876304
Epoch: 15 Iteration: 960 MacroPop: 154 MicroPop: 383 AccEstimate: 0.921875 AveGen: 0.557006092254134 Time: 0.0035348018010457356
Epoch: 16 Iteration: 1024 MacroPop: 159 MicroPop: 402 AccEstimate: 0.9375 AveGen: 0.5572139303482587 Time: 0.00386199951171875
Epoch: 17 Iteration: 1088 MacroPop: 162 MicroPop: 418 AccEstimate: 0.9375 AveGen: 0.5582137161084529 Time: 0.004188251495361328
Epoch: 18 Iteration: 1152 MacroPop: 164 MicroPop: 438 AccEstimate: 0.96875 AveGen: 0.5566971080669713 Time: 0.004534069697062174
Epoch: 19 Iteration: 1216 MacroPop: 172 MicroPop: 464 AccEstimate: 0.96875 AveGen: 0.5574712643678161 Time: 0.0049201289812723795
Epoch: 20 Iteration: 1280 MacroPop: 177 MicroPop: 488 AccEstimate: 0.984375 AveGen: 0.5590846994535517 Time: 0.005286423365275065
Epoch: 21 Iteration: 1344 MacroPop: 181 MicroPop: 506 AccEstimate: 1.0 AveGen: 0.5606060606060603 Time: 0.0056540091832478845
Epoch: 22 Iteration: 1408 MacroPop: 182 MicroPop: 526 AccEstimate: 0.984375 AveGen: 0.5627376425855509 Time: 0.006022405624389648
Epoch: 23 Iteration: 1472 MacroPop: 185 MicroPop: 546 AccEstimate: 0.984375 AveGen: 0.5625763125763124 Time: 0.006394116083780924
Epoch: 24 Iteration: 1536 MacroPop: 187 MicroPop: 568 AccEstimate: 1.0 AveGen: 0.5622065727699528 Time: 0.0067829728126525875
Epoch: 25 Iteration: 1600 MacroPop: 194 MicroPop: 590 AccEstimate: 1.0 AveGen: 0.5627118644067796 Time: 0.007170883814493815
Epoch: 26 Iteration: 1664 MacroPop: 197 MicroPop: 608 AccEstimate: 1.0 AveGen: 0.5633223684210524 Time: 0.007562696933746338
Epoch: 27 Iteration: 1728 MacroPop: 201 MicroPop: 632 AccEstimate: 1.0 AveGen: 0.5627637130801687 Time: 0.007993634541829426
Epoch: 28 Iteration: 1792 MacroPop: 201 MicroPop: 652 AccEstimate: 1.0 AveGen: 0.5626278118609406 Time: 0.008413128058115641
Epoch: 29 Iteration: 1856 MacroPop: 205 MicroPop: 672 AccEstimate: 1.0 AveGen: 0.5632440476190476 Time: 0.00886156956354777
Epoch: 30 Iteration: 1920 MacroPop: 205 MicroPop: 692 AccEstimate: 1.0 AveGen: 0.5631021194605009 Time: 0.009288318951924642
Epoch: 31 Iteration: 1984 MacroPop: 206 MicroPop: 716 AccEstimate: 1.0 AveGen: 0.5630819366852885 Time: 0.0097176988919576
Epoch: 32 Iteration: 2048 MacroPop: 210 MicroPop: 738 AccEstimate: 1.0 AveGen: 0.5639114724480577 Time: 0.010137828191121419
Epoch: 33 Iteration: 2112 MacroPop: 211 MicroPop: 762 AccEstimate: 1.0 AveGen: 0.5632108486439196 Time: 0.010558152198791504
Epoch: 34 Iteration: 2176 MacroPop: 214 MicroPop: 786 AccEstimate: 1.0 AveGen: 0.5623409669211197 Time: 0.010987516244252522
Epoch: 35 Iteration: 2240 MacroPop: 218 MicroPop: 806 AccEstimate: 1.0 AveGen: 0.5626550868486353 Time: 0.011417710781097412
Epoch: 36 Iteration: 2304 MacroPop: 219 MicroPop: 824 AccEstimate: 1.0 AveGen: 0.5620954692556636 Time: 0.011849335829416911
Epoch: 37 Iteration: 2368 MacroPop: 221 MicroPop: 846 AccEstimate: 1.0 AveGen: 0.5624507486209614 Time: 0.01229470173517863
Epoch: 38 Iteration: 2432 MacroPop: 224 MicroPop: 867 AccEstimate: 1.0 AveGen: 0.5628604382929643 Time: 0.012768236796061198
Epoch: 39 Iteration: 2496 MacroPop: 225 MicroPop: 887 AccEstimate: 1.0 AveGen: 0.5627583615182262 Time: 0.013213765621185303
Epoch: 40 Iteration: 2560 MacroPop: 227 MicroPop: 899 AccEstimate: 1.0 AveGen: 0.5626622172784576 Time: 0.013652257124582927
Epoch: 41 Iteration: 2624 MacroPop: 232 MicroPop: 921 AccEstimate: 1.0 AveGen: 0.561708288092653 Time: 0.01410826047261556
Epoch: 42 Iteration: 2688 MacroPop: 233 MicroPop: 941 AccEstimate: 1.0 AveGen: 0.5616365568544103 Time: 0.014563576380411784
Epoch: 43 Iteration: 2752 MacroPop: 236 MicroPop: 969 AccEstimate: 1.0 AveGen: 0.5615755073959409 Time: 0.015026525656382243
Epoch: 44 Iteration: 2816 MacroPop: 240 MicroPop: 993 AccEstimate: 1.0 AveGen: 0.5605908022826455 Time: 0.015494402249654133
Epoch: 45 Iteration: 2880 MacroPop: 239 MicroPop: 1000 AccEstimate: 1.0 AveGen: 0.5608333333333335 Time: 0.016041040420532227
Epoch: 46 Iteration: 2944 MacroPop: 237 MicroPop: 1000 AccEstimate: 1.0 AveGen: 0.5611666666666667 Time: 0.016560188929239907
Epoch: 47 Iteration: 3008 MacroPop: 233 MicroPop: 1000 AccEstimate: 1.0 AveGen: 0.5606666666666669 Time: 0.017118350664774577
Epoch: 48 Iteration: 3072 MacroPop: 228 MicroPop: 1000 AccEstimate: 1.0 AveGen: 0.5605000000000001 Time: 0.017686291535695394
Epoch: 49 Iteration: 3136 MacroPop: 228 MicroPop: 1000 AccEstimate: 1.0 AveGen: 0.5595000000000001 Time: 0.01818668842315674
Epoch: 50 Iteration: 3200 MacroPop: 225 MicroPop: 1000 AccEstimate: 1.0 AveGen: 0.5598333333333336 Time: 0.018693423271179198
Epoch: 51 Iteration: 3264 MacroPop: 222 MicroPop: 1000 AccEstimate: 1.0 AveGen: 0.5583333333333335 Time: 0.019193847974141438
Epoch: 52 Iteration: 3328 MacroPop: 223 MicroPop: 1000 AccEstimate: 1.0 AveGen: 0.5588333333333334 Time: 0.01972452402114868
Epoch: 53 Iteration: 3392 MacroPop: 225 MicroPop: 1000 AccEstimate: 1.0 AveGen: 0.5578333333333334 Time: 0.0202323317527771
Epoch: 54 Iteration: 3456 MacroPop: 226 MicroPop: 1000 AccEstimate: 1.0 AveGen: 0.5569999999999999 Time: 0.0207235058148702
Epoch: 55 Iteration: 3520 MacroPop: 227 MicroPop: 1000 AccEstimate: 1.0 AveGen: 0.5566666666666668 Time: 0.021219960848490396
Epoch: 56 Iteration: 3584 MacroPop: 224 MicroPop: 1000 AccEstimate: 1.0 AveGen: 0.5571666666666667 Time: 0.02177496353785197
Epoch: 57 Iteration: 3648 MacroPop: 223 MicroPop: 1000 AccEstimate: 1.0 AveGen: 0.5570000000000003 Time: 0.02227387030919393
Epoch: 58 Iteration: 3712 MacroPop: 221 MicroPop: 1000 AccEstimate: 1.0 AveGen: 0.5570000000000003 Time: 0.02278639078140259
Epoch: 59 Iteration: 3776 MacroPop: 216 MicroPop: 1000 AccEstimate: 1.0 AveGen: 0.556666666666667 Time: 0.023281057675679524
Epoch: 60 Iteration: 3840 MacroPop: 218 MicroPop: 1000 AccEstimate: 1.0 AveGen: 0.5555000000000002 Time: 0.02377548615137736
Epoch: 61 Iteration: 3904 MacroPop: 218 MicroPop: 1000 AccEstimate: 1.0 AveGen: 0.5543333333333336 Time: 0.024262821674346922
Epoch: 62 Iteration: 3968 MacroPop: 220 MicroPop: 1000 AccEstimate: 1.0 AveGen: 0.5535000000000002 Time: 0.02478510936101278
Epoch: 63 Iteration: 4032 MacroPop: 217 MicroPop: 1000 AccEstimate: 1.0 AveGen: 0.5530000000000003 Time: 0.025279895464579264
Epoch: 64 Iteration: 4096 MacroPop: 213 MicroPop: 1000 AccEstimate: 1.0 AveGen: 0.5530000000000003 Time: 0.02575210730234782
Epoch: 65 Iteration: 4160 MacroPop: 216 MicroPop: 1000 AccEstimate: 1.0 AveGen: 0.5530000000000003 Time: 0.026224291324615477
Epoch: 66 Iteration: 4224 MacroPop: 216 MicroPop: 1000 AccEstimate: 1.0 AveGen: 0.5525000000000001 Time: 0.02669122616449992
Epoch: 67 Iteration: 4288 MacroPop: 216 MicroPop: 1000 AccEstimate: 1.0 AveGen: 0.5523333333333335 Time: 0.027152887980143228
Epoch: 68 Iteration: 4352 MacroPop: 213 MicroPop: 1000 AccEstimate: 1.0 AveGen: 0.5518333333333334 Time: 0.02763436237970988
Epoch: 69 Iteration: 4416 MacroPop: 211 MicroPop: 1000 AccEstimate: 1.0 AveGen: 0.5516666666666667 Time: 0.028118797143300376
Epoch: 70 Iteration: 4480 MacroPop: 212 MicroPop: 1000 AccEstimate: 1.0 AveGen: 0.5516666666666667 Time: 0.028610487778981526
Epoch: 71 Iteration: 4544 MacroPop: 210 MicroPop: 1000 AccEstimate: 1.0 AveGen: 0.5515 Time: 0.02909760077794393
Epoch: 72 Iteration: 4608 MacroPop: 212 MicroPop: 1000 AccEstimate: 1.0 AveGen: 0.5508333333333334 Time: 0.02956862449645996
Epoch: 73 Iteration: 4672 MacroPop: 208 MicroPop: 1000 AccEstimate: 1.0 AveGen: 0.5498333333333335 Time: 0.030052860577901203
Epoch: 74 Iteration: 4736 MacroPop: 207 MicroPop: 1000 AccEstimate: 1.0 AveGen: 0.5498333333333334 Time: 0.03052495320638021
Epoch: 75 Iteration: 4800 MacroPop: 207 MicroPop: 1000 AccEstimate: 1.0 AveGen: 0.5496666666666666 Time: 0.03101447820663452
Epoch: 76 Iteration: 4864 MacroPop: 209 MicroPop: 1000 AccEstimate: 1.0 AveGen: 0.5496666666666667 Time: 0.03147665659586588
Epoch: 77 Iteration: 4928 MacroPop: 210 MicroPop: 1000 AccEstimate: 1.0 AveGen: 0.5500000000000002 Time: 0.03194220860799154
Epoch: 78 Iteration: 4992 MacroPop: 209 MicroPop: 1000 AccEstimate: 1.0 AveGen: 0.5495000000000002 Time: 0.03240120808283488
------------------------------------------------------------------------------------------------------------------------------------------------------
Running Population Evaluation after 5000 iterations.
-----------------------------------------------
TRAINING Accuracy Results:-------------
Instance Coverage = 100.0%
Prediction Ties = 0.0%
64 out of 64 instances covered and correctly classified.
Standard Accuracy (Adjusted) = 1.0
Balanced Accuracy (Adjusted) = 1.0
Writing Population Statistical Summary File...
Writing Population as Data File...
Continue Learning...
------------------------------------------------------------------------------------------------------------------------------------------------------
Epoch: 79 Iteration: 5056 MacroPop: 210 MicroPop: 1000 AccEstimate: 1.0 AveGen: 0.5500000000000003 Time: 0.03318035205205282
Epoch: 80 Iteration: 5120 MacroPop: 211 MicroPop: 1000 AccEstimate: 1.0 AveGen: 0.5500000000000002 Time: 0.03368388811747233
Epoch: 81 Iteration: 5184 MacroPop: 212 MicroPop: 1000 AccEstimate: 1.0 AveGen: 0.5493333333333336 Time: 0.03420413335164388
Epoch: 82 Iteration: 5248 MacroPop: 218 MicroPop: 1000 AccEstimate: 1.0 AveGen: 0.5491666666666668 Time: 0.03472434679667155
Epoch: 83 Iteration: 5312 MacroPop: 216 MicroPop: 1000 AccEstimate: 1.0 AveGen: 0.548666666666667 Time: 0.03522026538848877
Epoch: 84 Iteration: 5376 MacroPop: 218 MicroPop: 1000 AccEstimate: 1.0 AveGen: 0.5480000000000004 Time: 0.03574220339457194
Epoch: 85 Iteration: 5440 MacroPop: 218 MicroPop: 1000 AccEstimate: 1.0 AveGen: 0.5468333333333336 Time: 0.036248226960500084
Epoch: 86 Iteration: 5504 MacroPop: 219 MicroPop: 1000 AccEstimate: 1.0 AveGen: 0.5448333333333337 Time: 0.03675115903218587
Epoch: 87 Iteration: 5568 MacroPop: 217 MicroPop: 1000 AccEstimate: 1.0 AveGen: 0.5458333333333337 Time: 0.03724143902460734
Epoch: 88 Iteration: 5632 MacroPop: 218 MicroPop: 1000 AccEstimate: 1.0 AveGen: 0.5463333333333338 Time: 0.037762892246246335
Epoch: 89 Iteration: 5696 MacroPop: 222 MicroPop: 1000 AccEstimate: 1.0 AveGen: 0.5465000000000004 Time: 0.038280797004699704
Epoch: 90 Iteration: 5760 MacroPop: 222 MicroPop: 1000 AccEstimate: 1.0 AveGen: 0.5455000000000002 Time: 0.038773612181345625
Epoch: 91 Iteration: 5824 MacroPop: 222 MicroPop: 1000 AccEstimate: 1.0 AveGen: 0.5443333333333333 Time: 0.03931528329849243
Epoch: 92 Iteration: 5888 MacroPop: 220 MicroPop: 1000 AccEstimate: 1.0 AveGen: 0.5443333333333332 Time: 0.03980674743652344
Epoch: 93 Iteration: 5952 MacroPop: 219 MicroPop: 1000 AccEstimate: 1.0 AveGen: 0.5435 Time: 0.04028711716334025
Epoch: 94 Iteration: 6016 MacroPop: 218 MicroPop: 1000 AccEstimate: 1.0 AveGen: 0.5433333333333332 Time: 0.040801652272542316
Epoch: 95 Iteration: 6080 MacroPop: 218 MicroPop: 1000 AccEstimate: 1.0 AveGen: 0.543 Time: 0.041311101118723555
Epoch: 96 Iteration: 6144 MacroPop: 220 MicroPop: 1000 AccEstimate: 1.0 AveGen: 0.5418333333333333 Time: 0.04178612232208252
Epoch: 97 Iteration: 6208 MacroPop: 220 MicroPop: 1000 AccEstimate: 1.0 AveGen: 0.5411666666666668 Time: 0.04231741825739543
Epoch: 98 Iteration: 6272 MacroPop: 219 MicroPop: 1000 AccEstimate: 1.0 AveGen: 0.5413333333333333 Time: 0.04281158844629924
Epoch: 99 Iteration: 6336 MacroPop: 223 MicroPop: 1000 AccEstimate: 1.0 AveGen: 0.5406666666666667 Time: 0.04331352710723877
Epoch: 100 Iteration: 6400 MacroPop: 222 MicroPop: 1000 AccEstimate: 1.0 AveGen: 0.5408333333333334 Time: 0.043810991446177165
Epoch: 101 Iteration: 6464 MacroPop: 222 MicroPop: 1000 AccEstimate: 1.0 AveGen: 0.5405000000000002 Time: 0.04430400530497233
Epoch: 102 Iteration: 6528 MacroPop: 221 MicroPop: 1000 AccEstimate: 1.0 AveGen: 0.540166666666667 Time: 0.044827067852020265
Epoch: 103 Iteration: 6592 MacroPop: 221 MicroPop: 1000 AccEstimate: 1.0 AveGen: 0.5403333333333334 Time: 0.04534453948338826
Epoch: 104 Iteration: 6656 MacroPop: 220 MicroPop: 1000 AccEstimate: 1.0 AveGen: 0.5401666666666669 Time: 0.045868690808614096
Epoch: 105 Iteration: 6720 MacroPop: 218 MicroPop: 1000 AccEstimate: 1.0 AveGen: 0.5406666666666669 Time: 0.0463552991549174
Epoch: 106 Iteration: 6784 MacroPop: 215 MicroPop: 1000 AccEstimate: 1.0 AveGen: 0.5405000000000002 Time: 0.04685150782267253
Epoch: 107 Iteration: 6848 MacroPop: 218 MicroPop: 1000 AccEstimate: 1.0 AveGen: 0.540666666666667 Time: 0.04737387100855509
Epoch: 108 Iteration: 6912 MacroPop: 216 MicroPop: 1000 AccEstimate: 1.0 AveGen: 0.5400000000000004 Time: 0.047861091295878094
Epoch: 109 Iteration: 6976 MacroPop: 215 MicroPop: 1000 AccEstimate: 1.0 AveGen: 0.5395000000000002 Time: 0.048347437381744386
Epoch: 110 Iteration: 7040 MacroPop: 215 MicroPop: 1000 AccEstimate: 1.0 AveGen: 0.5393333333333336 Time: 0.048824405670166014
Epoch: 111 Iteration: 7104 MacroPop: 219 MicroPop: 1000 AccEstimate: 1.0 AveGen: 0.5391666666666668 Time: 0.049351255098978676
Epoch: 112 Iteration: 7168 MacroPop: 218 MicroPop: 1000 AccEstimate: 1.0 AveGen: 0.5393333333333334 Time: 0.04982552925745646
Epoch: 113 Iteration: 7232 MacroPop: 220 MicroPop: 1000 AccEstimate: 1.0 AveGen: 0.5391666666666669 Time: 0.05034949779510498
Epoch: 114 Iteration: 7296 MacroPop: 219 MicroPop: 1000 AccEstimate: 1.0 AveGen: 0.5396666666666668 Time: 0.05086417595545451
Epoch: 115 Iteration: 7360 MacroPop: 219 MicroPop: 1000 AccEstimate: 1.0 AveGen: 0.5411666666666668 Time: 0.05135443607966105
Epoch: 116 Iteration: 7424 MacroPop: 221 MicroPop: 1000 AccEstimate: 1.0 AveGen: 0.5413333333333334 Time: 0.051832207043965656
Epoch: 117 Iteration: 7488 MacroPop: 222 MicroPop: 1000 AccEstimate: 1.0 AveGen: 0.5411666666666669 Time: 0.05234957933425903
Epoch: 118 Iteration: 7552 MacroPop: 221 MicroPop: 1000 AccEstimate: 1.0 AveGen: 0.5420000000000001 Time: 0.05287361939748128
Epoch: 119 Iteration: 7616 MacroPop: 224 MicroPop: 1000 AccEstimate: 1.0 AveGen: 0.542 Time: 0.053411448001861574
Epoch: 120 Iteration: 7680 MacroPop: 226 MicroPop: 1000 AccEstimate: 1.0 AveGen: 0.5413333333333333 Time: 0.05391797224680583
Epoch: 121 Iteration: 7744 MacroPop: 230 MicroPop: 1000 AccEstimate: 1.0 AveGen: 0.5418333333333333 Time: 0.05443344513575236
Epoch: 122 Iteration: 7808 MacroPop: 226 MicroPop: 1000 AccEstimate: 1.0 AveGen: 0.5408333333333333 Time: 0.05497846206029256
Epoch: 123 Iteration: 7872 MacroPop: 224 MicroPop: 1000 AccEstimate: 1.0 AveGen: 0.5399999999999998 Time: 0.05550031264623006
Epoch: 124 Iteration: 7936 MacroPop: 224 MicroPop: 1000 AccEstimate: 1.0 AveGen: 0.5393333333333333 Time: 0.05601682265599569
Epoch: 125 Iteration: 8000 MacroPop: 221 MicroPop: 1000 AccEstimate: 1.0 AveGen: 0.5391666666666667 Time: 0.05650384028752645
Epoch: 126 Iteration: 8064 MacroPop: 223 MicroPop: 1000 AccEstimate: 1.0 AveGen: 0.5386666666666667 Time: 0.05701683759689331
Epoch: 127 Iteration: 8128 MacroPop: 225 MicroPop: 1000 AccEstimate: 1.0 AveGen: 0.5386666666666671 Time: 0.05754026174545288
Epoch: 128 Iteration: 8192 MacroPop: 227 MicroPop: 1000 AccEstimate: 1.0 AveGen: 0.5373333333333333 Time: 0.058078451951344805
Epoch: 129 Iteration: 8256 MacroPop: 226 MicroPop: 1000 AccEstimate: 1.0 AveGen: 0.5363333333333332 Time: 0.058584296703338624
Epoch: 130 Iteration: 8320 MacroPop: 229 MicroPop: 1000 AccEstimate: 1.0 AveGen: 0.5363333333333332 Time: 0.05907684564590454
Epoch: 131 Iteration: 8384 MacroPop: 231 MicroPop: 1000 AccEstimate: 1.0 AveGen: 0.5351666666666668 Time: 0.05958333015441895
Epoch: 132 Iteration: 8448 MacroPop: 228 MicroPop: 1000 AccEstimate: 1.0 AveGen: 0.5333333333333335 Time: 0.060122636953989665
Epoch: 133 Iteration: 8512 MacroPop: 228 MicroPop: 1000 AccEstimate: 1.0 AveGen: 0.5343333333333334 Time: 0.060635292530059816
Epoch: 134 Iteration: 8576 MacroPop: 225 MicroPop: 1000 AccEstimate: 1.0 AveGen: 0.5336666666666667 Time: 0.06116385062535604
Epoch: 135 Iteration: 8640 MacroPop: 228 MicroPop: 1000 AccEstimate: 1.0 AveGen: 0.5341666666666666 Time: 0.06168475151062012
Epoch: 136 Iteration: 8704 MacroPop: 230 MicroPop: 1000 AccEstimate: 1.0 AveGen: 0.5341666666666668 Time: 0.06223420699437459
Epoch: 137 Iteration: 8768 MacroPop: 230 MicroPop: 1000 AccEstimate: 1.0 AveGen: 0.5350000000000003 Time: 0.06281951268513998
Epoch: 138 Iteration: 8832 MacroPop: 230 MicroPop: 1000 AccEstimate: 1.0 AveGen: 0.5353333333333337 Time: 0.06330643892288208
Epoch: 139 Iteration: 8896 MacroPop: 227 MicroPop: 1000 AccEstimate: 1.0 AveGen: 0.5355000000000003 Time: 0.06382405757904053
Epoch: 140 Iteration: 8960 MacroPop: 226 MicroPop: 1000 AccEstimate: 1.0 AveGen: 0.5345000000000003 Time: 0.06433498462041219
Epoch: 141 Iteration: 9024 MacroPop: 228 MicroPop: 1000 AccEstimate: 1.0 AveGen: 0.5343333333333334 Time: 0.06483019987742106
Epoch: 142 Iteration: 9088 MacroPop: 226 MicroPop: 1000 AccEstimate: 1.0 AveGen: 0.5341666666666668 Time: 0.06535965204238892
Epoch: 143 Iteration: 9152 MacroPop: 227 MicroPop: 1000 AccEstimate: 1.0 AveGen: 0.5338333333333333 Time: 0.06587673823038737
Epoch: 144 Iteration: 9216 MacroPop: 230 MicroPop: 1000 AccEstimate: 1.0 AveGen: 0.5339999999999999 Time: 0.06638690630594889
Epoch: 145 Iteration: 9280 MacroPop: 229 MicroPop: 1000 AccEstimate: 1.0 AveGen: 0.5336666666666665 Time: 0.06689819892247519
Epoch: 146 Iteration: 9344 MacroPop: 226 MicroPop: 1000 AccEstimate: 1.0 AveGen: 0.5343333333333332 Time: 0.06746574640274047
Epoch: 147 Iteration: 9408 MacroPop: 223 MicroPop: 1000 AccEstimate: 1.0 AveGen: 0.5326666666666666 Time: 0.0679729421933492
Epoch: 148 Iteration: 9472 MacroPop: 222 MicroPop: 1000 AccEstimate: 1.0 AveGen: 0.5326666666666665 Time: 0.06846379041671753
Epoch: 149 Iteration: 9536 MacroPop: 224 MicroPop: 1000 AccEstimate: 1.0 AveGen: 0.5331666666666662 Time: 0.06897318760553996
Epoch: 150 Iteration: 9600 MacroPop: 224 MicroPop: 1000 AccEstimate: 1.0 AveGen: 0.5329999999999998 Time: 0.06944699684778849
Epoch: 151 Iteration: 9664 MacroPop: 224 MicroPop: 1000 AccEstimate: 1.0 AveGen: 0.5323333333333329 Time: 0.06994860967000326
Epoch: 152 Iteration: 9728 MacroPop: 225 MicroPop: 1000 AccEstimate: 1.0 AveGen: 0.5323333333333331 Time: 0.0704376737276713
Epoch: 153 Iteration: 9792 MacroPop: 225 MicroPop: 1000 AccEstimate: 1.0 AveGen: 0.5314999999999999 Time: 0.07095456918080648
Epoch: 154 Iteration: 9856 MacroPop: 224 MicroPop: 1000 AccEstimate: 1.0 AveGen: 0.5318333333333333 Time: 0.07145770788192748
Epoch: 155 Iteration: 9920 MacroPop: 223 MicroPop: 1000 AccEstimate: 1.0 AveGen: 0.5316666666666665 Time: 0.07197792530059814
Epoch: 156 Iteration: 9984 MacroPop: 224 MicroPop: 1000 AccEstimate: 1.0 AveGen: 0.5319999999999999 Time: 0.07250059445699056
------------------------------------------------------------------------------------------------------------------------------------------------------
Running Population Evaluation after 10000 iterations.
-----------------------------------------------
TRAINING Accuracy Results:-------------
Instance Coverage = 100.0%
Prediction Ties = 0.0%
64 out of 64 instances covered and correctly classified.
Standard Accuracy (Adjusted) = 1.0
Balanced Accuracy (Adjusted) = 1.0
Writing Population Statistical Summary File...
Writing Population as Data File...
Continue Learning...
------------------------------------------------------------------------------------------------------------------------------------------------------
eLCS Run Complete
In [2]:
print(runtimeParams[0])
# Generate lists for plotting
epoch_list = [i['epoch'] for i in runtimeParams]
iter_list = [i['iteration'] for i in runtimeParams]
acc_list = [i['acc_estimate'] for i in runtimeParams]
ave_gen_list = [i['ave_gen'] for i in runtimeParams]
micro_list = [i['micro_pop'] for i in runtimeParams]
macro_list = [i['macro_pop'] for i in runtimeParams]
{'time': 9.662310282389323e-05, 'macro_pop': 30, 'ave_gen': 0.4895833333333333, 'epoch': 1, 'acc_estimate': 0.6875, 'iteration': 64, 'micro_pop': 32}
In [3]:
%matplotlib inline
import matplotlib
import numpy as np
import matplotlib.pyplot as plt
plt.plot(iter_list, acc_list)
Out[3]:
[<matplotlib.lines.Line2D at 0x7f50229ede80>]
In [4]:
plt.plot(epoch_list, acc_list)
Out[4]:
[<matplotlib.lines.Line2D at 0x7f5020618b70>]
In [5]:
plt.plot(epoch_list, micro_list)
Out[5]:
[<matplotlib.lines.Line2D at 0x7f50205936d8>]
In [6]:
plt.plot(epoch_list, macro_list)
Out[6]:
[<matplotlib.lines.Line2D at 0x7f50204fe748>]
In [7]:
plt.plot(epoch_list, ave_gen_list)
Out[7]:
[<matplotlib.lines.Line2D at 0x7f50204e8390>]
In [ ]:
Content source: ScottMcCormack/CITS4404
Similar notebooks: