Changeset 17948
- Timestamp:
- 04/16/21 19:24:30 (4 years ago)
- Location:
- trunk/HeuristicLab.Tests
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/HeuristicLab.Tests/HeuristicLab-3.3/Samples/GPSymbolicRegressionSampleWithOSTest.cs
r17180 r17948 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. 71 Assert.AreEqual(0.99 174959007940156, SamplesUtils.GetDoubleResult(osga, "BestQuality"), 1E-8, Environment.NewLine + "Best Quality differs.");72 Assert.AreEqual(0.9 836083751914968, SamplesUtils.GetDoubleResult(osga, "CurrentAverageQuality"), 1E-8, Environment.NewLine + "Current Average Quality differs.");73 Assert.AreEqual(0. 98298394717065463, SamplesUtils.GetDoubleResult(osga, "CurrentWorstQuality"), 1E-8, Environment.NewLine + "Current Worst Quality differs.");74 Assert.AreEqual(10 100, SamplesUtils.GetIntResult(osga, "EvaluatedSolutions"), Environment.NewLine + "Evaluated Solutions differ.");75 Assert.AreEqual(0.99 174959007940156, bestTrainingSolution.TrainingRSquared, 1E-8, Environment.NewLine + "Best Training Solution Training R² differs.");76 Assert.AreEqual(0. 8962902319942232, bestTrainingSolution.TestRSquared, 1E-8, Environment.NewLine + "Best Training Solution Test R² differs.");71 Assert.AreEqual(0.996270926227739, SamplesUtils.GetDoubleResult(osga, "BestQuality"), 1E-8, Environment.NewLine + "Best Quality differs."); 72 Assert.AreEqual(0.95742113235788184, SamplesUtils.GetDoubleResult(osga, "CurrentAverageQuality"), 1E-8, Environment.NewLine + "Current Average Quality differs."); 73 Assert.AreEqual(0.83998301518760388, SamplesUtils.GetDoubleResult(osga, "CurrentWorstQuality"), 1E-8, Environment.NewLine + "Current Worst Quality differs."); 74 Assert.AreEqual(10600, SamplesUtils.GetIntResult(osga, "EvaluatedSolutions"), Environment.NewLine + "Evaluated Solutions differ."); 75 Assert.AreEqual(0.996270926227739, bestTrainingSolution.TrainingRSquared, 1E-8, Environment.NewLine + "Best Training Solution Training R² differs."); 76 Assert.AreEqual(0.9963422035282139, bestTrainingSolution.TestRSquared, 1E-8, Environment.NewLine + "Best Training Solution Test R² differs."); 77 77 } else { 78 Assert.AreEqual(0.9 971536312165723, SamplesUtils.GetDoubleResult(osga, "BestQuality"), 1E-8, Environment.NewLine + "Best Qualitiy differs.");79 Assert.AreEqual(0. 98382832370544937, SamplesUtils.GetDoubleResult(osga, "CurrentAverageQuality"), 1E-8, Environment.NewLine + "Current Average Quality differs.");80 Assert.AreEqual(0. 960805603777699, SamplesUtils.GetDoubleResult(osga, "CurrentWorstQuality"), 1E-8, Environment.NewLine + "Current Worst Quality differs.");81 Assert.AreEqual(10 500, SamplesUtils.GetIntResult(osga, "EvaluatedSolutions"), Environment.NewLine + "Evaluated Solutions differ.");82 Assert.AreEqual(0.9 971536312165723, bestTrainingSolution.TrainingRSquared, 1E-8, Environment.NewLine + "Best Training Solution Training R² differs.");83 Assert.AreEqual(0.0 10190137960908724, bestTrainingSolution.TestRSquared, 1E-8, Environment.NewLine + "Best Training Solution Test R² differs.");78 Assert.AreEqual(0.9784573626949189, SamplesUtils.GetDoubleResult(osga, "BestQuality"), 1E-8, Environment.NewLine + "Best Quality differs."); 79 Assert.AreEqual(0.82804701987417961, SamplesUtils.GetDoubleResult(osga, "CurrentAverageQuality"), 1E-8, Environment.NewLine + "Current Average Quality differs."); 80 Assert.AreEqual(0.700208975867862, SamplesUtils.GetDoubleResult(osga, "CurrentWorstQuality"), 1E-8, Environment.NewLine + "Current Worst Quality differs."); 81 Assert.AreEqual(10300, SamplesUtils.GetIntResult(osga, "EvaluatedSolutions"), Environment.NewLine + "Evaluated Solutions differ."); 82 Assert.AreEqual(0.9784573626949189, bestTrainingSolution.TrainingRSquared, 1E-8, Environment.NewLine + "Best Training Solution Training R² differs."); 83 Assert.AreEqual(0.0014620645328474451, bestTrainingSolution.TestRSquared, 1E-8, Environment.NewLine + "Best Training Solution Test R² differs."); 84 84 } 85 85 } -
trunk/HeuristicLab.Tests/HeuristicLab-3.3/Samples/GaussianProcessRegressionSampleTest.cs
r17428 r17948 52 52 gpr.Seed = 1618551877; 53 53 SamplesUtils.RunAlgorithm(gpr); 54 Assert.AreEqual(-9 40.70700288855619, SamplesUtils.GetDoubleResult(gpr, "NegativeLogLikelihood"));55 Assert.AreEqual(0.995 63390794061979, SamplesUtils.GetDoubleResult(gpr, "Training R²"));54 Assert.AreEqual(-992.445399028808, SamplesUtils.GetDoubleResult(gpr, "NegativeLogLikelihood"), 1e-8); 55 Assert.AreEqual(0.99559260785271853, SamplesUtils.GetDoubleResult(gpr, "Training R²"), 1e-8); 56 56 } 57 57 -
trunk/HeuristicLab.Tests/HeuristicLab.Problems.DataAnalysis-3.4/ClassificationVariableImpactCalculationTest.cs
r16422 r17948 214 214 private Dictionary<string, double> GetExpectedValuesForIrisKNNModel() { 215 215 Dictionary<string, double> expectedImpacts = new Dictionary<string, double>(); 216 expectedImpacts.Add("petal_length", 0.2 1);217 expectedImpacts.Add("petal_width", 0. 25);218 expectedImpacts.Add("sepal_length", 0. 05);216 expectedImpacts.Add("petal_length", 0.22); 217 expectedImpacts.Add("petal_width", 0.35); 218 expectedImpacts.Add("sepal_length", 0.15); 219 219 expectedImpacts.Add("sepal_width", 0.05); 220 220 -
trunk/HeuristicLab.Tests/HeuristicLab.Problems.DataAnalysis-3.4/RegressionVariableImpactCalculationTest.cs
r16443 r17948 271 271 private Dictionary<string, double> GetExpectedValuesForRFTower() { 272 272 Dictionary<string, double> expectedImpacts = new Dictionary<string, double>(); 273 expectedImpacts.Add("x 5", 0.00138095702433039);274 expectedImpacts.Add("x 19", 0.00220739387855795);275 expectedImpacts.Add("x 14", 0.00225120540266954);276 expectedImpacts.Add("x 18", 0.00311857736968479);277 expectedImpacts.Add("x 9", 0.00313474690023097);278 expectedImpacts.Add("x 20", 0.00321781251408282);279 expectedImpacts.Add("x 21", 0.00397483365571383);280 expectedImpacts.Add("x 16", 0.00433280262892111);281 expectedImpacts.Add("x 15", 0.00529918809786456);282 expectedImpacts.Add("x 3", 0.00658791244929757);283 expectedImpacts.Add("x 24", 0.0078645281886035);284 expectedImpacts.Add("x 4", 0.00907314110749047);285 expectedImpacts.Add("x13", 0.0 102943761648944);286 expectedImpacts.Add("x 22", 0.0107132858548163);287 expectedImpacts.Add("x1 2", 0.0157078677788507);288 expectedImpacts.Add("x 23", 0.0235857534562318);289 expectedImpacts.Add("x 7", 0.0304143401617055);290 expectedImpacts.Add("x1 1", 0.0310773441767309);291 expectedImpacts.Add("x 25", 0.0328308945873665);292 expectedImpacts.Add("x 17", 0.0428771226844575);293 expectedImpacts.Add("x 10", 0.0456335367972532);294 expectedImpacts.Add("x 8", 0.049849257881126);295 expectedImpacts.Add("x 1", 0.0663686086323108);296 expectedImpacts.Add("x2 ", 0.0799083890750926);297 expectedImpacts.Add("x 6", 0.196557814244287);273 expectedImpacts.Add("x1", 0.0460043373592669); 274 expectedImpacts.Add("x2", 0.0771677998074048); 275 expectedImpacts.Add("x3", 0.00619316631767142); 276 expectedImpacts.Add("x4", 0.0173307649229608); 277 expectedImpacts.Add("x5", 0.00165078943166208); 278 expectedImpacts.Add("x6", 0.393797136971534); 279 expectedImpacts.Add("x7", 0.0103041010136826); 280 expectedImpacts.Add("x8", 0.0218489557817256); 281 expectedImpacts.Add("x9", 0.0033320239547433); 282 expectedImpacts.Add("x10", 0.0386869026272391); 283 expectedImpacts.Add("x11", 0.0194313200667007); 284 expectedImpacts.Add("x12", 0.00685957264555537); 285 expectedImpacts.Add("x13", 0.00996030046057605); 286 expectedImpacts.Add("x14", 0.00290837005063926); 287 expectedImpacts.Add("x15", 0.00487537076065259); 288 expectedImpacts.Add("x16", 0.00469764322452204); 289 expectedImpacts.Add("x17", 0.0373542975924628); 290 expectedImpacts.Add("x18", 0.00208482408757715); 291 expectedImpacts.Add("x19", 0.00250463259329947); 292 expectedImpacts.Add("x20", 0.00211501042751294); 293 expectedImpacts.Add("x21", 0.0028823562854704); 294 expectedImpacts.Add("x22", 0.0113878041309722); 295 expectedImpacts.Add("x23", 0.0454532954039953); 296 expectedImpacts.Add("x24", 0.0115989415893684); 297 expectedImpacts.Add("x25", 0.0196479481586532); 298 298 299 299 return expectedImpacts; -
trunk/HeuristicLab.Tests/HeuristicLab.Problems.DataAnalysis.Symbolic-3.4/SymbolicDataAnalysisExpressionTreeInterpreterTest.cs
r17180 r17948 274 274 [TestProperty("Time", "long")] 275 275 public void TestCompiledInterpreterEstimatedValuesConsistency() { 276 const double delta = 1e- 12;276 const double delta = 1e-8; 277 277 278 278 var twister = new MersenneTwister(); … … 288 288 grammar.ConfigureAsDefaultRegressionGrammar(); 289 289 grammar.Symbols.First(x => x.Name == "Power Functions").Enabled = true; 290 grammar.Symbols.First(x => x is Cube).Enabled = true; 291 grammar.Symbols.First(x => x is CubeRoot).Enabled = true; 292 grammar.Symbols.First(x => x is Square).Enabled = true; 293 grammar.Symbols.First(x => x is SquareRoot).Enabled = true; 294 grammar.Symbols.First(x => x is Absolute).Enabled = true; 295 grammar.Symbols.First(x => x is Sine).Enabled = true; 296 grammar.Symbols.First(x => x is Cosine).Enabled = true; 297 grammar.Symbols.First(x => x is Tangent).Enabled = true; 298 grammar.Symbols.First(x => x is Root).Enabled = false; 299 grammar.Symbols.First(x => x is Power).Enabled = false; 290 300 291 301 var randomTrees = Util.CreateRandomTrees(twister, dataset, grammar, N, 1, 10, 0, 0); … … 339 349 } 340 350 string errorMessage = string.Format("Interpreters {0} and {1} do not agree on tree {2} and row {3} (seed = {4}).", interpreters[m].Name, interpreters[n].Name, i, row, seed); 341 Assert.AreEqual(v1, v2, delta, errorMessage); 351 Assert.IsTrue(double.IsPositiveInfinity(v1) && double.IsPositiveInfinity(v2) || 352 double.IsNaN(v1) && double.IsNaN(v2) || 353 double.IsNegativeInfinity(v1) && double.IsNegativeInfinity(v2) || 354 Math.Abs(1.0 - v1 / v2) < delta, errorMessage); 342 355 } 343 356 } -
trunk/HeuristicLab.Tests/HeuristicLab.Scripting-3.3/GridSearchRFClassificationScriptTest.cs
r17180 r17948 59 59 60 60 var bestSolution = ScriptingUtils.GetVariable<IClassificationSolution>(script, BestSolutionVariableName); 61 Assert.AreEqual(0.85 179407176287, bestSolution.TrainingAccuracy, 1E-8);62 Assert.AreEqual(0.8 1875, bestSolution.TestAccuracy, 1E-8);61 Assert.AreEqual(0.858034321372855, bestSolution.TrainingAccuracy, 1E-8); 62 Assert.AreEqual(0.821875, bestSolution.TestAccuracy, 1E-8); 63 63 } 64 64 -
trunk/HeuristicLab.Tests/HeuristicLab.Scripting-3.3/GridSearchRFRegressionScriptTest.cs
r17180 r17948 59 59 60 60 var bestSolution = ScriptingUtils.GetVariable<IRegressionSolution>(script, BestSolutionVariableName); 61 Assert.AreEqual(0.96 8329534139836, bestSolution.TrainingRSquared, 1E-8);62 Assert.AreEqual(0.98 2380790563445, bestSolution.TestRSquared, 1E-8);61 Assert.AreEqual(0.964218622548574, bestSolution.TrainingRSquared, 1E-8); 62 Assert.AreEqual(0.985989017766796, bestSolution.TestRSquared, 1E-8); 63 63 } 64 64 -
trunk/HeuristicLab.Tests/HeuristicLab.Tests.csproj
r17823 r17948 109 109 </PropertyGroup> 110 110 <ItemGroup> 111 <Reference Include="ALGLIB-3. 7.0">112 <HintPath>..\bin\ALGLIB-3. 7.0.dll</HintPath>111 <Reference Include="ALGLIB-3.17.0"> 112 <HintPath>..\bin\ALGLIB-3.17.0.dll</HintPath> 113 113 <Private>False</Private> 114 114 </Reference> … … 201 201 <SpecificVersion>False</SpecificVersion> 202 202 <HintPath>..\bin\HeuristicLab.Encodings.LinearLinkageEncoding-3.4.dll</HintPath> 203 <Private>False</Private> 203 204 </Reference> 204 205 <Reference Include="HeuristicLab.Encodings.PermutationEncoding-3.3"> … … 277 278 <Private>False</Private> 278 279 </Reference> 279 <Reference Include="HeuristicLab.Problems.DataAnalysis-3.4"> 280 <Reference Include="HeuristicLab.Problems.DataAnalysis-3.4, Version=3.4.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL"> 281 <SpecificVersion>False</SpecificVersion> 280 282 <HintPath>..\bin\HeuristicLab.Problems.DataAnalysis-3.4.dll</HintPath> 281 283 <Private>False</Private> 282 284 </Reference> 283 <Reference Include="HeuristicLab.Problems.DataAnalysis.Symbolic-3.4"> 285 <Reference Include="HeuristicLab.Problems.DataAnalysis.Symbolic-3.4, Version=3.4.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL"> 286 <SpecificVersion>False</SpecificVersion> 284 287 <HintPath>..\bin\HeuristicLab.Problems.DataAnalysis.Symbolic-3.4.dll</HintPath> 285 288 <Private>False</Private>
Note: See TracChangeset
for help on using the changeset viewer.