Changeset 8727


Ignore:
Timestamp:
10/04/12 11:25:12 (7 years ago)
Author:
mkommend
Message:

#1965: Used EstimationLimits to avoid NaN evaluations in simplifiers.

Location:
trunk/sources
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Problems.DataAnalysis.Symbolic.Classification.Views/3.4/InteractiveSymbolicClassificationSolutionSimplifierViewBase.cs

    r8637 r8727  
    118118      var interpreter = Content.Model.Interpreter;
    119119      var rows = Content.ProblemData.TrainingIndices;
    120       return interpreter.GetSymbolicExpressionTreeValues(tempTree, Content.ProblemData.Dataset, rows).Median();
     120      return interpreter.GetSymbolicExpressionTreeValues(tempTree, Content.ProblemData.Dataset, rows)
     121             .LimitToRange(Content.Model.LowerEstimationLimit, Content.Model.UpperEstimationLimit).Median();
    121122    }
    122123
  • trunk/sources/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression.Views/3.4/InteractiveSymbolicRegressionSolutionSimplifierView.cs

    r8704 r8727  
    7070      Dictionary<ISymbolicExpressionTreeNode, double> impactValues = new Dictionary<ISymbolicExpressionTreeNode, double>();
    7171      List<ISymbolicExpressionTreeNode> nodes = tree.Root.GetSubtree(0).GetSubtree(0).IterateNodesPostfix().ToList();
    72       var originalOutput = interpreter.GetSymbolicExpressionTreeValues(tree, dataset, rows)
    73         .ToArray();
     72      var originalOutput = interpreter.GetSymbolicExpressionTreeValues(tree, dataset, rows).LimitToRange(Content.Model.LowerEstimationLimit, Content.Model.UpperEstimationLimit).ToArray();
    7473      var targetValues = dataset.GetDoubleValues(targetVariable, rows);
    7574      OnlineCalculatorError errorState;
     
    8281        ISymbolicExpressionTreeNode replacementNode = constantNode;
    8382        SwitchNode(parent, node, replacementNode);
    84         var newOutput = interpreter.GetSymbolicExpressionTreeValues(tree, dataset, rows);
     83        var newOutput = interpreter.GetSymbolicExpressionTreeValues(tree, dataset, rows).LimitToRange(Content.Model.LowerEstimationLimit, Content.Model.UpperEstimationLimit);
    8584        double newR2 = OnlinePearsonsRSquaredCalculator.Calculate(targetValues, newOutput, out errorState);
    8685        if (errorState != OnlineCalculatorError.None) newR2 = 0.0;
     
    107106      var interpreter = Content.Model.Interpreter;
    108107      var rows = Content.ProblemData.TrainingIndices;
    109       return interpreter.GetSymbolicExpressionTreeValues(tempTree, Content.ProblemData.Dataset, rows).Median();
     108      return interpreter.GetSymbolicExpressionTreeValues(tempTree, Content.ProblemData.Dataset, rows)
     109                         .LimitToRange(Content.Model.LowerEstimationLimit, Content.Model.UpperEstimationLimit)
     110                         .Median();
    110111    }
    111112
Note: See TracChangeset for help on using the changeset viewer.