- Timestamp:
- 04/26/10 11:05:28 (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Problems.DataAnalysis.Regression/3.3/Symbolic/BestValidationSymbolicRegressionSolutionVisualizer.cs
r3513 r3531 31 31 using HeuristicLab.Problems.DataAnalysis.Evaluators; 32 32 using HeuristicLab.Problems.DataAnalysis.Symbolic; 33 using System.Collections.Generic; 34 using HeuristicLab.Analysis; 33 35 34 36 namespace HeuristicLab.Problems.DataAnalysis.Regression.Symbolic { … … 49 51 private const string QualityParameterName = "Quality"; 50 52 private const string ResultsParameterName = "Results"; 53 private const string VariableFrequenciesParameterName = "VariableFrequencies"; 51 54 52 55 #region parameter properties … … 87 90 get { return (ILookupParameter<ResultCollection>)Parameters[ResultsParameterName]; } 88 91 } 92 public ILookupParameter<DataTable> VariableFrequenciesParameter { 93 get { return (ILookupParameter<DataTable>)Parameters[VariableFrequenciesParameterName]; } 94 } 95 89 96 #endregion 90 97 … … 104 111 public IntValue ValidationSamplesEnd { 105 112 get { return ValidationSamplesEndParameter.ActualValue; } 113 } 114 public DataTable VariableFrequencies { 115 get { return VariableFrequenciesParameter.ActualValue; } 116 set { VariableFrequenciesParameter.ActualValue = value; } 106 117 } 107 118 #endregion … … 118 129 Parameters.Add(new ValueLookupParameter<IntValue>(ValidationSamplesEndParameterName, "The end index of the validation partition (part of the training partition).")); 119 130 Parameters.Add(new LookupParameter<SymbolicRegressionSolution>(BestValidationSolutionParameterName, "The best symbolic expression tree based on the validation data for the symbolic regression problem.")); 131 Parameters.Add(new LookupParameter<DataTable>(VariableFrequenciesParameterName, "The relative variable reference frequencies aggregated over the whole population.")); 120 132 Parameters.Add(new LookupParameter<ResultCollection>(ResultsParameterName, "The result collection of the algorithm.")); 121 133 } … … 124 136 ItemArray<SymbolicExpressionTree> expressions = SymbolicExpressionTreeParameter.ActualValue; 125 137 DataAnalysisProblemData problemData = DataAnalysisProblemDataParameter.ActualValue; 126 138 #region update variable frequencies 139 var inputVariables = problemData.InputVariables.Select(x => x.Value); 140 if (VariableFrequencies == null) { 141 VariableFrequencies = new DataTable("Variable Frequencies", "Relative frequency of variable references aggregated over the whole population."); 142 AddResult("VariableFrequencies", VariableFrequencies); 143 // add a data row for each input variable 144 foreach (var inputVariable in inputVariables) 145 VariableFrequencies.Rows.Add(new DataRow(inputVariable)); 146 } 147 foreach (var pair in VariableFrequencyAnalyser.CalculateVariableFrequencies(expressions, inputVariables)) { 148 VariableFrequencies.Rows[pair.Key].Values.Add(pair.Value); 149 } 150 #endregion 151 152 #region determination of validation-best solution 127 153 int validationSamplesStart = ValidationSamplesStart.Value; 128 154 int validationSamplesEnd = ValidationSamplesEnd.Value; … … 142 168 143 169 SymbolicRegressionSolution bestOfRunSolution = BestValidationSolutionParameter.ActualValue; 170 #endregion 171 #region update of validation-best solution 144 172 if (bestOfRunSolution == null) { 145 173 // no best of run solution yet -> make a solution from the currentBestExpression … … 153 181 } 154 182 } 155 156 183 #endregion 157 184 return base.Apply(); 158 185 }
Note: See TracChangeset
for help on using the changeset viewer.