Free cookie consent management tool by TermsFeed Policy Generator

# Changeset 5060 for branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Problems.DataAnalysis

Ignore:
Timestamp:
12/07/10 14:11:12 (13 years ago)
Message:

Implemented VariableCondition symbol (ticket #1325).

Location:
branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Problems.DataAnalysis/3.3
Files:
5 edited

Unmodified
Removed
• ## branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Problems.DataAnalysis/3.3/HeuristicLab.Problems.DataAnalysis-3.3.csproj

 r5051
• ## branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Problems.DataAnalysis/3.3/Symbolic/FullFunctionalExpressionGrammar.cs

 r5051 var or = new Or(); var not = new Not(); var timeLag = new TimeLag(); timeLag.InitialFrequency = 0.0; var integral = new Integral(); integral.InitialFrequency = 0.0; var derivativ = new Derivative(); derivativ.InitialFrequency = 0.0; var derivative = new Derivative(); derivative.InitialFrequency = 0.0; var variableCondition = new VariableCondition(); variableCondition.InitialFrequency = 0.0; var constant = new Constant(); laggedVariable.InitialFrequency = 0.0; var allSymbols = new List() { add, sub, mul, div, mean, sin, cos, tan, log, exp, @if, gt, lt, and, or, not, timeLag, integral, derivativ, constant, variableSymbol, laggedVariable }; var unaryFunctionSymbols = new List() { sin, cos, tan, log, exp, not, timeLag, integral, derivativ }; var binaryFunctionSymbols = new List() { gt, lt }; var allSymbols = new List() { add, sub, mul, div, mean, sin, cos, tan, log, exp, @if, gt, lt, and, or, not, timeLag, integral, derivative, variableCondition, constant, variableSymbol, laggedVariable }; var unaryFunctionSymbols = new List() { sin, cos, tan, log, exp, not, timeLag, integral, derivative }; var binaryFunctionSymbols = new List() { gt, lt, variableCondition }; var functionSymbols = new List() { add, sub, mul, div, mean, and, or }; var terminalSymbols = new List() { variableSymbol, constant, laggedVariable };
• ## branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Problems.DataAnalysis/3.3/Symbolic/SimpleArithmeticExpressionInterpreter.cs

 r5052 public const byte Integral = 23; public const byte Derivative = 24; public const byte VariableCondition = 25; } { typeof(TimeLag), OpCodes.TimeLag}, { typeof(Integral), OpCodes.Integral}, { typeof(Derivative), OpCodes.Derivative} { typeof(Derivative), OpCodes.Derivative}, { typeof(VariableCondition),OpCodes.VariableCondition} }; private const int ARGUMENT_STACK_SIZE = 1024; var variableTreeNode = instr.dynamicNode as LaggedVariableTreeNode; instr.iArg0 = (ushort)dataset.GetVariableIndex(variableTreeNode.VariableName); } else if (instr.opCode == OpCodes.VariableCondition) { var variableConditionTreeNode = instr.dynamicNode as VariableConditionTreeNode; instr.iArg0 = (ushort)dataset.GetVariableIndex(variableConditionTreeNode.VariableName); } return instr; return (f_0 + 2 * f_1 - 2 * f_3 - f_4) / 8; // h = 1 } //mkommend: this symbol uses the logistic function f(x) = 1 / (1 + e^(-alpha * x) ) //to determine the relative amounts of the true and false branch see http://en.wikipedia.org/wiki/Logistic_function case OpCodes.VariableCondition: { var variableConditionTreeNode = (VariableConditionTreeNode)currentInstr.dynamicNode; double variableValue = dataset[row, currentInstr.iArg0]; double x = variableValue - variableConditionTreeNode.Threshold; double p = 1 / (1 + Math.Exp(-variableConditionTreeNode.Slope * x)); double trueBranch = Evaluate(); double falseBranch = Evaluate(); return trueBranch * p + falseBranch * (1 - p); } default: throw new NotSupportedException(); }
• ## branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Problems.DataAnalysis/3.3/Symbolic/Symbols/Variable.cs

 r4989 #endregion [StorableConstructor] protected Variable(bool deserializing) : base(deserializing) { protected Variable(bool deserializing) : base(deserializing) { variableNames = new List(); }
• ## branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Problems.DataAnalysis/3.3/Symbolic/Symbols/VariableTreeNode.cs

 r4989 public override bool HasLocalParameters { get { return true; } get { return true; } }
Note: See TracChangeset for help on using the changeset viewer.