Changeset 13660
- Timestamp:
- 03/07/16 15:27:37 (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression/3.4/SingleObjective/SymbolicRegressionSolutionsAnalyzer.cs
r13582 r13660 95 95 ILookupParameter<DoubleValue> testQualityParam = null; 96 96 // store actual names of parameter because it is changed below 97 string prevTrainingQualityParamName = TrainingQualityParameterName; 98 string prevTestQualityParamName = TestQualityParameterName; 99 if (Parameters.ContainsKey(TrainingQualityParameterName)) { 100 trainingQualityParam = TrainingQualityParameter; 101 prevTrainingQualityParamName = trainingQualityParam.ActualName; 102 } 103 if (Parameters.ContainsKey(TestQualityParameterName)) { 104 testQualityParam = TestQualityParameter; 105 prevTestQualityParamName = testQualityParam.ActualName; 106 } 107 97 trainingQualityParam = TrainingQualityParameter; 98 string prevTrainingQualityParamName = trainingQualityParam.ActualName; 99 testQualityParam = TestQualityParameter; 100 string prevTestQualityParamName = testQualityParam.ActualName; 108 101 foreach (var result in results.Where(r => r.Value is IRegressionSolution)) { 109 102 var solution = (IRegressionSolution)result.Value; … … 122 115 // also add training and test R² to the scope using the parameters 123 116 // HACK: we change the ActualName of the parameter to write two variables for each solution in the results collection 124 if (trainingQualityParam != null) { 125 trainingQualityParam.ActualName = trainingR2Name; 126 trainingQualityParam.ActualValue = new DoubleValue(solution.TrainingRSquared); 127 } 128 if (testQualityParam != null) { 129 testQualityParam.ActualName = testR2Name; 130 testQualityParam.ActualValue = new DoubleValue(solution.TestRSquared); 131 } 117 trainingQualityParam.ActualName = trainingR2Name; 118 trainingQualityParam.ActualValue = new DoubleValue(solution.TrainingRSquared); 119 testQualityParam.ActualName = testR2Name; 120 testQualityParam.ActualValue = new DoubleValue(solution.TestRSquared); 132 121 } 133 122 134 if (trainingQualityParam != null)trainingQualityParam.ActualName = prevTrainingQualityParamName;135 if (testQualityParam != null)testQualityParam.ActualName = prevTestQualityParamName;123 trainingQualityParam.ActualName = prevTrainingQualityParamName; 124 testQualityParam.ActualName = prevTestQualityParamName; 136 125 137 126 return base.Apply();
Note: See TracChangeset
for help on using the changeset viewer.