From c6d40f68256a4d31587d38e939f1bcd338fe8131 Mon Sep 17 00:00:00 2001 From: VasilyShcherbinin <vasily.shcherbinin@outlook.com> Date: Fri, 15 Feb 2019 21:59:54 +0000 Subject: [PATCH] Latest changes --- UCS/RESULTS_FILE.txt | 14 ++++++++++---- UCS/UCS_Configuration_File.txt | 10 +++++----- UCS/UCS_OutputFileManager.py | 2 -- UCS/UCS_Run.py | 3 +-- .../UCS_OutputFileManager.cpython-36.pyc | Bin 5819 -> 5772 bytes 5 files changed, 16 insertions(+), 13 deletions(-) diff --git a/UCS/RESULTS_FILE.txt b/UCS/RESULTS_FILE.txt index 73d0619..0ac008b 100644 --- a/UCS/RESULTS_FILE.txt +++ b/UCS/RESULTS_FILE.txt @@ -1,4 +1,10 @@ - Accuracy: 0.78125 Total time: 114.03 Rules: 360 - Total Av. Rules: 247.06666666666666 - Accuracy: 0.78125 Total time: 114.62 Rules: 365 - Total Av. Rules: 488.4 + Accuracy: 0.90625 Total time: 33.04 Rules: 199 + Accuracy: 0.921875 Total time: 34.97 Rules: 194 + Accuracy: 0.859375 Total time: 35.2 Rules: 197 + Accuracy: 0.859375 Total time: 36.26 Rules: 193 + Accuracy: 0.890625 Total time: 34.05 Rules: 205 + Accuracy: 0.875 Total time: 34.18 Rules: 201 + Accuracy: 0.921875 Total time: 34.91 Rules: 218 + Accuracy: 0.90625 Total time: 35.54 Rules: 202 + Accuracy: 0.890625 Total time: 35.22 Rules: 205 + Accuracy: 0.828125 Total time: 37.87 Rules: 216 diff --git a/UCS/UCS_Configuration_File.txt b/UCS/UCS_Configuration_File.txt index 8654dc9..718466e 100644 --- a/UCS/UCS_Configuration_File.txt +++ b/UCS/UCS_Configuration_File.txt @@ -8,9 +8,9 @@ trainFile=6Multiplexer_Data_Complete.txt # FileName of training dataset testFile=None # FileName of testing dataset. If no testing data available or desired, put 'None'. outputDirectory=Local_Output # Output file directory outputFile=ExampleRun # FileName of output files. -learningIterations=20000 # Specify complete algorithm evaluation checkpoints and maximum number of learning iterations (e.g. 1000.2000.5000 = A maximum of 5000 learning iterations with evaluations at 1000, 2000, and 5000 iterations) -N=1000 # Maximum size of the rule population (a.k.a. Micro-classifier population size, where N is the sum of the classifier numerosities in the population) -p_spec=0.7 # The probability of specifying an attribute when covering. (1-p_spec = the probability of adding '#' in ternary rule representations). Greater numbers of attributes in a dataset will require lower values of p_spec. +learningIterations=10000 # Specify complete algorithm evaluation checkpoints and maximum number of learning iterations (e.g. 1000.2000.5000 = A maximum of 5000 learning iterations with evaluations at 1000, 2000, and 5000 iterations) +N=500 # Maximum size of the rule population (a.k.a. Micro-classifier population size, where N is the sum of the classifier numerosities in the population) +p_spec=0.6 # The probability of specifying an attribute when covering. (1-p_spec = the probability of adding '#' in ternary rule representations). Greater numbers of attributes in a dataset will require lower values of p_spec. kfold=5 # if not used, set to 0. ######-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- @@ -26,9 +26,9 @@ trackingFrequency=0 # Specifies the number of iterations before each esti ######-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- ###### Supervised Learning Parameters - Generally just use default values. ######-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- -nu=5 # (v) Power parameter used to determine the importance of high accuracy when calculating fitness. (typically set to 5, recommended setting of 1 in noisy data) +nu=10 # (v) Power parameter used to determine the importance of high accuracy when calculating fitness. (typically set to 5, recommended setting of 1 in noisy data) chi=0.8 # (X) The probability of applying crossover in the GA. (typically set to 0.5-1.0) -upsilon=0.4 # (u) The probability of mutating an allele within an offspring.(typically set to 0.1-0.5) +upsilon=0.5 # (u) The probability of mutating an allele within an offspring.(typically set to 0.1-0.5) theta_GA=25 # The GA threshold; The GA is applied in a set when the average time since the last GA in the set is greater than theta_GA. theta_del=20 # The deletion experience threshold; The calculation of the deletion probability changes once this threshold is passed. theta_sub=20 # The subsumption experience threshold; diff --git a/UCS/UCS_OutputFileManager.py b/UCS/UCS_OutputFileManager.py index a1c9ed4..25bf7de 100644 --- a/UCS/UCS_OutputFileManager.py +++ b/UCS/UCS_OutputFileManager.py @@ -34,7 +34,6 @@ from UCS.UCS_Constants import * class OutputFileManager: totalPopulationSize = 0 - totalAverage = 0 def writePopStats(self, outFile, trainEval, testEval, exploreIter, pop, correct): """ Makes output text file which includes all of the evaluation statistics for a complete analysis of all training and testing data on the current LCS rule population. """ @@ -140,7 +139,6 @@ class OutputFileManager: # Write each classifier-------------------------------------------------------------------------------------------------------------------------------------- OutputFileManager.totalPopulationSize = len(pop.popSet) - OutputFileManager.totalAverage += len(pop.popSet) print(len(pop.popSet)) for cl in pop.popSet: rulePopOut.write(str(cl.printClassifier())) diff --git a/UCS/UCS_Run.py b/UCS/UCS_Run.py index ae060b1..ee488d4 100644 --- a/UCS/UCS_Run.py +++ b/UCS/UCS_Run.py @@ -85,11 +85,10 @@ def mainRun(): print("Total run time in seconds: %.2f" % total) f = open("RESULTS_FILE.txt", 'a') f.write(" Accuracy: " + str(kfold_accuracy) + " Total time: " + str(total) + " Rules: " + str(OutputFileManager.totalPopulationSize) + "\n") - f.write(" Total Av. Rules: " + str(OutputFileManager.totalAverage / 15) + "\n") if __name__ == '__main__': - for i in range(15): + for i in range(10): mainRun() diff --git a/UCS/__pycache__/UCS_OutputFileManager.cpython-36.pyc b/UCS/__pycache__/UCS_OutputFileManager.cpython-36.pyc index 7847f6eeda339f59819a256be4dc5728d025d636..3ef47d470e1cc4d4c6426a9fab68a49f77aa6678 100644 GIT binary patch delta 162 zcmdn3+oQ{A%*)HAeKs{FWh194hk^nF14Al96k`fQ6jKUg6mtqw3UdoX6iW(A3M-Ii z-JHZ>&dI1Yd6wWtMuEvbLN_K`2rCH+G&3|aHZw9Z6ut^)sA0(x+?*|(&B!P;`MOBr zWH-@Vwlbix#Tt|63yM#^Aj&uSfv5^2+hkTTEjC@CM3Ld-UNLcjB4!|438at>NN_Ms IP8N#*0EPA?zW@LL delta 204 zcmeCt-L1=M%*)F)`)F#+){UH|94aad3=F9ZQH&`JQA{a}QOrQhlERe2+`<sWn!=L8 z3Z&UK$8nf*GOACWCb*GNWwM9R4PibOhAe>+?i%JS-eyK~1}27hfywg1%7TK;49$$q zjEoG0|H2t+Sh9pR2McF2G73-LFOtZ^Q<7hjnB!QMT9lYRSxz*ctsH1~vDW0tqN<D{ tleYs&_Q`iewYc?x!bQ3u!f0}wn7B|8GmxzWQp*7(IG9)%C!2^x005oyE@J=y -- GitLab