Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
01/28/14 19:18:25 (11 years ago)
Author:
bburlacu
Message:

#2143: Modified the pruning operator and analyzer to use the FitnessCalculationPartition for impact and replacement values calculation, instead of the whole training data partition.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Analyzers/SymbolicDataAnalysisSingleObjectivePruningAnalyzer.cs

    r10378 r10414  
    3232    private const string NodeImpactThresholdParameterName = "ImpactThreshold";
    3333
     34    private const string FitnessCalculationPartitionParameterName = "FitnessCalculationPartition";
     35
    3436    private bool reentry;
    3537    [Storable]
     
    5254      get { return (ILookupParameter<IDataAnalysisProblemData>)Parameters[ProblemDataParameterName]; }
    5355    }
     56    public ILookupParameter<IntRange> FitnessCalculationPartitionParameter {
     57      get { return (ILookupParameter<IntRange>)Parameters[FitnessCalculationPartitionParameterName]; }
     58    }
    5459    private ILookupParameter<ISymbolicDataAnalysisExpressionTreeInterpreter> InterpreterParameter {
    5560      get { return (ILookupParameter<ISymbolicDataAnalysisExpressionTreeInterpreter>)Parameters[InterpreterParameterName]; }
     
    7681    #region properties
    7782    protected IDataAnalysisProblemData ProblemData { get { return ProblemDataParameter.ActualValue; } }
     83    protected IntRange FitnessCalculationPartition { get { return FitnessCalculationPartitionParameter.ActualValue; } }
    7884    protected ISymbolicDataAnalysisExpressionTreeInterpreter Interpreter { get { return InterpreterParameter.ActualValue; } }
    7985    protected IntValue UpdateInterval { get { return UpdateIntervalParameter.Value; } }
     
    8995    #endregion
    9096
     97    #region IStatefulItem members
     98    public override void InitializeState() {
     99      base.InitializeState();
     100      UpdateCounter.Value = 0;
     101    }
     102    public override void ClearState() {
     103      base.ClearState();
     104      UpdateCounter.Value = 0;
     105    }
     106    #endregion
     107
    91108    [StorableConstructor]
    92109    protected SymbolicDataAnalysisSingleObjectivePruningAnalyzer(bool deserializing) : base(deserializing) { }
     110    [StorableHook(HookType.AfterDeserialization)]
     111    private void AfterDeserialization() {
     112      if (!Parameters.ContainsKey(FitnessCalculationPartitionParameterName))
     113        Parameters.Add(new LookupParameter<IntRange>(FitnessCalculationPartitionParameterName, ""));
     114    }
    93115    protected SymbolicDataAnalysisSingleObjectivePruningAnalyzer(SymbolicDataAnalysisSingleObjectivePruningAnalyzer original, Cloner cloner)
    94116      : base(original, cloner) {
     
    110132      Parameters.Add(new FixedValueParameter<DoubleValue>(NodeImpactThresholdParameterName, new DoubleValue(0.0)));
    111133      Parameters.Add(new FixedValueParameter<BoolValue>(PruneOnlyZeroImpactNodesParameterName, new BoolValue(false)));
     134      Parameters.Add(new LookupParameter<IntRange>(FitnessCalculationPartitionParameterName, ""));
    112135    }
    113136
     
    147170            Random = Random,
    148171            PruneOnlyZeroImpactNodes = PruneOnlyZeroImpactNodes.Value,
    149             NodeImpactThreshold = NodeImpactThreshold.Value
     172            NodeImpactThreshold = NodeImpactThreshold.Value,
     173            FitnessCalculationPartition = FitnessCalculationPartition
    150174          };
    151175          operations.Add(ExecutionContext.CreateChildOperation(op, ExecutionContext.Scope));
Note: See TracChangeset for help on using the changeset viewer.