Changeset 5026 for branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Problems.DataAnalysis/3.3
- Timestamp:
- 12/06/10 10:28:34 (14 years ago)
- Location:
- branches/GP.Symbols (TimeLag, Diff, Integral)
- Files:
-
- 3 added
- 5 edited
- 2 copied
Legend:
- Unmodified
- Added
- Removed
-
branches/GP.Symbols (TimeLag, Diff, Integral)
-
Property
svn:ignore
set to
GP.Symbols.suo
-
Property
svn:ignore
set to
-
branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Problems.DataAnalysis/3.3/HeuristicLab.Problems.DataAnalysis-3.3.csproj
r5013 r5026 91 91 </PropertyGroup> 92 92 <ItemGroup> 93 <Reference Include="ALGLIB-3.1.0, Version=3.1.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=x86"> 94 <HintPath>c:\Program Files\HeuristicLab 3.3\ALGLIB-3.1.0.dll</HintPath> 95 </Reference> 96 <Reference Include="HeuristicLab.ALGLIB-3.1.0, Version=2.5.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=x86"> 97 <HintPath>c:\Program Files\HeuristicLab 3.3\HeuristicLab.ALGLIB-3.1.0.dll</HintPath> 98 </Reference> 99 <Reference Include="HeuristicLab.Collections-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=x86"> 100 <HintPath>c:\Program Files\HeuristicLab 3.3\HeuristicLab.Collections-3.3.dll</HintPath> 101 </Reference> 102 <Reference Include="HeuristicLab.Common-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=x86"> 103 <HintPath>c:\Program Files\HeuristicLab 3.3\HeuristicLab.Common-3.3.dll</HintPath> 104 </Reference> 105 <Reference Include="HeuristicLab.Common.Resources-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=x86"> 106 <HintPath>c:\Program Files\HeuristicLab 3.3\HeuristicLab.Common.Resources-3.3.dll</HintPath> 107 </Reference> 108 <Reference Include="HeuristicLab.Core-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=x86"> 109 <HintPath>c:\Program Files\HeuristicLab 3.3\HeuristicLab.Core-3.3.dll</HintPath> 110 </Reference> 111 <Reference Include="HeuristicLab.Data-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=x86"> 112 <HintPath>c:\Program Files\HeuristicLab 3.3\HeuristicLab.Data-3.3.dll</HintPath> 113 </Reference> 114 <Reference Include="HeuristicLab.Encodings.RealVectorEncoding-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=x86"> 115 <HintPath>c:\Program Files\HeuristicLab 3.3\HeuristicLab.Encodings.RealVectorEncoding-3.3.dll</HintPath> 116 </Reference> 117 <Reference Include="HeuristicLab.LibSVM-1.6.3, Version=1.6.3.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=x86"> 118 <HintPath>c:\Program Files\HeuristicLab 3.3\HeuristicLab.LibSVM-1.6.3.dll</HintPath> 119 </Reference> 120 <Reference Include="HeuristicLab.Operators-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=x86"> 121 <HintPath>c:\Program Files\HeuristicLab 3.3\HeuristicLab.Operators-3.3.dll</HintPath> 122 </Reference> 123 <Reference Include="HeuristicLab.Optimization-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=x86"> 124 <HintPath>c:\Program Files\HeuristicLab 3.3\HeuristicLab.Optimization-3.3.dll</HintPath> 125 </Reference> 126 <Reference Include="HeuristicLab.Parameters-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=x86"> 127 <HintPath>c:\Program Files\HeuristicLab 3.3\HeuristicLab.Parameters-3.3.dll</HintPath> 128 </Reference> 129 <Reference Include="HeuristicLab.Persistence-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=x86"> 130 <HintPath>c:\Program Files\HeuristicLab 3.3\HeuristicLab.Persistence-3.3.dll</HintPath> 131 </Reference> 132 <Reference Include="HeuristicLab.PluginInfrastructure-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=x86"> 133 <HintPath>c:\Program Files\HeuristicLab 3.3\HeuristicLab.PluginInfrastructure-3.3.dll</HintPath> 134 </Reference> 135 <Reference Include="HeuristicLab.Random-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=x86"> 136 <HintPath>c:\Program Files\HeuristicLab 3.3\HeuristicLab.Random-3.3.dll</HintPath> 137 </Reference> 138 <Reference Include="LibSVM-1.6.3, Version=1.6.3.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=x86"> 139 <HintPath>..\..\..\..\..\..\Program Files\HeuristicLab 3.3\LibSVM-1.6.3.dll</HintPath> 140 </Reference> 93 141 <Reference Include="System" /> 94 142 <Reference Include="System.Core"> … … 129 177 <Compile Include="Evaluators\SimpleVarianceAccountedForEvaluator.cs" /> 130 178 <Compile Include="HeuristicLabProblemsDataAnalysisPlugin.cs" /> 179 <Compile Include="Interfaces\ILaggedTreeNode.cs" /> 131 180 <Compile Include="Interfaces\ISingleObjectiveDataAnalysisProblem.cs" /> 132 181 <Compile Include="Interfaces\IDataAnalysisModel.cs" /> … … 147 196 <Compile Include="Symbolic\SymbolicSimplifier.cs" /> 148 197 <Compile Include="Symbolic\Symbols\Addition.cs" /> 198 <Compile Include="Symbolic\Symbols\LaggedSymbol.cs" /> 149 199 <Compile Include="Symbolic\Symbols\Constant.cs" /> 150 200 <Compile Include="Symbolic\Symbols\ConstantTreeNode.cs" /> 201 <Compile Include="Symbolic\Symbols\LaggedTreeNode.cs" /> 151 202 <Compile Include="Symbolic\Symbols\LaggedVariable.cs" /> 152 203 <Compile Include="Symbolic\Symbols\LaggedVariableTreeNode.cs" /> … … 166 217 <Compile Include="Symbolic\Symbols\Multiplication.cs" /> 167 218 <Compile Include="Symbolic\Symbols\Subtraction.cs" /> 219 <Compile Include="Symbolic\Symbols\TimeLag.cs" /> 168 220 <Compile Include="Symbolic\Symbols\Variable.cs" /> 169 221 <Compile Include="Symbolic\Symbols\VariableTreeNode.cs" /> … … 171 223 </ItemGroup> 172 224 <ItemGroup> 173 <ProjectReference Include="..\..\HeuristicLab.Collections\3.3\HeuristicLab.Collections-3.3.csproj">174 <Project>{958B43BC-CC5C-4FA2-8628-2B3B01D890B6}</Project>175 <Name>HeuristicLab.Collections-3.3</Name>176 </ProjectReference>177 <ProjectReference Include="..\..\HeuristicLab.Common.Resources\3.3\HeuristicLab.Common.Resources-3.3.csproj">178 <Project>{0E27A536-1C4A-4624-A65E-DC4F4F23E3E1}</Project>179 <Name>HeuristicLab.Common.Resources-3.3</Name>180 </ProjectReference>181 <ProjectReference Include="..\..\HeuristicLab.Common\3.3\HeuristicLab.Common-3.3.csproj">182 <Project>{A9AD58B9-3EF9-4CC1-97E5-8D909039FF5C}</Project>183 <Name>HeuristicLab.Common-3.3</Name>184 </ProjectReference>185 <ProjectReference Include="..\..\HeuristicLab.Core\3.3\HeuristicLab.Core-3.3.csproj">186 <Project>{C36BD924-A541-4A00-AFA8-41701378DDC5}</Project>187 <Name>HeuristicLab.Core-3.3</Name>188 </ProjectReference>189 <ProjectReference Include="..\..\HeuristicLab.Data\3.3\HeuristicLab.Data-3.3.csproj">190 <Project>{BBAB9DF5-5EF3-4BA8-ADE9-B36E82114937}</Project>191 <Name>HeuristicLab.Data-3.3</Name>192 </ProjectReference>193 <ProjectReference Include="..\..\HeuristicLab.Encodings.RealVectorEncoding\3.3\HeuristicLab.Encodings.RealVectorEncoding-3.3.csproj">194 <Project>{BB6D334A-4BB6-4674-9883-31A6EBB32CAB}</Project>195 <Name>HeuristicLab.Encodings.RealVectorEncoding-3.3</Name>196 </ProjectReference>197 225 <ProjectReference Include="..\..\HeuristicLab.Encodings.SymbolicExpressionTreeEncoding\3.3\HeuristicLab.Encodings.SymbolicExpressionTreeEncoding-3.3.csproj"> 198 226 <Project>{125D3006-67F5-48CB-913E-73C0548F17FA}</Project> 199 227 <Name>HeuristicLab.Encodings.SymbolicExpressionTreeEncoding-3.3</Name> 200 </ProjectReference>201 <ProjectReference Include="..\..\HeuristicLab.ExtLibs\HeuristicLab.ALGLIB\3.1.0\ALGLIB-3.1.0\ALGLIB-3.1.0.csproj">202 <Project>{FC841674-62A7-4055-BE91-E41944B6C606}</Project>203 <Name>ALGLIB-3.1.0</Name>204 </ProjectReference>205 <ProjectReference Include="..\..\HeuristicLab.ExtLibs\HeuristicLab.ALGLIB\3.1.0\HeuristicLab.ALGLIB-3.1.0\HeuristicLab.ALGLIB-3.1.0.csproj">206 <Project>{DE69A359-A5B8-4D3D-BA8D-D5780D7F96D6}</Project>207 <Name>HeuristicLab.ALGLIB-3.1.0 %28HeuristicLab.ExtLibs\HeuristicLab.ALGLIB\HeuristicLab.ALGLIB-3.1.0\HeuristicLab.ALGLIB-3.1.0%29</Name>208 </ProjectReference>209 <ProjectReference Include="..\..\HeuristicLab.ExtLibs\HeuristicLab.LibSVM\1.6.3\HeuristicLab.LibSVM-1.6.3\HeuristicLab.LibSVM-1.6.3.csproj">210 <Project>{89B50302-9CEE-4D13-9779-633EADCAE624}</Project>211 <Name>HeuristicLab.LibSVM-1.6.3 %28HeuristicLab.ExtLibs\HeuristicLab.LibSVM\HeuristicLab.LibSVM-1.6.3\HeuristicLab.LibSVM-1.6.3%29</Name>212 </ProjectReference>213 <ProjectReference Include="..\..\HeuristicLab.ExtLibs\HeuristicLab.LibSVM\1.6.3\LibSVM-1.6.3\LibSVM-1.6.3.csproj">214 <Project>{A16F23B5-FB62-499E-A831-26953AA56FE2}</Project>215 <Name>LibSVM-1.6.3</Name>216 </ProjectReference>217 <ProjectReference Include="..\..\HeuristicLab.Operators\3.3\HeuristicLab.Operators-3.3.csproj">218 <Project>{23DA7FF4-D5B8-41B6-AA96-F0561D24F3EE}</Project>219 <Name>HeuristicLab.Operators-3.3</Name>220 </ProjectReference>221 <ProjectReference Include="..\..\HeuristicLab.Optimization\3.3\HeuristicLab.Optimization-3.3.csproj">222 <Project>{14AB8D24-25BC-400C-A846-4627AA945192}</Project>223 <Name>HeuristicLab.Optimization-3.3</Name>224 </ProjectReference>225 <ProjectReference Include="..\..\HeuristicLab.Parameters\3.3\HeuristicLab.Parameters-3.3.csproj">226 <Project>{56F9106A-079F-4C61-92F6-86A84C2D84B7}</Project>227 <Name>HeuristicLab.Parameters-3.3</Name>228 </ProjectReference>229 <ProjectReference Include="..\..\HeuristicLab.Persistence\3.3\HeuristicLab.Persistence-3.3.csproj">230 <Project>{102BC7D3-0EF9-439C-8F6D-96FF0FDB8E1B}</Project>231 <Name>HeuristicLab.Persistence-3.3</Name>232 </ProjectReference>233 <ProjectReference Include="..\..\HeuristicLab.PluginInfrastructure\3.3\HeuristicLab.PluginInfrastructure-3.3.csproj">234 <Project>{94186A6A-5176-4402-AE83-886557B53CCA}</Project>235 <Name>HeuristicLab.PluginInfrastructure-3.3</Name>236 </ProjectReference>237 <ProjectReference Include="..\..\HeuristicLab.Random\3.3\HeuristicLab.Random-3.3.csproj">238 <Project>{F4539FB6-4708-40C9-BE64-0A1390AEA197}</Project>239 <Name>HeuristicLab.Random-3.3</Name>240 228 </ProjectReference> 241 229 </ItemGroup> -
branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Problems.DataAnalysis/3.3/Symbolic/FullFunctionalExpressionGrammar.cs
r4722 r5026 60 60 var or = new Or(); 61 61 var not = new Not(); 62 var timeLag = new TimeLag(); 63 timeLag.InitialFrequency = 0.0; 62 64 var constant = new Constant(); 63 65 constant.MinValue = -20; … … 67 69 laggedVariable.InitialFrequency = 0.0; 68 70 69 var allSymbols = new List<Symbol>() { add, sub, mul, div, mean, sin, cos, tan, log, exp, @if, gt, lt, and, or, not, constant, variableSymbol, laggedVariable };70 var unaryFunctionSymbols = new List<Symbol>() { sin, cos, tan, log, exp, not };71 var allSymbols = new List<Symbol>() { add, sub, mul, div, mean, sin, cos, tan, log, exp, @if, gt, lt, and, or, not, timeLag, constant, variableSymbol, laggedVariable }; 72 var unaryFunctionSymbols = new List<Symbol>() { sin, cos, tan, log, exp, not, timeLag }; 71 73 var binaryFunctionSymbols = new List<Symbol>() { gt, lt }; 72 74 var functionSymbols = new List<Symbol>() { add, sub, mul, div, mean, and, or }; -
branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Problems.DataAnalysis/3.3/Symbolic/SimpleArithmeticExpressionInterpreter.cs
r4722 r5026 66 66 public const byte Constant = 20; 67 67 public const byte Arg = 21; 68 69 public const byte TimeLag = 22; 68 70 } 69 71 … … 90 92 { typeof(Constant), OpCodes.Constant }, 91 93 { typeof(Argument), OpCodes.Arg }, 94 { typeof(TimeLag), OpCodes.TimeLag}, 92 95 }; 93 96 private const int ARGUMENT_STACK_SIZE = 1024; … … 290 293 return constTreeNode.Value; 291 294 } 295 case OpCodes.TimeLag: { 296 var timeLagTreeNode = (LaggedTreeNode)currentInstr.dynamicNode; 297 row += timeLagTreeNode.Lag; 298 if (row < 0 || row >= dataset.Rows) { 299 row -= timeLagTreeNode.Lag; 300 return double.NaN; 301 } 302 double result = Evaluate(); 303 row -= timeLagTreeNode.Lag; 304 return result; 305 } 292 306 default: throw new NotSupportedException(); 293 307 } -
branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Problems.DataAnalysis/3.3/Symbolic/Symbols/LaggedTreeNode.cs
r5005 r5026 20 20 #endregion 21 21 22 using System; 22 23 using HeuristicLab.Common; 23 24 using HeuristicLab.Core; 24 25 using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding; 25 26 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 26 using HeuristicLab.Random;27 27 namespace HeuristicLab.Problems.DataAnalysis.Symbolic.Symbols { 28 28 [StorableClass] 29 public class VariableTreeNode : SymbolicExpressionTreeTerminalNode {30 public new VariableSymbol {31 get { return ( Variable)base.Symbol; }29 public class LaggedTreeNode : SymbolicExpressionTreeNode, ILaggedTreeNode { 30 public new LaggedSymbol Symbol { 31 get { return (LaggedSymbol)base.Symbol; } 32 32 } 33 33 [Storable] 34 private double weight; 35 public double Weight { 36 get { return weight; } 37 set { weight = value; } 38 } 39 [Storable] 40 private string variableName; 41 public string VariableName { 42 get { return variableName; } 43 set { variableName = value; } 34 private int lag; 35 public int Lag { 36 get { return lag; } 37 set { lag = value; } 44 38 } 45 39 46 40 [StorableConstructor] 47 protected VariableTreeNode(bool deserializing) : base(deserializing) { }48 protected VariableTreeNode(VariableTreeNode original, Cloner cloner)41 protected LaggedTreeNode(bool deserializing) : base(deserializing) { } 42 protected LaggedTreeNode(LaggedTreeNode original, Cloner cloner) 49 43 : base(original, cloner) { 50 weight = original.weight; 51 variableName = original.variableName; 44 lag = original.lag; 52 45 } 53 protected VariableTreeNode() { } 54 public VariableTreeNode(Variable variableSymbol) : base(variableSymbol) { } 46 public LaggedTreeNode(LaggedSymbol timeLagSymbol) : base(timeLagSymbol) { } 55 47 56 48 public override bool HasLocalParameters { 57 get { 58 return true; 59 } 49 get { return true; } 60 50 } 61 51 62 52 public override void ResetLocalParameters(IRandom random) { 63 53 base.ResetLocalParameters(random); 64 weight = NormalDistributedRandom.NextDouble(random, Symbol.WeightMu, Symbol.WeightSigma); 65 variableName = Symbol.VariableNames.SelectRandom(random); 54 lag = random.Next(Symbol.MinLag, Symbol.MaxLag + 1); 66 55 } 67 56 68 57 public override void ShakeLocalParameters(IRandom random, double shakingFactor) { 69 58 base.ShakeLocalParameters(random, shakingFactor); 70 double x = NormalDistributedRandom.NextDouble(random, Symbol.WeightManipulatorMu, Symbol.WeightManipulatorSigma); 71 weight = weight + x * shakingFactor; 72 variableName = Symbol.VariableNames.SelectRandom(random); 59 lag = Math.Min(Symbol.MaxLag, Math.Max(Symbol.MinLag, lag + random.Next(-1, 2))); 73 60 } 74 61 75 62 public override IDeepCloneable Clone(Cloner cloner) { 76 return new VariableTreeNode(this, cloner);63 return new LaggedTreeNode(this, cloner); 77 64 } 78 65 79 66 public override string ToString() { 80 if (weight.IsAlmost(1.0)) return variableName; 81 else return weight.ToString("E4") + " " + variableName; 67 return base.ToString() + " " + lag.ToString(); 82 68 } 83 69 } -
branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Problems.DataAnalysis/3.3/Symbolic/Symbols/LaggedVariableTreeNode.cs
r4722 r5026 26 26 namespace HeuristicLab.Problems.DataAnalysis.Symbolic.Symbols { 27 27 [StorableClass] 28 public sealed class LaggedVariableTreeNode : VariableTreeNode {28 public sealed class LaggedVariableTreeNode : VariableTreeNode, ILaggedTreeNode { 29 29 public new LaggedVariable Symbol { 30 30 get { return (LaggedVariable)base.Symbol; }
Note: See TracChangeset
for help on using the changeset viewer.