Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
06/08/10 17:47:15 (15 years ago)
Author:
gkronber
Message:

Implemented calculation of variable impacts as integral over relative variable frequencies. #1036

File:
1 edited

Legend:

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

    r3892 r3905  
    4444    private const string LowerEstimationLimitParameterName = "LowerEstimationLimit";
    4545    private const string BestSolutionQualityParameterName = "BestSolutionQuality";
     46    private const string GenerationsParameterName = "Generations";
    4647    private const string ResultsParameterName = "Results";
    4748    private const string BestSolutionResultName = "Best solution (on validiation set)";
     
    5253    private const string BestSolutionTrainingRelativeError = "Best solution average relative error (training)";
    5354    private const string BestSolutionTestRelativeError = "Best solution average relative error (test)";
     55    private const string BestSolutionGeneration = "Best solution generation";
    5456
    5557    #region parameter properties
     
    7173    public ILookupParameter<ResultCollection> ResultsParameter {
    7274      get { return (ILookupParameter<ResultCollection>)Parameters[ResultsParameterName]; }
     75    }
     76    public ILookupParameter<IntValue> GenerationsParameter {
     77      get {
     78        return (ILookupParameter<IntValue>)Parameters[GenerationsParameterName];
     79      }
    7380    }
    7481    #endregion
     
    98105      Parameters.Add(new ScopeTreeLookupParameter<DoubleValue>(QualityParameterName, "The qualities of the symbolic regression trees which should be analyzed."));
    99106      Parameters.Add(new LookupParameter<DoubleValue>(BestSolutionQualityParameterName, "The quality of the best regression solution."));
     107      Parameters.Add(new LookupParameter<IntValue>(GenerationsParameterName, "The number of generations calculated so far."));
    100108      Parameters.Add(new LookupParameter<ResultCollection>(ResultsParameterName, "The result collection where the best symbolic regression solution should be stored."));
     109    }
     110
     111    [StorableHook(HookType.AfterDeserialization)]
     112    public void Initialize() {
     113      // backwards compatibility
     114      if (!Parameters.ContainsKey(GenerationsParameterName)) {
     115        Parameters.Add(new LookupParameter<IntValue>(GenerationsParameterName, "The number of generations calculated so far."));
     116      }
    101117    }
    102118
     
    135151        Results[BestSolutionTrainingRelativeError].Value = new DoubleValue(trainingRelError);
    136152        Results[BestSolutionTestRelativeError].Value = new DoubleValue(testRelError);
     153        Results[BestSolutionGeneration].Value = new IntValue(GenerationsParameter.ActualValue.Value);
    137154      } else {
    138155        Results.Add(new Result(BestSolutionResultName, solution));
     
    143160        Results.Add(new Result(BestSolutionTrainingRelativeError, new DoubleValue(trainingRelError)));
    144161        Results.Add(new Result(BestSolutionTestRelativeError, new DoubleValue(testRelError)));
     162        Results.Add(new Result(BestSolutionGeneration, new IntValue(GenerationsParameter.ActualValue.Value)));
    145163      }
    146164      #endregion
Note: See TracChangeset for help on using the changeset viewer.