Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
12/15/21 11:50:57 (2 years ago)
Author:
gkronber
Message:

#3140: merged r18091:18131 from branch to trunk

Location:
trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk

  • trunk/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression

  • trunk/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression/3.4

  • trunk/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression/3.4/MultiObjective/NMSEMultiObjectiveConstraintsEvaluator.cs

    r17958 r18132  
    9090      var applyLinearScaling = ApplyLinearScalingParameter.ActualValue.Value;
    9191
    92       if (UseConstantOptimization) {
    93         SymbolicRegressionConstantOptimizationEvaluator.OptimizeConstants(interpreter, tree, problemData, rows,
     92      if (UseParameterOptimization) {
     93        SymbolicRegressionParameterOptimizationEvaluator.OptimizeParameters(interpreter, tree, problemData, rows,
    9494          false,
    95           ConstantOptimizationIterations,
    96           ConstantOptimizationUpdateVariableWeights,
     95          ParameterOptimizationIterations,
     96          ParameterOptimizationUpdateVariableWeights,
    9797          estimationLimits.Lower,
    9898          estimationLimits.Upper);
     
    105105          var scaling = offset.GetSubtree(0);
    106106
    107           //Check if tree contains offset and scaling nodes
     107          // Check if tree contains offset and scaling nodes
    108108          if (!(offset.Symbol is Addition) || !(scaling.Symbol is Multiplication))
    109109            throw new ArgumentException($"{ItemName} can only be used with LinearScalingGrammar.");
     
    115115          var newTree = new SymbolicExpressionTree(rootNode);
    116116
    117           //calculate alpha and beta for scaling
     117          // calculate alpha and beta for scaling
    118118          var estimatedValues = interpreter.GetSymbolicExpressionTreeValues(newTree, problemData.Dataset, rows);
    119119
     
    122122            out var errorState);
    123123          if (errorState == OnlineCalculatorError.None) {
    124             //Set alpha and beta to the scaling nodes from ia grammar
    125             var offsetParameter = offset.GetSubtree(1) as ConstantTreeNode;
     124            // Set alpha and beta to the scaling nodes from linear scaling grammar
     125            var offsetParameter = offset.GetSubtree(1) as NumberTreeNode;
    126126            offsetParameter.Value = alpha;
    127             var scalingParameter = scaling.GetSubtree(1) as ConstantTreeNode;
     127            var scalingParameter = scaling.GetSubtree(1) as NumberTreeNode;
    128128            scalingParameter.Value = beta;
    129129          }
     
    162162      double upperEstimationLimit,
    163163      IRegressionProblemData problemData, IEnumerable<int> rows, IBoundsEstimator estimator, int decimalPlaces) {
    164       OnlineCalculatorError errorState;
    165164      var estimatedValues = interpreter.GetSymbolicExpressionTreeValues(solution, problemData.Dataset, rows);
    166165      var targetValues = problemData.Dataset.GetDoubleValues(problemData.TargetVariable, rows);
     
    174173
    175174      var boundedEstimatedValues = estimatedValues.LimitToRange(lowerEstimationLimit, upperEstimationLimit);
    176       nmse = OnlineNormalizedMeanSquaredErrorCalculator.Calculate(targetValues, boundedEstimatedValues, out errorState);
     175      nmse = OnlineNormalizedMeanSquaredErrorCalculator.Calculate(targetValues, boundedEstimatedValues, out OnlineCalculatorError errorState);
    177176
    178177      if (errorState != OnlineCalculatorError.None) nmse = 1.0;
Note: See TracChangeset for help on using the changeset viewer.