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