Free cookie consent management tool by TermsFeed Policy Generator

Changeset 3800


Ignore:
Timestamp:
05/13/10 20:24:45 (15 years ago)
Author:
gkronber
Message:

Fixed best known solution tracking for symbolic regression problems. #893

Location:
trunk/sources/HeuristicLab.Problems.DataAnalysis.Regression/3.3/Symbolic
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Problems.DataAnalysis.Regression/3.3/Symbolic/Analyzers/ValidationBestScaledSymbolicRegressionSolutionAnalyzer.cs

    r3790 r3800  
    5151    private const string SamplesStartParameterName = "SamplesStart";
    5252    private const string SamplesEndParameterName = "SamplesEnd";
    53     private const string QualityParameterName = "ScaledQuality";
     53    private const string QualityParameterName = "Quality";
     54    private const string ScaledQualityParameterName = "ScaledQuality";
    5455    private const string UpperEstimationLimitParameterName = "UpperEstimationLimit";
    5556    private const string LowerEstimationLimitParameterName = "LowerEstimationLimit";
     
    6566      get { return (ScopeTreeLookupParameter<SymbolicExpressionTree>)Parameters[SymbolicExpressionTreeParameterName]; }
    6667    }
     68    public ScopeTreeLookupParameter<DoubleValue> QualityParameter {
     69      get { return (ScopeTreeLookupParameter<DoubleValue>)Parameters[QualityParameterName]; }
     70    }
    6771    public IValueLookupParameter<ISymbolicExpressionTreeInterpreter> SymbolicExpressionTreeInterpreterParameter {
    6872      get { return (IValueLookupParameter<ISymbolicExpressionTreeInterpreter>)Parameters[SymbolicExpressionTreeInterpreterParameterName]; }
     
    102106    [Storable]
    103107    private BestAverageWorstQualityCalculator bestAvgWorstValidationQualityCalculator;
     108    [Storable]
     109    private BestQualityMemorizer bestKnownQualityMemorizer;
    104110
    105111    public ValidationBestScaledSymbolicRegressionSolutionAnalyzer()
    106112      : base() {
    107113      Parameters.Add(new ScopeTreeLookupParameter<SymbolicExpressionTree>(SymbolicExpressionTreeParameterName, "The symbolic expression trees to analyze."));
     114      Parameters.Add(new ScopeTreeLookupParameter<DoubleValue>(QualityParameterName, "The quality of the symbolic expression trees to analyze."));
    108115      Parameters.Add(new ValueLookupParameter<ISymbolicExpressionTreeInterpreter>(SymbolicExpressionTreeInterpreterParameterName, "The interpreter that should be used for the analysis of symbolic expression trees."));
    109116      Parameters.Add(new ValueLookupParameter<DataAnalysisProblemData>(ProblemDataParameterName, "The problem data for which the symbolic expression tree is a solution."));
     
    122129      SymbolicRegressionMeanSquaredErrorEvaluator validationMseEvaluator = new SymbolicRegressionMeanSquaredErrorEvaluator();
    123130      bestSolutionAnalyzer = new BestSymbolicRegressionSolutionAnalyzer();
    124       BestQualityMemorizer bestKnownQualityMemorizer = new BestQualityMemorizer();
    125        bestAvgWorstValidationQualityCalculator = new BestAverageWorstQualityCalculator();
     131      bestKnownQualityMemorizer = new BestQualityMemorizer();
     132      bestAvgWorstValidationQualityCalculator = new BestAverageWorstQualityCalculator();
    126133      DataTableValuesCollector validationValuesCollector = new DataTableValuesCollector();
    127134      ResultsCollector resultsCollector = new ResultsCollector();
     
    140147      validationMseEvaluator.SymbolicExpressionTreeParameter.ActualName = ScaledSymbolicExpressionTreeParameterName;
    141148      validationMseEvaluator.SymbolicExpressionTreeInterpreterParameter.ActualName = SymbolicExpressionTreeInterpreterParameter.Name;
    142       validationMseEvaluator.QualityParameter.ActualName = QualityParameterName;
     149      validationMseEvaluator.QualityParameter.ActualName = ScaledQualityParameterName;
    143150      validationMseEvaluator.RegressionProblemDataParameter.ActualName = ProblemDataParameter.Name;
    144151      validationMseEvaluator.SamplesStartParameter.ActualName = SamplesStartParameter.Name;
     
    149156      bestSolutionAnalyzer.LowerEstimationLimitParameter.ActualName = LowerEstimationLimitParameter.Name;
    150157      bestSolutionAnalyzer.ProblemDataParameter.ActualName = ProblemDataParameter.Name;
    151       bestSolutionAnalyzer.QualityParameter.ActualName = QualityParameterName;
     158      bestSolutionAnalyzer.QualityParameter.ActualName = ScaledQualityParameterName;
    152159      bestSolutionAnalyzer.ResultsParameter.ActualName = ResultsParameter.Name;
    153160      bestSolutionAnalyzer.SymbolicExpressionTreeInterpreterParameter.ActualName = SymbolicExpressionTreeInterpreterParameter.Name;
     
    159166      bestAvgWorstValidationQualityCalculator.BestQualityParameter.ActualName = CurrentBestValidationQualityParameterName;
    160167      bestAvgWorstValidationQualityCalculator.MaximizationParameter.Value = new BoolValue(false);
    161       bestAvgWorstValidationQualityCalculator.QualityParameter.ActualName = QualityParameterName;
     168      bestAvgWorstValidationQualityCalculator.QualityParameter.ActualName = ScaledQualityParameterName;
    162169      bestAvgWorstValidationQualityCalculator.QualityParameter.Depth = SymbolicExpressionTreeParameter.Depth;
    163170      bestAvgWorstValidationQualityCalculator.WorstQualityParameter.ActualName = "Current worst validation quality";
     
    165172      bestKnownQualityMemorizer.BestQualityParameter.ActualName = BestKnownQualityParameterName;
    166173      bestKnownQualityMemorizer.MaximizationParameter.Value = new BoolValue(false);
    167       bestKnownQualityMemorizer.QualityParameter.ActualName = CurrentBestValidationQualityParameterName;
    168       bestKnownQualityMemorizer.QualityParameter.Depth = 0;
     174      bestKnownQualityMemorizer.QualityParameter.ActualName = QualityParameter.Name;
     175      bestKnownQualityMemorizer.QualityParameter.Depth = QualityParameter.Depth;
    169176
    170177      validationValuesCollector.DataTableParameter.ActualName = "Validation quality";
     
    213220      bestSolutionAnalyzer.QualityParameter.Depth = SymbolicExpressionTreeParameter.Depth;
    214221      bestAvgWorstValidationQualityCalculator.QualityParameter.Depth = SymbolicExpressionTreeParameter.Depth;
     222      bestKnownQualityMemorizer.QualityParameter.Depth = SymbolicExpressionTreeParameter.Depth;
    215223    }
    216224  }
  • trunk/sources/HeuristicLab.Problems.DataAnalysis.Regression/3.3/Symbolic/SymbolicRegressionProblem.cs

    r3791 r3800  
    247247    protected override void OnDataAnalysisProblemChanged(EventArgs e) {
    248248      base.OnDataAnalysisProblemChanged(e);
     249      BestKnownQualityParameter.Value = null;
    249250      // paritions could be changed
    250251      ParameterizeEvaluator();
     
    403404          bestValidationSolutionAnalyzer.SamplesEndParameter.Value = ValidationSamplesEnd;
    404405          bestValidationSolutionAnalyzer.BestKnownQualityParameter.ActualName = BestKnownQualityParameter.Name;
     406          bestValidationSolutionAnalyzer.QualityParameter.ActualName = Evaluator.QualityParameter.ActualName;
    405407        }
    406408        var varFreqAnalyzer = analyzer as SymbolicRegressionVariableFrequencyAnalyzer;
Note: See TracChangeset for help on using the changeset viewer.