Changeset 5271
- Timestamp:
- 01/11/11 13:01:56 (14 years ago)
- Location:
- trunk/sources/HeuristicLab.Problems.DataAnalysis.Classification/3.3
- Files:
-
- 1 added
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Problems.DataAnalysis.Classification/3.3/HeuristicLab.Problems.DataAnalysis.Classification-3.3.csproj
r5163 r5271 12 12 <AssemblyName>HeuristicLab.Problems.DataAnalysis.Classification-3.3</AssemblyName> 13 13 <TargetFrameworkVersion>v4.0</TargetFrameworkVersion> 14 <TargetFrameworkProfile></TargetFrameworkProfile> 14 <TargetFrameworkProfile> 15 </TargetFrameworkProfile> 15 16 <FileAlignment>512</FileAlignment> 16 17 <TargetFrameworkProfile /> … … 117 118 <Compile Include="Properties\AssemblyInfo.cs" /> 118 119 <Compile Include="Interfaces\ISymbolicClassificationAnalyzer.cs" /> 120 <Compile Include="Symbolic\Analyzer\TrainingBestSymbolicClassificationSolutionAnalyzer.cs" /> 119 121 <Compile Include="Symbolic\Analyzer\ValidationBestSymbolicClassificationSolutionAnalyzer.cs" /> 120 122 <Compile Include="Symbolic\Evaluators\OnlineAccuracyEvaluator.cs" /> -
trunk/sources/HeuristicLab.Problems.DataAnalysis.Classification/3.3/Symbolic/Analyzer/ValidationBestSymbolicClassificationSolutionAnalyzer.cs
r4837 r5271 52 52 private const string UpperEstimationLimitParameterName = "UpperEstimationLimit"; 53 53 private const string LowerEstimationLimitParameterName = "LowerEstimationLimit"; 54 private const string CalculateSolutionComplexityParameterName = "CalculateSolutionComplexity"; 54 55 55 56 private const string ResultsParameterName = "Results"; … … 58 59 private const string BestSolutionAccuracyTrainingParameterName = "Best solution accuracy (training)"; 59 60 private const string BestSolutionAccuracyTestParameterName = "Best solution accuracy (test)"; 61 private const string BestSolutionLengthParameterName = "Best solution length (validation)"; 62 private const string BestSolutionHeightParameterName = "Best solution height (validiation)"; 60 63 private const string VariableFrequenciesParameterName = "VariableFrequencies"; 61 64 … … 101 104 get { return (ILookupParameter<DataTable>)Parameters[VariableFrequenciesParameterName]; } 102 105 } 103 106 public IValueParameter<BoolValue> CalculateSolutionComplexityParameter { 107 get { return (IValueParameter<BoolValue>)Parameters[CalculateSolutionComplexityParameterName]; } 108 } 104 109 public ILookupParameter<ResultCollection> ResultsParameter { 105 110 get { return (ILookupParameter<ResultCollection>)Parameters[ResultsParameterName]; } … … 116 121 public ILookupParameter<DoubleValue> BestSolutionAccuracyTestParameter { 117 122 get { return (ILookupParameter<DoubleValue>)Parameters[BestSolutionAccuracyTestParameterName]; } 123 } 124 public ILookupParameter<IntValue> BestSolutionLengthParameter { 125 get { return (ILookupParameter<IntValue>)Parameters[BestSolutionLengthParameterName]; } 126 } 127 public ILookupParameter<IntValue> BestSolutionHeightParameter { 128 get { return (ILookupParameter<IntValue>)Parameters[BestSolutionHeightParameterName]; } 118 129 } 119 130 #endregion … … 159 170 get { return VariableFrequenciesParameter.ActualValue; } 160 171 } 172 public BoolValue CalculateSolutionComplexity { 173 get { return CalculateSolutionComplexityParameter.Value; } 174 set { CalculateSolutionComplexityParameter.Value = value; } 175 } 161 176 162 177 public ResultCollection Results { … … 178 193 get { return BestSolutionAccuracyTestParameter.ActualValue; } 179 194 protected set { BestSolutionAccuracyTestParameter.ActualValue = value; } 195 } 196 public IntValue BestSolutionLength { 197 get { return BestSolutionLengthParameter.ActualValue; } 198 set { BestSolutionLengthParameter.ActualValue = value; } 199 } 200 public IntValue BestSolutionHeight { 201 get { return BestSolutionHeightParameter.ActualValue; } 202 set { BestSolutionHeightParameter.ActualValue = value; } 180 203 } 181 204 #endregion … … 202 225 Parameters.Add(new ValueLookupParameter<DoubleValue>(LowerEstimationLimitParameterName, "The lower estimation limit that was set for the evaluation of the symbolic expression trees.")); 203 226 Parameters.Add(new LookupParameter<DataTable>(VariableFrequenciesParameterName, "The variable frequencies table to use for the calculation of variable impacts")); 204 227 Parameters.Add(new ValueParameter<BoolValue>(CalculateSolutionComplexityParameterName, "Determines if the length and height of the validation best solution should be calculated.", new BoolValue(true))); 205 228 Parameters.Add(new ValueLookupParameter<ResultCollection>(ResultsParameterName, "The results collection where the analysis values should be stored.")); 206 229 Parameters.Add(new LookupParameter<DoubleValue>(BestValidationQualityParameterName, "The validation quality of the best solution in the current run.")); … … 208 231 Parameters.Add(new LookupParameter<DoubleValue>(BestSolutionAccuracyTrainingParameterName, "The training accuracy of the best solution.")); 209 232 Parameters.Add(new LookupParameter<DoubleValue>(BestSolutionAccuracyTestParameterName, "The test accuracy of the best solution.")); 233 Parameters.Add(new LookupParameter<IntValue>(BestSolutionLengthParameterName, "The length of the best symbolic classification solution.")); 234 Parameters.Add(new LookupParameter<IntValue>(BestSolutionHeightParameterName, "The height of the best symbolic classification solution.")); 235 } 236 237 [StorableHook(HookType.AfterDeserialization)] 238 private void AfterDeserialization() { 239 if (!Parameters.ContainsKey(CalculateSolutionComplexityParameterName)) { 240 Parameters.Add(new ValueParameter<BoolValue>(CalculateSolutionComplexityParameterName, "Determines if the length and height of the validation best solution should be calculated.", new BoolValue(true))); 241 } 242 if (!Parameters.ContainsKey(BestSolutionLengthParameterName)) { 243 Parameters.Add(new LookupParameter<IntValue>(BestSolutionLengthParameterName, "The length of the best symbolic classification solution.")); 244 } 245 if (!Parameters.ContainsKey(BestSolutionHeightParameterName)) { 246 Parameters.Add(new LookupParameter<IntValue>(BestSolutionHeightParameterName, "The height of the best symbolic classification solution.")); 247 } 210 248 } 211 249 … … 278 316 279 317 private void UpdateBestSolutionResults() { 318 if (CalculateSolutionComplexity.Value) { 319 BestSolutionLength = new IntValue(BestValidationSolution.Model.SymbolicExpressionTree.Size); 320 BestSolutionHeight = new IntValue(BestValidationSolution.Model.SymbolicExpressionTree.Height); 321 if (!Results.ContainsKey(BestSolutionLengthParameterName)) { 322 Results.Add(new Result(BestSolutionLengthParameterName, "Length of the best solution on the validation set", new IntValue())); 323 Results.Add(new Result(BestSolutionHeightParameterName, "Height of the best solution on the validation set", new IntValue())); 324 } 325 Results[BestSolutionLengthParameterName].Value = BestSolutionLength; 326 Results[BestSolutionHeightParameterName].Value = BestSolutionHeight; 327 } 328 280 329 BestSymbolicRegressionSolutionAnalyzer.UpdateBestSolutionResults(BestValidationSolution, ClassificationProblemData, Results, Generations, VariableFrequencies); 281 330 -
trunk/sources/HeuristicLab.Problems.DataAnalysis.Classification/3.3/Symbolic/SymbolicClassificationProblem.cs
r5118 r5271 237 237 Operators.Add(new SymbolicRegressionVariableFrequencyAnalyzer()); 238 238 Operators.Add(new ValidationBestSymbolicClassificationSolutionAnalyzer()); 239 Operators.Add(new TrainingBestSymbolicClassificationSolutionAnalyzer()); 239 240 } 240 241 … … 314 315 bestValidationSolutionAnalyzer.ValidationSamplesEndParameter.Value = ValidationSamplesEnd; 315 316 } 317 var bestTrainingSolutionAnalyzer = analyzer as TrainingBestSymbolicClassificationSolutionAnalyzer; 318 if (bestTrainingSolutionAnalyzer != null) { 319 bestTrainingSolutionAnalyzer.ProblemDataParameter.ActualName = ClassificationProblemDataParameter.Name; 320 bestTrainingSolutionAnalyzer.UpperEstimationLimitParameter.ActualName = UpperEstimationLimitParameter.Name; 321 bestTrainingSolutionAnalyzer.LowerEstimationLimitParameter.ActualName = LowerEstimationLimitParameter.Name; 322 bestTrainingSolutionAnalyzer.SymbolicExpressionTreeInterpreterParameter.ActualName = SymbolicExpressionTreeInterpreterParameter.Name; 323 bestTrainingSolutionAnalyzer.SymbolicExpressionTreeParameter.ActualName = SolutionCreator.SymbolicExpressionTreeParameter.ActualName; 324 } 316 325 var varFreqAnalyzer = analyzer as SymbolicRegressionVariableFrequencyAnalyzer; 317 326 if (varFreqAnalyzer != null) {
Note: See TracChangeset
for help on using the changeset viewer.