Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
01/11/11 15:03:46 (14 years ago)
Author:
gkronber
Message:

Merged changes from trunk to data analysis exploration branch and added fractional distance metric evaluator. #1142

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/DataAnalysis/HeuristicLab.Problems.DataAnalysis.Regression/3.3/Symbolic/SymbolicRegressionProblem.cs

    r4341 r5275  
    3434  [Creatable("Problems")]
    3535  [StorableClass]
    36   public class SymbolicRegressionProblem : SymbolicRegressionProblemBase, ISingleObjectiveProblem {
     36  public sealed class SymbolicRegressionProblem : SymbolicRegressionProblemBase, ISingleObjectiveDataAnalysisProblem {
    3737
    3838    #region Parameter Properties
     
    7474
    7575    [StorableConstructor]
    76     protected SymbolicRegressionProblem(bool deserializing) : base(deserializing) { }
     76    private SymbolicRegressionProblem(bool deserializing) : base(deserializing) { }
     77    private SymbolicRegressionProblem(SymbolicRegressionProblem original, Cloner cloner)
     78      : base(original, cloner) {
     79      RegisterParameterEvents();
     80      RegisterParameterValueEvents();
     81    }
     82
    7783    public SymbolicRegressionProblem()
    7884      : base() {
     
    8187      Parameters.Add(new ValueParameter<ISymbolicRegressionEvaluator>("Evaluator", "The operator which should be used to evaluate symbolic regression solutions.", evaluator));
    8288      Parameters.Add(new OptionalValueParameter<DoubleValue>("BestKnownQuality", "The minimal error value that reached by symbolic regression solutions for the problem."));
    83 
    84       evaluator.QualityParameter.ActualName = "TrainingPearsonR2";
    8589
    8690      InitializeOperators();
     
    9296
    9397    public override IDeepCloneable Clone(Cloner cloner) {
    94       SymbolicRegressionProblem clone = (SymbolicRegressionProblem)base.Clone(cloner);
    95       clone.RegisterParameterEvents();
    96       clone.RegisterParameterValueEvents();
    97       return clone;
     98      return new SymbolicRegressionProblem(this, cloner);
    9899    }
    99100
     
    146147    private void InitializeOperators() {
    147148      AddOperator(new FixedValidationBestScaledSymbolicRegressionSolutionAnalyzer());
     149      AddOperator(new SymbolicRegressionOverfittingAnalyzer());
    148150      ParameterizeAnalyzers();
    149151    }
     
    159161      foreach (var analyzer in Analyzers) {
    160162        analyzer.SymbolicExpressionTreeParameter.ActualName = SolutionCreator.SymbolicExpressionTreeParameter.ActualName;
     163        var validationSolutionAnalyzer = analyzer as SymbolicRegressionValidationAnalyzer;
     164        if (validationSolutionAnalyzer != null) {
     165          validationSolutionAnalyzer.ProblemDataParameter.ActualName = DataAnalysisProblemDataParameter.Name;
     166          validationSolutionAnalyzer.UpperEstimationLimitParameter.ActualName = UpperEstimationLimitParameter.Name;
     167          validationSolutionAnalyzer.LowerEstimationLimitParameter.ActualName = LowerEstimationLimitParameter.Name;
     168          validationSolutionAnalyzer.SymbolicExpressionTreeInterpreterParameter.ActualName = SymbolicExpressionTreeInterpreterParameter.Name;
     169          validationSolutionAnalyzer.SymbolicExpressionTreeParameter.ActualName = SolutionCreator.SymbolicExpressionTreeParameter.ActualName;
     170          validationSolutionAnalyzer.ValidationSamplesStartParameter.Value = ValidationSamplesStart;
     171          validationSolutionAnalyzer.ValidationSamplesEndParameter.Value = ValidationSamplesEnd;
     172        }
     173
    161174        var fixedBestValidationSolutionAnalyzer = analyzer as FixedValidationBestScaledSymbolicRegressionSolutionAnalyzer;
    162175        if (fixedBestValidationSolutionAnalyzer != null) {
    163           fixedBestValidationSolutionAnalyzer.ProblemDataParameter.ActualName = DataAnalysisProblemDataParameter.Name;
    164           fixedBestValidationSolutionAnalyzer.UpperEstimationLimitParameter.ActualName = UpperEstimationLimitParameter.Name;
    165           fixedBestValidationSolutionAnalyzer.LowerEstimationLimitParameter.ActualName = LowerEstimationLimitParameter.Name;
    166           fixedBestValidationSolutionAnalyzer.SymbolicExpressionTreeInterpreterParameter.ActualName = SymbolicExpressionTreeInterpreterParameter.Name;
    167           fixedBestValidationSolutionAnalyzer.SymbolicExpressionTreeParameter.ActualName = SolutionCreator.SymbolicExpressionTreeParameter.ActualName;
    168           fixedBestValidationSolutionAnalyzer.ValidationSamplesStartParameter.Value = ValidationSamplesStart;
    169           fixedBestValidationSolutionAnalyzer.ValidationSamplesEndParameter.Value = ValidationSamplesEnd;
    170176          fixedBestValidationSolutionAnalyzer.BestKnownQualityParameter.ActualName = BestKnownQualityParameter.Name;
    171177        }
     178
    172179        var bestValidationSolutionAnalyzer = analyzer as ValidationBestScaledSymbolicRegressionSolutionAnalyzer;
    173180        if (bestValidationSolutionAnalyzer != null) {
Note: See TracChangeset for help on using the changeset viewer.