Changeset 3926


Ignore:
Timestamp:
06/17/10 14:43:04 (9 years ago)
Author:
mkommend
Message:

removed ScaledSymbolicExpressionTree from the scopes in the ValidationBestScaledSymbolicReressionSolutionAnalyzer and
made SymbolicExpressionTree to work without a root node (ticket #938)

Location:
trunk/sources
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.3/SymbolicExpressionTree.cs

    r3710 r3926  
    5353    public int Size {
    5454      get {
     55        if (root == null)
     56          return 0;
    5557        return root.GetSize();
    5658      }
     
    5961    public int Height {
    6062      get {
     63        if (root == null)
     64          return 0;
    6165        return root.GetHeight();
    6266      }
     
    7377
    7478    public IEnumerable<SymbolicExpressionTreeNode> IterateNodesPrefix() {
     79      if (root == null)
     80        return new SymbolicExpressionTreeNode[0];
    7581      return root.IterateNodesPrefix();
    7682    }
    7783    public IEnumerable<SymbolicExpressionTreeNode> IterateNodesPostfix() {
     84      if (root == null)
     85        return new SymbolicExpressionTreeNode[0];
    7886      return root.IterateNodesPostfix();
    7987    }
     
    8290      SymbolicExpressionTree clone = new SymbolicExpressionTree();
    8391      cloner.RegisterClonedObject(this, clone);
    84       clone.root = (SymbolicExpressionTreeNode)this.root.Clone();
     92      if (root != null)
     93        clone.root = (SymbolicExpressionTreeNode)this.root.Clone();
    8594      return clone;
    8695    }
  • trunk/sources/HeuristicLab.Problems.DataAnalysis.Regression/3.3/Symbolic/Analyzers/ValidationBestScaledSymbolicRegressionSolutionAnalyzer.cs

    r3806 r3926  
    117117
    118118    [Storable]
     119    private UniformSubScopesProcessor subScopesProcessor;
     120    [Storable]
     121    private SymbolicRegressionSolutionLinearScaler linearScaler;
     122    [Storable]
     123    private SymbolicRegressionModelQualityAnalyzer modelQualityAnalyzer;
     124    [Storable]
     125    private SymbolicRegressionMeanSquaredErrorEvaluator validationMseEvaluator;
     126    [Storable]
    119127    private BestSymbolicRegressionSolutionAnalyzer bestSolutionAnalyzer;
    120128    [Storable]
    121     private UniformSubScopesProcessor subScopesProcessor;
     129    private UniformSubScopesProcessor cleaningSubScopesProcessor;
     130    [Storable]
     131    private Assigner removeScaledExpressionTreeAssigner;
     132    [Storable]
     133    private BestQualityMemorizer bestKnownQualityMemorizer;
    122134    [Storable]
    123135    private BestAverageWorstQualityCalculator bestAvgWorstValidationQualityCalculator;
    124136    [Storable]
    125     private BestQualityMemorizer bestKnownQualityMemorizer;
    126     [Storable]
    127     private SymbolicRegressionModelQualityAnalyzer modelQualityAnalyzer;
     137    private DataTableValuesCollector validationValuesCollector;
     138    [Storable]
     139    private ResultsCollector resultsCollector;
    128140
    129141    public ValidationBestScaledSymbolicRegressionSolutionAnalyzer()
     
    148160      #region operator initialization
    149161      subScopesProcessor = new UniformSubScopesProcessor();
    150       SymbolicRegressionSolutionLinearScaler linearScaler = new SymbolicRegressionSolutionLinearScaler();
     162      linearScaler = new SymbolicRegressionSolutionLinearScaler();
    151163      modelQualityAnalyzer = new SymbolicRegressionModelQualityAnalyzer();
    152       SymbolicRegressionMeanSquaredErrorEvaluator validationMseEvaluator = new SymbolicRegressionMeanSquaredErrorEvaluator();
     164      validationMseEvaluator = new SymbolicRegressionMeanSquaredErrorEvaluator();
    153165      bestSolutionAnalyzer = new BestSymbolicRegressionSolutionAnalyzer();
     166      cleaningSubScopesProcessor = new UniformSubScopesProcessor();
     167      removeScaledExpressionTreeAssigner = new Assigner();
    154168      bestKnownQualityMemorizer = new BestQualityMemorizer();
    155169      bestAvgWorstValidationQualityCalculator = new BestAverageWorstQualityCalculator();
    156       DataTableValuesCollector validationValuesCollector = new DataTableValuesCollector();
    157       ResultsCollector resultsCollector = new ResultsCollector();
     170      validationValuesCollector = new DataTableValuesCollector();
     171      resultsCollector = new ResultsCollector();
    158172      #endregion
    159173
     
    197211      bestSolutionAnalyzer.UpperEstimationLimitParameter.ActualName = UpperEstimationLimitParameter.Name;
    198212
     213      cleaningSubScopesProcessor.Depth.Value = SymbolicExpressionTreeParameter.Depth;
     214
     215      removeScaledExpressionTreeAssigner.LeftSideParameter.ActualName = ScaledSymbolicExpressionTreeParameterName;
     216      removeScaledExpressionTreeAssigner.RightSideParameter.Value = new SymbolicExpressionTree();
     217
    199218      bestAvgWorstValidationQualityCalculator.AverageQualityParameter.ActualName = "Current average validation quality";
    200219      bestAvgWorstValidationQualityCalculator.BestQualityParameter.ActualName = CurrentBestValidationQualityParameterName;
     
    226245      subScopesProcessor.Successor = modelQualityAnalyzer;
    227246      modelQualityAnalyzer.Successor = bestSolutionAnalyzer;
    228       bestSolutionAnalyzer.Successor = bestAvgWorstValidationQualityCalculator;
     247      bestSolutionAnalyzer.Successor = cleaningSubScopesProcessor;
     248      cleaningSubScopesProcessor.Operator = removeScaledExpressionTreeAssigner;
     249      cleaningSubScopesProcessor.Successor = bestAvgWorstValidationQualityCalculator;
    229250      bestAvgWorstValidationQualityCalculator.Successor = bestKnownQualityMemorizer;
    230251      bestKnownQualityMemorizer.Successor = validationValuesCollector;
     
    252273    private void SymbolicExpressionTreeParameter_DepthChanged(object sender, EventArgs e) {
    253274      subScopesProcessor.Depth.Value = SymbolicExpressionTreeParameter.Depth;
     275      cleaningSubScopesProcessor.Depth.Value = SymbolicExpressionTreeParameter.Depth;
    254276      bestSolutionAnalyzer.SymbolicExpressionTreeParameter.Depth = SymbolicExpressionTreeParameter.Depth;
    255277      bestSolutionAnalyzer.QualityParameter.Depth = SymbolicExpressionTreeParameter.Depth;
Note: See TracChangeset for help on using the changeset viewer.