- Timestamp:
- 03/30/11 18:15:29 (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/SymbolicDataAnalysisExpressionTreeInterpreter.cs
r5894 r5897 208 208 var variableTreeNode = instr.dynamicNode as VariableTreeNode; 209 209 instr.iArg0 = (ushort)dataset.GetVariableIndex(variableTreeNode.VariableName); 210 instr.dArg0 = variableTreeNode.Weight;210 code[i] = instr; 211 211 } else if (instr.opCode == OpCodes.LagVariable) { 212 212 var variableTreeNode = instr.dynamicNode as LaggedVariableTreeNode; 213 213 instr.iArg0 = (ushort)dataset.GetVariableIndex(variableTreeNode.VariableName); 214 instr.dArg0 = variableTreeNode.Weight;214 code[i] = instr; 215 215 } else if (instr.opCode == OpCodes.VariableCondition) { 216 216 var variableConditionTreeNode = instr.dynamicNode as VariableConditionTreeNode; 217 217 instr.iArg0 = (ushort)dataset.GetVariableIndex(variableConditionTreeNode.VariableName); 218 instr.dArg0 = variableConditionTreeNode.Threshold;219 } else if (instr.opCode == OpCodes.Constant) {220 var constTreeNode = instr.dynamicNode as ConstantTreeNode;221 instr.dArg0 = constTreeNode.Value;222 218 } 223 219 } … … 412 408 } 413 409 case OpCodes.Variable: { 414 return dataset[row, currentInstr.iArg0] * currentInstr.dArg0; 410 var variableTreeNode = currentInstr.dynamicNode as VariableTreeNode; 411 return dataset[row, currentInstr.iArg0] * variableTreeNode.Weight; 415 412 } 416 413 case OpCodes.LagVariable: { … … 418 415 int actualRow = row + laggedVariableTreeNode.Lag; 419 416 if (actualRow < 0 || actualRow >= dataset.Rows) throw new ArgumentException("Out of range access to dataset row: " + row); 420 return dataset[actualRow, currentInstr.iArg0] * currentInstr.dArg0;417 return dataset[actualRow, currentInstr.iArg0] * laggedVariableTreeNode.Weight; 421 418 } 422 419 case OpCodes.Constant: { 423 return currentInstr.dArg0; 420 var constTreeNode = currentInstr.dynamicNode as ConstantTreeNode; 421 return constTreeNode.Value; 424 422 } 425 423 … … 429 427 var variableConditionTreeNode = (VariableConditionTreeNode)currentInstr.dynamicNode; 430 428 double variableValue = dataset[row, currentInstr.iArg0]; 431 double x = variableValue - currentInstr.dArg0;429 double x = variableValue - variableConditionTreeNode.Threshold; 432 430 double p = 1 / (1 + Math.Exp(-variableConditionTreeNode.Slope * x)); 433 431
Note: See TracChangeset
for help on using the changeset viewer.