Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
02/28/19 12:40:15 (5 years ago)
Author:
gkronber
Message:

#2971: fixed update of interval results when solution changes (e.g. in the simplifier)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/2971_named_intervals/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression/3.4/SymbolicRegressionSolution.cs

    r16589 r16627  
    2929using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
    3030using HeuristicLab.Problems.DataAnalysis.Implementation;
     31using HEAL.Attic;
    3132
    3233namespace HeuristicLab.Problems.DataAnalysis.Symbolic.Regression {
     
    3435  /// Represents a symbolic regression solution (model + data) and attributes of the solution like accuracy and complexity
    3536  /// </summary>
    36   [StorableClass]
     37  [StorableType("CC27F20C-5925-406B-9C38-3C4B2B781C9F")]
    3738  [Item(Name = "SymbolicRegressionSolution", Description = "Represents a symbolic regression solution (model + data) and attributes of the solution like accuracy and complexity.")]
    3839  public sealed class SymbolicRegressionSolution : RegressionSolution, ISymbolicRegressionSolution {
     
    101102    }
    102103
    103     private NamedIntervals IntervalEvaluaitonCollection =>
    104       (NamedIntervals) this[IntervalEvaluationResultName].Value;
     104
     105    public NamedIntervals IntervalEvaluationCollection {
     106      get { return (NamedIntervals)this[IntervalEvaluationResultName].Value; }
     107      private set { this[IntervalEvaluationResultName].Value = value; }
     108    }
    105109
    106110
    107111
    108112    [StorableConstructor]
    109     private SymbolicRegressionSolution(bool deserializing) : base(deserializing) { }
     113    private SymbolicRegressionSolution(StorableConstructorFlag _) : base(_) { }
    110114    private SymbolicRegressionSolution(SymbolicRegressionSolution original, Cloner cloner)
    111115      : base(original, cloner) {
     
    130134      RecalculateResults();
    131135
    132       var namedIntervalCollection = new NamedIntervals();
    133       Add(new Result(IntervalEvaluationResultName, "Results concerning the derivation of symbolic regression solution", namedIntervalCollection));
    134       GetIntervalEvaulations(namedIntervalCollection);
     136      Add(new Result(IntervalEvaluationResultName, "Results concerning the derivation of symbolic regression solution", GetIntervalEvaluations()));
     137      ;
    135138    }
    136139
     
    152155        Add(new Result(EstimationLimitsResultsResultName, "Results concerning the estimation limits of symbolic regression solution", estimationLimitResults));
    153156        CalculateResults();
    154 
    155         var namedIntervalCollection = new NamedIntervals();
    156         Add(new Result(IntervalEvaluationResultName, "Results concerning the derivation of symbolic regression solution", namedIntervalCollection));
    157         GetIntervalEvaulations(namedIntervalCollection);
    158157      }
    159158    }
     
    164163    }
    165164
    166     private void GetIntervalEvaulations(NamedIntervals intervalEvaluation) {
     165    private NamedIntervals GetIntervalEvaluations() {
     166      var intervalEvaluation = new NamedIntervals();
    167167      var interpreter = new IntervalInterpreter();
    168168      var variableRanges = (ProblemData as RegressionProblemData)?.VariableRangesParameter.Value.VariableIntervals;
     
    181181        }
    182182      }
     183      return intervalEvaluation;
    183184    }
    184185   
     
    196197      TrainingNaNEvaluations = Model.Interpreter.GetSymbolicExpressionTreeValues(Model.SymbolicExpressionTree, ProblemData.Dataset, ProblemData.TrainingIndices).Count(double.IsNaN);
    197198      TestNaNEvaluations = Model.Interpreter.GetSymbolicExpressionTreeValues(Model.SymbolicExpressionTree, ProblemData.Dataset, ProblemData.TestIndices).Count(double.IsNaN);
     199
     200      IntervalEvaluationCollection = GetIntervalEvaluations();
    198201    }
    199202  }
Note: See TracChangeset for help on using the changeset viewer.