Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
08/31/10 18:25:03 (14 years ago)
Author:
gkronber
Message:

added minimal size parameter for pruning operator. #1142

File:
1 edited

Legend:

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

    r4328 r4350  
    126126    public IValueLookupParameter<BoolValue> ApplyPruningParameter {
    127127      get { return (IValueLookupParameter<BoolValue>)Parameters["ApplyPruning"]; }
     128    }
     129    public IValueLookupParameter<IntValue> MinimalTreeSizeParameter {
     130      get { return (IValueLookupParameter<IntValue>)Parameters["MinimalTreeSize"]; }
    128131    }
    129132    #endregion
     
    214217      Parameters.Add(new LookupParameter<ResultCollection>(ResultsParameterName, "The results collection."));
    215218      Parameters.Add(new ValueLookupParameter<PercentValue>("RelativeNumberOfEvaluatedRows", new PercentValue(1.0)));
     219      Parameters.Add(new ValueLookupParameter<IntValue>("MinimalTreeSize", new IntValue(15)));
    216220    }
    217221
     
    233237      if (!Parameters.ContainsKey("RelativeNumberOfEvaluatedRows")) {
    234238        Parameters.Add(new ValueLookupParameter<PercentValue>("RelativeNumberOfEvaluatedRows", new PercentValue(1.0)));
     239      }
     240      if (!Parameters.ContainsKey("MinimalTreeSize")) {
     241        Parameters.Add(new ValueLookupParameter<IntValue>("MinimalTreeSize", new IntValue(15)));
    235242      }
    236243
     
    261268            SymbolicExpressionTreeInterpreter, Evaluator, Maximization.Value,
    262269            LowerEstimationLimit.Value, UpperEstimationLimit.Value,
    263             MaxPruningRatio.Value, QualityGainWeight.Value);
     270            MinimalTreeSizeParameter.ActualValue.Value, MaxPruningRatio.Value, QualityGainWeight.Value);
    264271        }
    265272      }
     
    271278      ISymbolicExpressionTreeInterpreter interpreter, ISymbolicRegressionEvaluator evaluator, bool maximization,
    272279      double lowerEstimationLimit, double upperEstimationLimit,
    273       double maxPruningRatio, double qualityGainWeight) {
    274 
     280      int minTreeSize, double maxPruningRatio, double qualityGainWeight) {
     281
     282     
    275283      int originalSize = tree.Size;
    276 
    277284      // min size of the resulting pruned tree
    278285      int minPrunedSize = (int)(originalSize * (1 - maxPruningRatio));
     286      minPrunedSize = Math.Max(minPrunedSize, minTreeSize);
    279287
    280288      // use the same subset of rows for all iterations and for all pruning tournaments
Note: See TracChangeset for help on using the changeset viewer.