Changeset 11202 for branches/HiveStatistics/sources/HeuristicLab.Tests/HeuristicLab.Problems.DataAnalysis.Symbolic-3.4
- Timestamp:
- 07/18/14 12:01:13 (10 years ago)
- Location:
- branches/HiveStatistics/sources
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/HiveStatistics/sources
- Property svn:ignore
-
old new 8 8 FxCopResults.txt 9 9 Google.ProtocolBuffers-0.9.1.dll 10 Google.ProtocolBuffers-2.4.1.473.dll 10 11 HeuristicLab 3.3.5.1.ReSharper.user 11 12 HeuristicLab 3.3.6.0.ReSharper.user 12 13 HeuristicLab.4.5.resharper.user 13 14 HeuristicLab.ExtLibs.6.0.ReSharper.user 15 HeuristicLab.Scripting.Development 14 16 HeuristicLab.resharper.user 15 17 ProtoGen.exe … … 17 19 _ReSharper.HeuristicLab 18 20 _ReSharper.HeuristicLab 3.3 21 _ReSharper.HeuristicLab 3.3 Tests 19 22 _ReSharper.HeuristicLab.ExtLibs 20 23 bin 21 24 protoc.exe 22 _ReSharper.HeuristicLab 3.3 Tests23 Google.ProtocolBuffers-2.4.1.473.dll
-
- Property svn:mergeinfo changed
- Property svn:ignore
-
branches/HiveStatistics/sources/HeuristicLab.Tests
- Property svn:mergeinfo changed
-
branches/HiveStatistics/sources/HeuristicLab.Tests/HeuristicLab.Problems.DataAnalysis.Symbolic-3.4/SymbolicDataAnalysisExpressionCrossoverTest.cs
r7915 r11202 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 1Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2014 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. … … 27 27 using HeuristicLab.Core; 28 28 using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding; 29 using HeuristicLab.Problems.DataAnalysis.Symbolic;30 29 using HeuristicLab.Problems.DataAnalysis.Symbolic.Regression; 31 30 using HeuristicLab.Random; … … 33 32 using ExecutionContext = HeuristicLab.Core.ExecutionContext; 34 33 35 namespace HeuristicLab.Problems.DataAnalysis.Symbolic _34.Tests {34 namespace HeuristicLab.Problems.DataAnalysis.Symbolic.Tests { 36 35 [TestClass()] 37 36 public class SymbolicDataAnalysisExpressionCrossoverTest { … … 49 48 50 49 [TestMethod] 50 [TestCategory("Problems.DataAnalysis")] 51 [TestProperty("Time", "long")] 51 52 public void SymbolicDataAnalysisExpressionSemanticSimilarityCrossoverPerformanceTest() { 52 53 var problem = new SymbolicRegressionSingleObjectiveProblem(); … … 56 57 57 58 [TestMethod] 59 [TestCategory("Problems.DataAnalysis")] 60 [TestProperty("Time", "long")] 58 61 public void SymbolicDataAnalysisExpressionProbabilisticFunctionalCrossoverPerformanceTest() { 59 62 var problem = new SymbolicRegressionSingleObjectiveProblem(); … … 63 66 64 67 [TestMethod] 68 [TestCategory("Problems.DataAnalysis")] 69 [TestProperty("Time", "long")] 65 70 public void SymbolicDataAnalysisExpressionDeterministicBestCrossoverPerformanceTest() { 66 71 var problem = new SymbolicRegressionSingleObjectiveProblem(); … … 70 75 71 76 [TestMethod] 77 [TestCategory("Problems.DataAnalysis")] 78 [TestProperty("Time", "long")] 72 79 public void SymbolicDataAnalysisExpressionContextAwareCrossoverPerformanceTest() { 73 80 var problem = new SymbolicRegressionSingleObjectiveProblem(); … … 77 84 78 85 [TestMethod] 86 [TestCategory("Problems.DataAnalysis")] 87 [TestProperty("Time", "long")] 79 88 public void SymbolicDataAnalysisExpressionDepthConstrainedCrossoverPerformanceTest() { 80 89 var problem = new SymbolicRegressionSingleObjectiveProblem(); … … 137 146 138 147 foreach (var tree in trees) 139 HeuristicLab.Encodings.SymbolicExpressionTreeEncoding _34.Tests.Util.IsValid(tree);148 HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Tests.Util.IsValid(tree); 140 149 } 141 150 } -
branches/HiveStatistics/sources/HeuristicLab.Tests/HeuristicLab.Problems.DataAnalysis.Symbolic-3.4/SymbolicDataAnalysisExpressionTreeInterpreterTest.cs
r9322 r11202 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 2Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2014 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. … … 25 25 using System.Linq; 26 26 using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding; 27 using HeuristicLab.Problems.DataAnalysis.Symbolic;28 27 using HeuristicLab.Random; 29 28 using Microsoft.VisualStudio.TestTools.UnitTesting; 30 namespace HeuristicLab.Problems.DataAnalysis.Symbolic _34.Tests {31 32 33 [TestClass ()]29 namespace HeuristicLab.Problems.DataAnalysis.Symbolic.Tests { 30 31 32 [TestClass] 34 33 public class SymbolicDataAnalysisExpressionTreeInterpreterTest { 35 34 private const int N = 1000; 36 35 private const int Rows = 1000; 37 36 private const int Columns = 50; 38 private TestContext testContextInstance; 39 40 /// <summary> 41 ///Gets or sets the test context which provides 42 ///information about and functionality for the current test run. 43 ///</summary> 44 public TestContext TestContext { 45 get { 46 return testContextInstance; 47 } 48 set { 49 testContextInstance = value; 50 } 51 } 52 53 [TestMethod] 54 public void SymbolicDataAnalysisExpressionTreeInterpreterTypeCoherentGrammarPerformanceTest() { 55 TypeCoherentGrammarPerformanceTest(new SymbolicDataAnalysisExpressionTreeInterpreter(), 12.5e6); 56 } 57 [TestMethod] 58 public void SymbolicDataAnalysisExpressionTreeInterpreterFullGrammarPerformanceTest() { 59 FullGrammarPerformanceTest(new SymbolicDataAnalysisExpressionTreeInterpreter(), 12.5e6); 60 } 61 [TestMethod] 62 public void SymbolicDataAnalysisExpressionTreeInterpreterArithmeticGrammarPerformanceTest() { 63 ArithmeticGrammarPerformanceTest(new SymbolicDataAnalysisExpressionTreeInterpreter(), 12.5e6); 64 } 65 66 [TestMethod] 67 public void SymbolicDataAnalysisExpressionTreeILEmittingInterpreterTypeCoherentGrammarPerformanceTest() { 68 TypeCoherentGrammarPerformanceTest(new SymbolicDataAnalysisExpressionTreeILEmittingInterpreter(), 7.5e6); 69 } 70 [TestMethod] 71 public void SymbolicDataAnalysisExpressionTreeILEmittingInterpreterFullGrammarPerformanceTest() { 72 FullGrammarPerformanceTest(new SymbolicDataAnalysisExpressionTreeILEmittingInterpreter(), 7.5e6); 73 } 74 [TestMethod] 75 public void SymbolicDataAnalysisExpressionTreeILEmittingInterpreterArithmeticGrammarPerformanceTest() { 76 ArithmeticGrammarPerformanceTest(new SymbolicDataAnalysisExpressionTreeILEmittingInterpreter(), 7.5e6); 77 } 78 79 private void TypeCoherentGrammarPerformanceTest(ISymbolicDataAnalysisExpressionTreeInterpreter interpreter, double nodesPerSecThreshold) { 37 38 private static Dataset ds = new Dataset(new string[] { "Y", "A", "B" }, new double[,] { 39 { 1.0, 1.0, 1.0 }, 40 { 2.0, 2.0, 2.0 }, 41 { 3.0, 1.0, 2.0 }, 42 { 4.0, 1.0, 1.0 }, 43 { 5.0, 2.0, 2.0 }, 44 { 6.0, 1.0, 2.0 }, 45 { 7.0, 1.0, 1.0 }, 46 { 8.0, 2.0, 2.0 }, 47 { 9.0, 1.0, 2.0 }, 48 { 10.0, 1.0, 1.0 }, 49 { 11.0, 2.0, 2.0 }, 50 { 12.0, 1.0, 2.0 } 51 }); 52 53 [TestMethod] 54 [TestCategory("Problems.DataAnalysis.Symbolic")] 55 [TestProperty("Time", "long")] 56 public void StandardInterpreterTestTypeCoherentGrammarPerformance() { 57 TestTypeCoherentGrammarPerformance(new SymbolicDataAnalysisExpressionTreeInterpreter(), 12.5e6); 58 } 59 [TestMethod] 60 [TestCategory("Problems.DataAnalysis.Symbolic")] 61 [TestProperty("Time", "long")] 62 public void StandardInterpreterTestFullGrammarPerformance() { 63 TestFullGrammarPerformance(new SymbolicDataAnalysisExpressionTreeInterpreter(), 12.5e6); 64 } 65 [TestMethod] 66 [TestCategory("Problems.DataAnalysis.Symbolic")] 67 [TestProperty("Time", "long")] 68 public void StandardInterpreterTestArithmeticGrammarPerformance() { 69 TestArithmeticGrammarPerformance(new SymbolicDataAnalysisExpressionTreeInterpreter(), 12.5e6); 70 } 71 72 73 [TestMethod] 74 [TestCategory("Problems.DataAnalysis.Symbolic")] 75 [TestProperty("Time", "long")] 76 public void ILEmittingInterpreterTestTypeCoherentGrammarPerformance() { 77 TestTypeCoherentGrammarPerformance(new SymbolicDataAnalysisExpressionTreeILEmittingInterpreter(), 7.5e6); 78 } 79 [TestMethod] 80 [TestCategory("Problems.DataAnalysis.Symbolic")] 81 [TestProperty("Time", "long")] 82 public void ILEmittingInterpreterTestFullGrammarPerformance() { 83 TestFullGrammarPerformance(new SymbolicDataAnalysisExpressionTreeILEmittingInterpreter(), 7.5e6); 84 } 85 [TestMethod] 86 [TestCategory("Problems.DataAnalysis.Symbolic")] 87 [TestProperty("Time", "long")] 88 public void ILEmittingInterpreterTestArithmeticGrammarPerformance() { 89 TestArithmeticGrammarPerformance(new SymbolicDataAnalysisExpressionTreeILEmittingInterpreter(), 7.5e6); 90 } 91 92 93 [TestMethod] 94 [TestCategory("Problems.DataAnalysis.Symbolic")] 95 [TestProperty("Time", "long")] 96 public void LinearInterpreterTestTypeCoherentGrammarPerformance() { 97 TestTypeCoherentGrammarPerformance(new SymbolicDataAnalysisExpressionTreeLinearInterpreter(), 12.5e6); 98 } 99 [TestMethod] 100 [TestCategory("Problems.DataAnalysis.Symbolic")] 101 [TestProperty("Time", "long")] 102 public void LinearInterpreterTestFullGrammarPerformance() { 103 TestFullGrammarPerformance(new SymbolicDataAnalysisExpressionTreeLinearInterpreter(), 12.5e6); 104 } 105 [TestMethod] 106 [TestCategory("Problems.DataAnalysis.Symbolic")] 107 [TestProperty("Time", "long")] 108 public void LinearInterpreterTestArithmeticGrammarPerformance() { 109 TestArithmeticGrammarPerformance(new SymbolicDataAnalysisExpressionTreeLinearInterpreter(), 12.5e6); 110 } 111 112 private void TestTypeCoherentGrammarPerformance(ISymbolicDataAnalysisExpressionTreeInterpreter interpreter, double nodesPerSecThreshold) { 80 113 var twister = new MersenneTwister(31415); 81 114 var dataset = Util.CreateRandomDataset(twister, Rows, Columns); … … 95 128 } 96 129 97 private void FullGrammarPerformanceTest(ISymbolicDataAnalysisExpressionTreeInterpreter interpreter, double nodesPerSecThreshold) {130 private void TestFullGrammarPerformance(ISymbolicDataAnalysisExpressionTreeInterpreter interpreter, double nodesPerSecThreshold) { 98 131 var twister = new MersenneTwister(31415); 99 132 var dataset = Util.CreateRandomDataset(twister, Rows, Columns); … … 112 145 } 113 146 114 private void ArithmeticGrammarPerformanceTest(ISymbolicDataAnalysisExpressionTreeInterpreter interpreter, double nodesPerSecThreshold) {147 private void TestArithmeticGrammarPerformance(ISymbolicDataAnalysisExpressionTreeInterpreter interpreter, double nodesPerSecThreshold) { 115 148 var twister = new MersenneTwister(31415); 116 149 var dataset = Util.CreateRandomDataset(twister, Rows, Columns); 117 150 var grammar = new ArithmeticExpressionGrammar(); 151 //grammar.Symbols.OfType<Variable>().First().Enabled = false; 118 152 grammar.MaximumFunctionArguments = 0; 119 153 grammar.MaximumFunctionDefinitions = 0; … … 135 169 ///</summary> 136 170 [TestMethod] 137 public void SymbolicDataAnalysisExpressionTreeInterpreterEvaluateTest() { 138 Dataset ds = new Dataset(new string[] { "Y", "A", "B" }, new double[,] { 139 { 1.0, 1.0, 1.0 }, 140 { 2.0, 2.0, 2.0 }, 141 { 3.0, 1.0, 2.0 }, 142 { 4.0, 1.0, 1.0 }, 143 { 5.0, 2.0, 2.0 }, 144 { 6.0, 1.0, 2.0 }, 145 { 7.0, 1.0, 1.0 }, 146 { 8.0, 2.0, 2.0 }, 147 { 9.0, 1.0, 2.0 }, 148 { 10.0, 1.0, 1.0 }, 149 { 11.0, 2.0, 2.0 }, 150 { 12.0, 1.0, 2.0 } 151 }); 152 171 [TestCategory("Problems.DataAnalysis.Symbolic")] 172 [TestProperty("Time", "short")] 173 public void StandardInterpreterTestEvaluation() { 153 174 var interpreter = new SymbolicDataAnalysisExpressionTreeInterpreter(); 154 175 EvaluateTerminals(interpreter, ds); … … 158 179 159 180 [TestMethod] 160 public void SymbolicDataAnalysisExpressionILEmittingTreeInterpreterEvaluateTest() { 161 Dataset ds = new Dataset(new string[] { "Y", "A", "B" }, new double[,] { 162 { 1.0, 1.0, 1.0 }, 163 { 2.0, 2.0, 2.0 }, 164 { 3.0, 1.0, 2.0 }, 165 { 4.0, 1.0, 1.0 }, 166 { 5.0, 2.0, 2.0 }, 167 { 6.0, 1.0, 2.0 }, 168 { 7.0, 1.0, 1.0 }, 169 { 8.0, 2.0, 2.0 }, 170 { 9.0, 1.0, 2.0 }, 171 { 10.0, 1.0, 1.0 }, 172 { 11.0, 2.0, 2.0 }, 173 { 12.0, 1.0, 2.0 } 174 }); 175 181 [TestCategory("Problems.DataAnalysis.Symbolic")] 182 [TestProperty("Time", "short")] 183 public void ILEmittingInterpreterTestEvaluation() { 176 184 var interpreter = new SymbolicDataAnalysisExpressionTreeILEmittingInterpreter(); 185 EvaluateTerminals(interpreter, ds); 186 EvaluateOperations(interpreter, ds); 187 } 188 189 [TestMethod] 190 [TestCategory("Problems.DataAnalysis.Symbolic")] 191 [TestProperty("Time", "short")] 192 public void LinearInterpreterTestEvaluation() { 193 var interpreter = new SymbolicDataAnalysisExpressionTreeLinearInterpreter(); 194 195 //ADFs are not supported by the linear interpreter 177 196 EvaluateTerminals(interpreter, ds); 178 197 EvaluateOperations(interpreter, ds); … … 298 317 Evaluate(interpreter, ds, "(and (log -1.0) 1.0)", 0, -1.0); // (and NaN 1.0) 299 318 300 301 319 // OR 302 320 Evaluate(interpreter, ds, "(or -1.0 -2.0)", 0, -1.0); … … 309 327 Evaluate(interpreter, ds, "(or (log -1.0))", 0, -1.0); // (or NaN) 310 328 Evaluate(interpreter, ds, "(or (log -1.0) 1.0)", 0, -1.0); // (or NaN 1.0) 329 330 // XOR 331 Evaluate(interpreter, ds, "(xor -1.0 -2.0)", 0, -1.0); 332 Evaluate(interpreter, ds, "(xor -1.0 2.0)", 0, 1.0); 333 Evaluate(interpreter, ds, "(xor 1.0 -2.0)", 0, 1.0); 334 Evaluate(interpreter, ds, "(xor 1.0 2.0)", 0, -1.0); 335 Evaluate(interpreter, ds, "(xor 0.0 0.0)", 0, -1.0); 336 Evaluate(interpreter, ds, "(xor -1.0 -2.0 -3.0)", 0, -1.0); 337 Evaluate(interpreter, ds, "(xor -1.0 -2.0 3.0)", 0, 1.0); 338 Evaluate(interpreter, ds, "(xor -1.0 2.0 3.0)", 0, -1.0); 339 Evaluate(interpreter, ds, "(xor 1.0 2.0 3.0)", 0, 1.0); 340 Evaluate(interpreter, ds, "(xor (log -1.0))", 0, -1.0); 341 Evaluate(interpreter, ds, "(xor (log -1.0) 1.0)", 0, 1.0); 311 342 312 343 // sin, cos, tan -
branches/HiveStatistics/sources/HeuristicLab.Tests/HeuristicLab.Problems.DataAnalysis.Symbolic-3.4/SymbolicDataAnalysisExpressionTreeSimplifierTest.cs
r7915 r11202 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 2Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2014 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. … … 23 23 using System.Collections.Generic; 24 24 using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding; 25 using HeuristicLab.Problems.DataAnalysis.Symbolic;26 25 using Microsoft.VisualStudio.TestTools.UnitTesting; 27 26 28 namespace HeuristicLab.Problems.DataAnalysis.Symbolic _34.Tests {27 namespace HeuristicLab.Problems.DataAnalysis.Symbolic.Tests { 29 28 30 29 [TestClass()] 31 30 public class SymbolicDataAnalysisExpressionTreeSimplifierTest { 31 32 32 [TestMethod] 33 [TestCategory("Problems.DataAnalysis")] 34 [TestProperty("Time", "short")] 33 35 public void SimplifierAxiomsTest() { 34 36 SymbolicExpressionImporter importer = new SymbolicExpressionImporter(); -
branches/HiveStatistics/sources/HeuristicLab.Tests/HeuristicLab.Problems.DataAnalysis.Symbolic-3.4/SymbolicExpressionImporter.cs
r8123 r11202 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 2Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2014 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. … … 25 25 using System.Linq; 26 26 using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding; 27 using HeuristicLab.Problems.DataAnalysis.Symbolic; 28 29 namespace HeuristicLab.Problems.DataAnalysis.Symbolic_34.Tests { 27 28 namespace HeuristicLab.Problems.DataAnalysis.Symbolic.Tests { 30 29 internal class SymbolicExpressionImporter { 31 30 private const string VARSTART = "VAR"; … … 71 70 {"OR", new Or()}, 72 71 {"NOT", new Not()}, 72 {"XOR", new Xor()}, 73 73 {"DIFF", new Derivative()}, 74 74 {"PROG", new ProgramRootSymbol()}, … … 85 85 ProgramRootSymbol programRootSymbol = new ProgramRootSymbol(); 86 86 StartSymbol startSymbol = new StartSymbol(); 87 88 public SymbolicExpressionImporter() {89 }90 87 91 88 internal ISymbolicExpressionTree Import(string str) { -
branches/HiveStatistics/sources/HeuristicLab.Tests/HeuristicLab.Problems.DataAnalysis.Symbolic-3.4/Token.cs
r7915 r11202 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 2Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2014 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. … … 22 22 using System.Globalization; 23 23 24 namespace HeuristicLab.Problems.DataAnalysis.Symbolic _34.Tests {24 namespace HeuristicLab.Problems.DataAnalysis.Symbolic.Tests { 25 25 internal enum TokenSymbol { LPAR, RPAR, SYMB, NUMBER }; 26 26 internal class Token { -
branches/HiveStatistics/sources/HeuristicLab.Tests/HeuristicLab.Problems.DataAnalysis.Symbolic-3.4/Util.cs
r7915 r11202 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 2Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2014 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. … … 25 25 using System.Linq; 26 26 using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding; 27 using HeuristicLab.Problems.DataAnalysis.Symbolic;28 27 using HeuristicLab.Random; 29 namespace HeuristicLab.Problems.DataAnalysis.Symbolic _34.Tests {28 namespace HeuristicLab.Problems.DataAnalysis.Symbolic.Tests { 30 29 internal class Util { 31 30
Note: See TracChangeset
for help on using the changeset viewer.