Changeset 15136 for stable/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression/3.4/SingleObjective/Evaluators
- Timestamp:
- 07/06/17 10:47:26 (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
stable/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression/3.4/SingleObjective/Evaluators/SymbolicRegressionConstantOptimizationEvaluator.cs
r15131 r15136 245 245 foreach (var kvp in parameterEntries) { 246 246 var info = kvp.Key; 247 int lag = info.lag;248 247 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); 250 249 } else if (ds.VariableHasType<string>(info.variableName)) { 251 250 x[row, col] = ds.GetStringValue(info.variableName, r) == info.variableValue ? 1 : 0; … … 269 268 alglib.lsfitfit(state, function_cx_1_func, function_cx_1_grad, null, null); 270 269 alglib.lsfitresults(state, out retVal, out c, out rep); 271 } catch (ArithmeticException) { 270 } 271 catch (ArithmeticException) { 272 272 return originalQuality; 273 } catch (alglib.alglibexception) { 273 } 274 catch (alglib.alglibexception) { 274 275 return originalQuality; 275 276 } … … 291 292 foreach (var node in tree.Root.IterateNodesPrefix().OfType<SymbolicExpressionTreeTerminalNode>()) { 292 293 ConstantTreeNode constantTreeNode = node as ConstantTreeNode; 293 VariableTreeNode variableTreeNode = node as VariableTreeNode; 294 BinaryFactorVariableTreeNode binFactorVarTreeNode = node as BinaryFactorVariableTreeNode; 294 VariableTreeNodeBase variableTreeNodeBase = node as VariableTreeNodeBase; 295 295 FactorVariableTreeNode factorVarTreeNode = node as FactorVariableTreeNode; 296 296 if (constantTreeNode != null) 297 297 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++]; 302 300 else if (factorVarTreeNode != null) { 303 301 for (int j = 0; j < factorVarTreeNode.Weights.Length; j++)
Note: See TracChangeset
for help on using the changeset viewer.