Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
12/13/21 17:49:34 (3 years ago)
Author:
gkronber
Message:

#3140: made several more changes for the constant -> number branch

Location:
branches/3140_NumberSymbol/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression/3.4
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • branches/3140_NumberSymbol/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression/3.4/Interfaces/IMultiObjectiveConstraintsEvaluator.cs

    r17959 r18115  
    2727  [StorableType("F96C5253-5A78-491C-95AE-78F64BD1F3B1")]
    2828  public interface IMultiObjectiveConstraintsEvaluator : ISymbolicRegressionMultiObjectiveEvaluator {
    29 
    3029    IFixedValueParameter<IntValue> NumConstraintsParameter { get; }
    3130  }
  • branches/3140_NumberSymbol/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression/3.4/MultiObjective/NMSEMultiObjectiveConstraintsEvaluator.cs

    r18113 r18115  
    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
     124            // Set alpha and beta to the scaling nodes from linear scaling grammar
    125125            var offsetParameter = offset.GetSubtree(1) as NumberTreeNode;
    126126            offsetParameter.Value = alpha;
     
    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;
  • branches/3140_NumberSymbol/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression/3.4/SingleObjective/Evaluators/NMSESingleObjectiveConstraintsEvaluator.cs

    r18113 r18115  
    9797    public NMSESingleObjectiveConstraintsEvaluator() {
    9898      Parameters.Add(new FixedValueParameter<BoolValue>(OptimizeParametersParameterName,
    99         "Define whether optimization of numeric parameters is active or not (default: false).", new BoolValue(false)));
     99        "Define whether optimization of parameters is active or not (default: false).", new BoolValue(false)));
    100100      Parameters.Add(new FixedValueParameter<IntValue>(ParameterOptimizationIterationsParameterName,
    101101        "Define how many parameter optimization steps should be performed (default: 10).", new IntValue(10)));
     
    109109
    110110    [StorableHook(HookType.AfterDeserialization)]
    111     private void AfterDeserialization() {
    112       if (!Parameters.ContainsKey(ParameterOptimizationIterationsParameterName)) {
    113         if (Parameters.ContainsKey("ParameterOptimizationIterations")) {
    114           Parameters.Add(new FixedValueParameter<IntValue>(ParameterOptimizationIterationsParameterName, "Define how many parameter optimization steps should be performed (default: 10).", (IntValue)Parameters["ParameterOptimizationIterations"].ActualValue));
    115           Parameters.Remove("ParameterOptimizationIterations");
    116         } else {
    117           Parameters.Add(new FixedValueParameter<IntValue>(ParameterOptimizationIterationsParameterName, "Define how many parameter optimization steps should be performed (default: 10).", new IntValue(10)));
    118         }
    119       }
    120 
    121     }
     111    private void AfterDeserialization() { }
    122112
    123113    public override IDeepCloneable Clone(Cloner cloner) {
  • branches/3140_NumberSymbol/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression/3.4/SymbolicRegressionPruningOperator.cs

    r18114 r18115  
    9191      for (int i = 0; i < nodes.Count; ++i) {
    9292        var node = nodes[i];
    93         if (node is NumberTreeNode) continue;
     93        if (node is INumericTreeNode) continue; // skip constants and numbers
    9494
    9595        impactValuesCalculator.CalculateImpactAndReplacementValues(model, node, problemData, rows,
Note: See TracChangeset for help on using the changeset viewer.