Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
07/04/08 17:30:24 (16 years ago)
Author:
gkronber
Message:
  • implemented operator to store the best of run solution, in regard of a specific fitness variable).
  • adapted struct-id infrastructure to allow evaluation of models on validation data.

ticket #194

Location:
trunk/sources/HeuristicLab.StructureIdentification/Evaluation
Files:
1 added
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.StructureIdentification/Evaluation/CoefficientOfDeterminationEvaluator.cs

    r155 r363  
    4747      double originalDeviationTotalSumOfSquares = 0.0;
    4848      double targetMean = dataset.GetMean(targetVariable);
     49      functionTree.PrepareEvaluation(dataset);
    4950      for(int sample = 0; sample < dataset.Rows; sample++) {
    50         double estimated = functionTree.Evaluate(dataset, sample);
     51        double estimated = functionTree.Evaluate(sample);
    5152        double original = dataset.GetValue(sample, targetVariable);
    5253        if(!double.IsNaN(original) && !double.IsInfinity(original)) {
  • trunk/sources/HeuristicLab.StructureIdentification/Evaluation/EarlyStoppingMeanSquaredErrorEvaluator.cs

    r334 r363  
    6060      double errorsSquaredSum = 0;
    6161      double targetMean = dataset.GetMean(targetVariable);
     62      functionTree.PrepareEvaluation(dataset);
    6263      for(int sample = trainingStart; sample < trainingEnd; sample++) {
    63         double estimated = functionTree.Evaluate(dataset, sample);
     64        double estimated = functionTree.Evaluate(sample);
    6465        double original = dataset.GetValue(sample, targetVariable);
    6566        if(double.IsNaN(estimated) || double.IsInfinity(estimated)) {
  • trunk/sources/HeuristicLab.StructureIdentification/Evaluation/GPEvaluatorBase.cs

    r334 r363  
    5757      this.totalEvaluatedNodes = scope.GetVariableValue<DoubleData>("TotalEvaluatedNodes", true).Data;
    5858      double result = Evaluate(scope, functionTree, targetVariable, dataset);
    59       scope.AddVariable(new HeuristicLab.Core.Variable(scope.TranslateName("Quality"), new DoubleData(result)));
     59
     60      DoubleData quality = GetVariableValue<DoubleData>("Quality", scope, false, false);
     61      if(quality == null) {
     62        scope.AddVariable(new HeuristicLab.Core.Variable(scope.TranslateName("Quality"), new DoubleData(result)));
     63      } else {
     64        quality.Data = result;
     65      }
     66
    6067      return null;
    6168    }
  • trunk/sources/HeuristicLab.StructureIdentification/Evaluation/MCCEvaluator.cs

    r191 r363  
    5454      double negative = 0;
    5555      double targetMean = dataset.GetMean(targetVariable);
     56      functionTree.PrepareEvaluation(dataset);
    5657      for(int sample = 0; sample < dataset.Rows; sample++) {
    57         double est = functionTree.Evaluate(dataset, sample);
     58        double est = functionTree.Evaluate(sample);
    5859        double orig = dataset.GetValue(sample, targetVariable);
    5960        if(double.IsNaN(est) || double.IsInfinity(est)) {
  • trunk/sources/HeuristicLab.StructureIdentification/Evaluation/MeanSquaredErrorEvaluator.cs

    r334 r363  
    6060      }
    6161
     62      functionTree.PrepareEvaluation(dataset);
    6263      for(int sample = trainingStart; sample < trainingEnd; sample++) {
    63         double estimated = functionTree.Evaluate(dataset, sample);
     64        double estimated = functionTree.Evaluate(sample);
    6465        double original = dataset.GetValue(sample, targetVariable);
    6566        if(double.IsNaN(estimated) || double.IsInfinity(estimated)) {
  • trunk/sources/HeuristicLab.StructureIdentification/Evaluation/VarianceAccountedForEvaluator.cs

    r155 r363  
    5757      double[] originalTargetVariableValues = new double[dataset.Rows];
    5858      double targetMean = dataset.GetMean(targetVariable);
     59      functionTree.PrepareEvaluation(dataset);
    5960      for(int sample = 0; sample < dataset.Rows; sample++) {
    60         double estimated = functionTree.Evaluate(dataset, sample);
     61        double estimated = functionTree.Evaluate(sample);
    6162        double original = dataset.GetValue(sample, targetVariable);
    6263        if(!double.IsNaN(original) && !double.IsInfinity(original)) {
Note: See TracChangeset for help on using the changeset viewer.