Changeset 15136


Ignore:
Timestamp:
07/06/17 10:47:26 (3 months ago)
Author:
gkronber
Message:

#2686: merged r14946 and r14951 from trunk to stable

File:
1 edited

Legend:

Unmodified
Added
Removed
  • stable/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression/3.4/SingleObjective/Evaluators/SymbolicRegressionConstantOptimizationEvaluator.cs

    r15131 r15136  
    245245        foreach (var kvp in parameterEntries) {
    246246          var info = kvp.Key;
    247           int lag = info.lag;
    248247          if (ds.VariableHasType<double>(info.variableName)) {
    249             x[row, col] = ds.GetDoubleValue(info.variableName, r + lag);
     248            x[row, col] = ds.GetDoubleValue(info.variableName, r + info.lag);
    250249          } else if (ds.VariableHasType<string>(info.variableName)) {
    251250            x[row, col] = ds.GetStringValue(info.variableName, r) == info.variableValue ? 1 : 0;
     
    269268        alglib.lsfitfit(state, function_cx_1_func, function_cx_1_grad, null, null);
    270269        alglib.lsfitresults(state, out retVal, out c, out rep);
    271       } catch (ArithmeticException) {
     270      }
     271      catch (ArithmeticException) {
    272272        return originalQuality;
    273       } catch (alglib.alglibexception) {
     273      }
     274      catch (alglib.alglibexception) {
    274275        return originalQuality;
    275276      }
     
    291292      foreach (var node in tree.Root.IterateNodesPrefix().OfType<SymbolicExpressionTreeTerminalNode>()) {
    292293        ConstantTreeNode constantTreeNode = node as ConstantTreeNode;
    293         VariableTreeNode variableTreeNode = node as VariableTreeNode;
    294         BinaryFactorVariableTreeNode binFactorVarTreeNode = node as BinaryFactorVariableTreeNode;
     294        VariableTreeNodeBase variableTreeNodeBase = node as VariableTreeNodeBase;
    295295        FactorVariableTreeNode factorVarTreeNode = node as FactorVariableTreeNode;
    296296        if (constantTreeNode != null)
    297297          constantTreeNode.Value = constants[i++];
    298         else if (updateVariableWeights && variableTreeNode != null)
    299           variableTreeNode.Weight = constants[i++];
    300         else if (updateVariableWeights && binFactorVarTreeNode != null)
    301           binFactorVarTreeNode.Weight = constants[i++];
     298        else if (updateVariableWeights && variableTreeNodeBase != null)
     299          variableTreeNodeBase.Weight = constants[i++];
    302300        else if (factorVarTreeNode != null) {
    303301          for (int j = 0; j < factorVarTreeNode.Weights.Length; j++)
Note: See TracChangeset for help on using the changeset viewer.