Changeset 18126
- Timestamp:
- 12/15/21 10:52:19 (3 years ago)
- Location:
- branches/3140_NumberSymbol/HeuristicLab.Tests
- Files:
-
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/3140_NumberSymbol/HeuristicLab.Tests/HeuristicLab-3.3/Samples/GPSymbolicRegressionSampleWithOSTest.cs
r18119 r18126 66 66 // Unfortunately, running the same test on a different machine results in different values 67 67 // For x86 environments the results below match but on x64 there is a difference 68 // We tracked down the ConstantOptimizationEvaluator as a possible cause but have not68 // We tracked down the ParameterOptimizationEvaluator as a possible cause but have not 69 69 // been able to identify the real cause. Presumably, execution on a Xeon and a Core i7 processor 70 70 // leads to different results. -
branches/3140_NumberSymbol/HeuristicLab.Tests/HeuristicLab-3.3/Samples/GeSymbolicRegressionSampleTest.cs
r17180 r18126 113 113 problem.SymbolicExpressionTreeGrammar.RemoveSymbol(c); 114 114 } 115 var numbers = problem.SymbolicExpressionTreeGrammar.AllowedSymbols.OfType<Number>().ToList(); 116 foreach (var n in numbers) { 117 problem.SymbolicExpressionTreeGrammar.RemoveSymbol(n); 118 } 115 119 116 120 SamplesUtils.ConfigureOsGeneticAlgorithmParameters<GenderSpecificSelector, Encodings.IntegerVectorEncoding.SinglePointCrossover, Encodings.IntegerVectorEncoding.UniformOnePositionManipulator>( -
branches/3140_NumberSymbol/HeuristicLab.Tests/HeuristicLab.Problems.DataAnalysis.Symbolic-3.4/SymbolicDataAnalysisExpressionCrossoverTest.cs
r17180 r18126 110 110 grammar.MinimumFunctionDefinitions = 0; 111 111 112 var trees = Util.CreateRandomTrees(twister, dataset, grammar, PopulationSize, 1, MaxTreeLength, 0, 0);112 var trees = Util.CreateRandomTrees(twister, dataset, grammar, PopulationSize, MaxTreeLength); 113 113 foreach (ISymbolicExpressionTree tree in trees) { 114 114 Util.InitTree(tree, twister, new List<string>(dataset.VariableNames)); -
branches/3140_NumberSymbol/HeuristicLab.Tests/HeuristicLab.Problems.DataAnalysis.Symbolic-3.4/SymbolicDataAnalysisExpressionTreeInterpreterTest.cs
r17950 r18126 141 141 grammar.ConfigureAsDefaultRegressionGrammar(); 142 142 143 var randomTrees = Util.CreateRandomTrees(twister, dataset, grammar, N, 1 , 100, 0,0);143 var randomTrees = Util.CreateRandomTrees(twister, dataset, grammar, N, 100); 144 144 foreach (ISymbolicExpressionTree tree in randomTrees) { 145 145 Util.InitTree(tree, twister, new List<string>(dataset.VariableNames)); … … 155 155 156 156 var grammar = new FullFunctionalExpressionGrammar(); 157 var randomTrees = Util.CreateRandomTrees(twister, dataset, grammar, N, 1 , 100, 0,0);157 var randomTrees = Util.CreateRandomTrees(twister, dataset, grammar, N, 100); 158 158 foreach (ISymbolicExpressionTree tree in randomTrees) { 159 159 Util.InitTree(tree, twister, new List<string>(dataset.VariableNames)); … … 169 169 170 170 var grammar = new ArithmeticExpressionGrammar(); 171 var randomTrees = Util.CreateRandomTrees(twister, dataset, grammar, N, 1 , 100, 0,0);171 var randomTrees = Util.CreateRandomTrees(twister, dataset, grammar, N, 100); 172 172 foreach (SymbolicExpressionTree tree in randomTrees) { 173 173 Util.InitTree(tree, twister, new List<string>(dataset.VariableNames)); … … 249 249 250 250 var rows = Enumerable.Range(0, numRows).ToList(); 251 var randomTrees = Util.CreateRandomTrees(twister, dataset, grammar, N, 1 , 10, 0,0);251 var randomTrees = Util.CreateRandomTrees(twister, dataset, grammar, N, 10); 252 252 foreach (ISymbolicExpressionTree tree in randomTrees) { 253 253 Util.InitTree(tree, twister, new List<string>(dataset.VariableNames)); … … 299 299 grammar.Symbols.First(x => x is Power).Enabled = false; 300 300 301 var randomTrees = Util.CreateRandomTrees(twister, dataset, grammar, N, 1 , 10, 0,0);301 var randomTrees = Util.CreateRandomTrees(twister, dataset, grammar, N, 10); 302 302 foreach (ISymbolicExpressionTree tree in randomTrees) { 303 303 Util.InitTree(tree, twister, new List<string>(dataset.VariableNames)); -
branches/3140_NumberSymbol/HeuristicLab.Tests/HeuristicLab.Problems.DataAnalysis.Symbolic-3.4/SymbolicExpressionTreeBottomUpSimilarityCalculatorTest.cs
r18119 r18126 77 77 var twister = new MersenneTwister(31415); 78 78 var ds = Util.CreateRandomDataset(twister, Rows, Columns); 79 var trees = Util.CreateRandomTrees(twister, ds, grammar, N, 1 , 100, 0,0);79 var trees = Util.CreateRandomTrees(twister, ds, grammar, N, 100); 80 80 81 81 double s = 0; … … 115 115 var twister = new MersenneTwister(31415); 116 116 var ds = Util.CreateRandomDataset(twister, Rows, Columns); 117 var trees = Util.CreateRandomTrees(twister, ds, grammar, N, 1 , 100, 0,0);117 var trees = Util.CreateRandomTrees(twister, ds, grammar, N, 100); 118 118 119 119 var similarityCalculator = new SymbolicExpressionTreeBottomUpSimilarityCalculator { MatchParameterValues = strict, MatchVariableWeights = strict }; -
branches/3140_NumberSymbol/HeuristicLab.Tests/HeuristicLab.Problems.DataAnalysis.Symbolic-3.4/SymbolicExpressionTreeMaxCommonSubtreeSimilarityCalculatorTest.cs
r11916 r18126 53 53 var twister = new MersenneTwister(31415); 54 54 var ds = Util.CreateRandomDataset(twister, Rows, Columns); 55 var trees = Util.CreateRandomTrees(twister, ds, grammar, N, 1 , 100, 0,0);55 var trees = Util.CreateRandomTrees(twister, ds, grammar, N, 100); 56 56 57 57 double s = 0; -
branches/3140_NumberSymbol/HeuristicLab.Tests/HeuristicLab.Problems.DataAnalysis.Symbolic-3.4/Util.cs
r17180 r18126 35 35 varNode.Weight = twister.NextDouble() * 20.0 - 10.0; 36 36 varNode.VariableName = varNames[twister.Next(varNames.Count)]; 37 } else if (node is ConstantTreeNode) {38 var constantNode = node as ConstantTreeNode;39 constantNode.Value = twister.NextDouble() * 20.0 - 10.0;37 } else if (node is NumberTreeNode) { 38 var numNode = node as NumberTreeNode; 39 numNode.Value = twister.NextDouble() * 20.0 - 10.0; 40 40 } 41 41 } … … 44 44 45 45 public static ISymbolicExpressionTree[] CreateRandomTrees(MersenneTwister twister, Dataset dataset, ISymbolicExpressionGrammar grammar, int popSize) { 46 return CreateRandomTrees(twister, dataset, grammar, popSize, 1, 200, 3, 3);46 return CreateRandomTrees(twister, dataset, grammar, popSize, 200); 47 47 } 48 48 49 49 public static ISymbolicExpressionTree[] CreateRandomTrees(MersenneTwister twister, Dataset dataset, ISymbolicExpressionGrammar grammar, 50 int popSize, int minSize, int maxSize, 51 int maxFunctionDefinitions, int maxFunctionArguments) { 50 int popSize, int maxSize) { 52 51 foreach (Variable variableSymbol in grammar.Symbols.OfType<Variable>()) { 53 52 variableSymbol.VariableNames = dataset.VariableNames.Skip(1); -
branches/3140_NumberSymbol/HeuristicLab.Tests/HeuristicLab.Problems.DataAnalysis.Symbolic.TimeSeriesPrognosis-3.4/SymbolicDataAnalysisExpressionTreeInterpreterTest.cs
r17180 r18126 66 66 grammar.MinimumFunctionArguments = 0; 67 67 grammar.MinimumFunctionDefinitions = 0; 68 var randomTrees = Util.CreateRandomTrees(twister, dataset, grammar, N, 1 , 100, 0,0);68 var randomTrees = Util.CreateRandomTrees(twister, dataset, grammar, N, 100); 69 69 foreach (ISymbolicExpressionTree tree in randomTrees) { 70 70 Util.InitTree(tree, twister, new List<string>(dataset.VariableNames)); … … 83 83 grammar.MinimumFunctionArguments = 0; 84 84 grammar.MinimumFunctionDefinitions = 0; 85 var randomTrees = Util.CreateRandomTrees(twister, dataset, grammar, N, 1 , 100, 0,0);85 var randomTrees = Util.CreateRandomTrees(twister, dataset, grammar, N, 100); 86 86 foreach (ISymbolicExpressionTree tree in randomTrees) { 87 87 Util.InitTree(tree, twister, new List<string>(dataset.VariableNames)); … … 100 100 grammar.MinimumFunctionArguments = 0; 101 101 grammar.MinimumFunctionDefinitions = 0; 102 var randomTrees = Util.CreateRandomTrees(twister, dataset, grammar, N, 1 , 100, 0,0);102 var randomTrees = Util.CreateRandomTrees(twister, dataset, grammar, N, 100); 103 103 foreach (SymbolicExpressionTree tree in randomTrees) { 104 104 Util.InitTree(tree, twister, new List<string>(dataset.VariableNames)); -
branches/3140_NumberSymbol/HeuristicLab.Tests/HeuristicLab.Problems.DataAnalysis.Symbolic.TimeSeriesPrognosis-3.4/Util.cs
r17180 r18126 35 35 varNode.Weight = twister.NextDouble() * 20.0 - 10.0; 36 36 varNode.VariableName = varNames[twister.Next(varNames.Count)]; 37 } else if (node is ConstantTreeNode) {38 var constantNode = node as ConstantTreeNode;39 constantNode.Value = twister.NextDouble() * 20.0 - 10.0;37 } else if (node is NumberTreeNode) { 38 var numNode = node as NumberTreeNode; 39 numNode.Value = twister.NextDouble() * 20.0 - 10.0; 40 40 } 41 41 } … … 44 44 45 45 public static ISymbolicExpressionTree[] CreateRandomTrees(MersenneTwister twister, Dataset dataset, ISymbolicExpressionGrammar grammar, int popSize) { 46 return CreateRandomTrees(twister, dataset, grammar, popSize, 1, 200, 3, 3);46 return CreateRandomTrees(twister, dataset, grammar, popSize, 200); 47 47 } 48 48 49 49 public static ISymbolicExpressionTree[] CreateRandomTrees(MersenneTwister twister, Dataset dataset, ISymbolicExpressionGrammar grammar, 50 int popSize, int minSize, int maxSize, 51 int maxFunctionDefinitions, int maxFunctionArguments) { 50 int popSize, int maxSize) { 52 51 foreach (Variable variableSymbol in grammar.Symbols.OfType<Variable>()) { 53 52 variableSymbol.VariableNames = dataset.VariableNames.Skip(1);
Note: See TracChangeset
for help on using the changeset viewer.