Free cookie consent management tool by TermsFeed Policy Generator

Changeset 14946


Ignore:
Timestamp:
05/09/17 18:23:29 (8 years ago)
Author:
mkommend
Message:

#2686: Fixed updating of constants / variable weights if lagged variables are used within constants optimization.

File:
1 edited

Legend:

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

    r14843 r14946  
    196196          int lag = info.lag;
    197197          if (ds.VariableHasType<double>(info.variableName)) {
    198             x[row, col] = ds.GetDoubleValue(info.variableName, r + lag);
     198            x[row, col] = ds.GetDoubleValue(info.variableName, r + info.lag);
    199199          } else if (ds.VariableHasType<string>(info.variableName)) {
    200200            x[row, col] = ds.GetStringValue(info.variableName, r) == info.variableValue ? 1 : 0;
     
    218218        alglib.lsfitfit(state, function_cx_1_func, function_cx_1_grad, null, null);
    219219        alglib.lsfitresults(state, out retVal, out c, out rep);
    220       } catch (ArithmeticException) {
     220      }
     221      catch (ArithmeticException) {
    221222        return originalQuality;
    222       } catch (alglib.alglibexception) {
     223      }
     224      catch (alglib.alglibexception) {
    223225        return originalQuality;
    224226      }
     
    241243        ConstantTreeNode constantTreeNode = node as ConstantTreeNode;
    242244        VariableTreeNode variableTreeNode = node as VariableTreeNode;
     245        LaggedVariableTreeNode laggedVarTreeNode = node as LaggedVariableTreeNode;
    243246        BinaryFactorVariableTreeNode binFactorVarTreeNode = node as BinaryFactorVariableTreeNode;
    244247        FactorVariableTreeNode factorVarTreeNode = node as FactorVariableTreeNode;
     
    247250        else if (updateVariableWeights && variableTreeNode != null)
    248251          variableTreeNode.Weight = constants[i++];
     252        else if (updateVariableWeights && laggedVarTreeNode != null)
     253          laggedVarTreeNode.Weight = constants[i++];
    249254        else if (updateVariableWeights && binFactorVarTreeNode != null)
    250255          binFactorVarTreeNode.Weight = constants[i++];
Note: See TracChangeset for help on using the changeset viewer.