Changeset 16621
- Timestamp:
- 02/26/19 13:39:59 (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/2929_PrioritizedGrammarEnumeration/HeuristicLab.Algorithms.DataAnalysis.PGE/3.3/PGE.cs
r16620 r16621 275 275 var iterationsResult = new IntValue(0); 276 276 Results.Add(new Result("Iteration", iterationsResult)); 277 var best TestScoreResult = new IntValue(0); // TODO: why is test score an int?278 Results.Add(new Result("Best test score", bestTestScoreResult));277 var bestMSEResult = new DoubleValue(); 278 Results.Add(new Result("Best MSE", bestMSEResult)); 279 279 var testScoresTable = new DataTable("Test scores"); 280 280 var bestTestScoreRow = new DataRow("Best test score"); … … 294 294 Results.Add(bestSolutionResult); 295 295 296 var allSolutions = new ItemList<IRegressionSolution>(); 297 var allSolutionsResult = new Result("Solutions", allSolutions); 298 Results.Add(allSolutionsResult); 299 296 300 // TODO: the following is potentially problematic for other go processes run on the same machine at the same time 297 301 // shouldn't be problematic bc is inherited only, normally only child processes are affected … … 341 345 ProblemTypeString: problemTypeString, numProcs: numProc); 342 346 343 var best TestScore = int.MaxValue;347 var bestMSE = double.MaxValue; 344 348 for (int iter = 1; iter <= MaxIterations; iter++) { 345 349 iterationsResult.Value = iter; … … 360 364 log.LogMessage("Push/Pop (" + iResult + ", " + testScore + ") " + eqnStr + " coeff: " + string.Join(" ", coeff)); 361 365 362 if (!string.IsNullOrEmpty(eqnStr) && (testScore < bestTestScore)) { 363 // update best quality 364 bestTestScore = testScore; 365 bestTestScoreResult.Value = testScore; 366 if (!string.IsNullOrEmpty(eqnStr)) { 366 367 var sol = CreateSolution(problemData, eqnStr, coeff, problemData.AllowedInputVariables.ToArray()); 367 bestSolutionResult.Value = sol; 368 allSolutions.Add(sol); 369 if (sol.TrainingMeanSquaredError < bestMSE) { 370 // update best quality 371 bestMSE = sol.TrainingMeanSquaredError; 372 bestMSEResult.Value = bestMSE; 373 bestSolutionResult.Value = sol; 374 } 368 375 } 369 bestTestScoreRow.Values.Add(best TestScoreResult.Value); // always add the current best test score to data row376 bestTestScoreRow.Values.Add(bestMSEResult.Value); // always add the current best test score to data row 370 377 curTestScoreRow.Values.Add(testScore); 371 378 }
Note: See TracChangeset
for help on using the changeset viewer.