Changeset 9475 for branches/LearningClassifierSystems/HeuristicLab.Optimization.Operators.LCS/3.3/GAssist/MDL
- Timestamp:
- 05/09/13 18:57:22 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/LearningClassifierSystems/HeuristicLab.Optimization.Operators.LCS/3.3/GAssist/MDL/MDLCalculator.cs
r9392 r9475 82 82 double error = bestSolution.TrainingExceptionsLength; 83 83 double tl = (bestSolution.TrainingTheoryLength * bestSolution.Classes) / bestSolution.TrainingNumberOfAliveRules; 84 if (tl.IsAlmost(0.0)) { 85 //as done in the original implementation 86 tl = 0.00000001; 87 } 84 88 theoryWeight = (initialTheoryLengthRatio / (1.0 - initialTheoryLengthRatio)) * (error / tl); 85 89 iterationsSinceBest = 0; … … 87 91 88 92 if (activated && !fixedWeight && 89 GetLastIterationsAccuracyAverage(weightAdaptionIterations) == 1.0) {93 GetLastIterationsAccuracyAverage(weightAdaptionIterations).IsAlmost(1.0)) { 90 94 fixedWeight = true; 91 95 } 92 96 93 97 if (activated && !fixedWeight) { 94 if (bestSolution.TrainingAccuracy != 1.0) {98 if (bestSolution.TrainingAccuracy.IsAlmost(1.0)) { 95 99 if (iterationsSinceBest == weightAdaptionIterations) { 96 100 theoryWeight *= weightRelaxFactor; … … 100 104 } 101 105 102 //if (currentIteration != 0) {103 106 UpdateStatistic(bestSolution.TrainingAccuracy); 104 //}105 107 } 106 108
Note: See TracChangeset
for help on using the changeset viewer.