- Timestamp:
- 03/31/14 13:38:42 (11 years ago)
- Location:
- branches/Sliding Window GP
- Files:
-
- 8 added
- 23 edited
- 1 copied
Legend:
- Unmodified
- Added
- Removed
-
branches/Sliding Window GP/HeuristicLab.Problems.DataAnalysis.Symbolic
- Property svn:mergeinfo changed
-
branches/Sliding Window GP/HeuristicLab.Problems.DataAnalysis.Symbolic.Classification/3.4/HeuristicLab.Problems.DataAnalysis.Symbolic.Classification-3.4.csproj
r10469 r10681 93 93 </PropertyGroup> 94 94 <ItemGroup> 95 <Reference Include="ALGLIB-3.7.0, Version=3.7.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL"> 96 <HintPath>..\..\bin\ALGLIB-3.7.0.dll</HintPath> 95 <Reference Include="ALGLIB-3.7.0"> 96 <HintPath>..\..\..\..\trunk\sources\bin\ALGLIB-3.7.0.dll</HintPath> 97 <Private>False</Private> 98 </Reference> 99 <Reference Include="HeuristicLab.Analysis-3.3"> 100 <HintPath>..\..\..\..\trunk\sources\bin\HeuristicLab.Analysis-3.3.dll</HintPath> 101 <Private>False</Private> 102 </Reference> 103 <Reference Include="HeuristicLab.Collections-3.3"> 104 <HintPath>..\..\..\..\trunk\sources\bin\HeuristicLab.Collections-3.3.dll</HintPath> 105 <Private>False</Private> 106 </Reference> 107 <Reference Include="HeuristicLab.Common-3.3"> 108 <HintPath>..\..\..\..\trunk\sources\bin\HeuristicLab.Common-3.3.dll</HintPath> 109 <Private>False</Private> 110 </Reference> 111 <Reference Include="HeuristicLab.Common.Resources-3.3"> 112 <HintPath>..\..\..\..\trunk\sources\bin\HeuristicLab.Common.Resources-3.3.dll</HintPath> 113 <Private>False</Private> 114 </Reference> 115 <Reference Include="HeuristicLab.Core-3.3"> 116 <HintPath>..\..\..\..\trunk\sources\bin\HeuristicLab.Core-3.3.dll</HintPath> 117 <Private>False</Private> 118 </Reference> 119 <Reference Include="HeuristicLab.Data-3.3"> 120 <HintPath>..\..\..\..\trunk\sources\bin\HeuristicLab.Data-3.3.dll</HintPath> 121 <Private>False</Private> 122 </Reference> 123 <Reference Include="HeuristicLab.Encodings.SymbolicExpressionTreeEncoding-3.4"> 124 <HintPath>..\..\..\..\trunk\sources\bin\HeuristicLab.Encodings.SymbolicExpressionTreeEncoding-3.4.dll</HintPath> 125 <Private>False</Private> 126 </Reference> 127 <Reference Include="HeuristicLab.Operators-3.3"> 128 <HintPath>..\..\..\..\trunk\sources\bin\HeuristicLab.Operators-3.3.dll</HintPath> 129 <Private>False</Private> 130 </Reference> 131 <Reference Include="HeuristicLab.Optimization-3.3"> 132 <HintPath>..\..\..\..\trunk\sources\bin\HeuristicLab.Optimization-3.3.dll</HintPath> 133 <Private>False</Private> 134 </Reference> 135 <Reference Include="HeuristicLab.Parameters-3.3"> 136 <HintPath>..\..\..\..\trunk\sources\bin\HeuristicLab.Parameters-3.3.dll</HintPath> 137 <Private>False</Private> 138 </Reference> 139 <Reference Include="HeuristicLab.Persistence-3.3"> 140 <HintPath>..\..\..\..\trunk\sources\bin\HeuristicLab.Persistence-3.3.dll</HintPath> 141 <Private>False</Private> 142 </Reference> 143 <Reference Include="HeuristicLab.PluginInfrastructure-3.3"> 144 <HintPath>..\..\..\..\trunk\sources\bin\HeuristicLab.PluginInfrastructure-3.3.dll</HintPath> 145 <Private>False</Private> 146 </Reference> 147 <Reference Include="HeuristicLab.Problems.DataAnalysis-3.4"> 148 <HintPath>..\..\..\..\trunk\sources\bin\HeuristicLab.Problems.DataAnalysis-3.4.dll</HintPath> 149 <Private>False</Private> 150 </Reference> 151 <Reference Include="HeuristicLab.Problems.Instances-3.3"> 152 <HintPath>..\..\..\..\trunk\sources\bin\HeuristicLab.Problems.Instances-3.3.dll</HintPath> 97 153 <Private>False</Private> 98 154 </Reference> … … 120 176 <Compile Include="ModelCreators\NormalDistributedThresholdsModelCreator.cs" /> 121 177 <Compile Include="MultiObjective\SymbolicClassificationMultiObjectiveValidationBestSolutionAnalyzer.cs" /> 178 <Compile Include="Sliding Window\GenerationalClassificationSlidingWindowAnalyzer.cs" /> 179 <Compile Include="Sliding Window\OffspringSelectionClassificationSlidingWindowAnalyzer.cs" /> 180 <Compile Include="Sliding Window\SlidingWindowBestClassificationSolutionsCollection.cs" /> 122 181 <Compile Include="SymbolicClassificationPruningAnalyzer.cs" /> 123 182 <Compile Include="SymbolicClassificationSolutionImpactValuesCalculator.cs" /> … … 177 236 </ItemGroup> 178 237 <ItemGroup> 179 <ProjectReference Include="..\..\HeuristicLab.Analysis\3.3\HeuristicLab.Analysis-3.3.csproj">180 <Project>{887425B4-4348-49ED-A457-B7D2C26DDBF9}</Project>181 <Name>HeuristicLab.Analysis-3.3</Name>182 <Private>False</Private>183 </ProjectReference>184 <ProjectReference Include="..\..\HeuristicLab.Collections\3.3\HeuristicLab.Collections-3.3.csproj">185 <Project>{958B43BC-CC5C-4FA2-8628-2B3B01D890B6}</Project>186 <Name>HeuristicLab.Collections-3.3</Name>187 <Private>False</Private>188 </ProjectReference>189 <ProjectReference Include="..\..\HeuristicLab.Common.Resources\3.3\HeuristicLab.Common.Resources-3.3.csproj">190 <Project>{0E27A536-1C4A-4624-A65E-DC4F4F23E3E1}</Project>191 <Name>HeuristicLab.Common.Resources-3.3</Name>192 </ProjectReference>193 <ProjectReference Include="..\..\HeuristicLab.Common\3.3\HeuristicLab.Common-3.3.csproj">194 <Project>{A9AD58B9-3EF9-4CC1-97E5-8D909039FF5C}</Project>195 <Name>HeuristicLab.Common-3.3</Name>196 <Private>False</Private>197 </ProjectReference>198 <ProjectReference Include="..\..\HeuristicLab.Core\3.3\HeuristicLab.Core-3.3.csproj">199 <Project>{C36BD924-A541-4A00-AFA8-41701378DDC5}</Project>200 <Name>HeuristicLab.Core-3.3</Name>201 <Private>False</Private>202 </ProjectReference>203 <ProjectReference Include="..\..\HeuristicLab.Data\3.3\HeuristicLab.Data-3.3.csproj">204 <Project>{BBAB9DF5-5EF3-4BA8-ADE9-B36E82114937}</Project>205 <Name>HeuristicLab.Data-3.3</Name>206 <Private>False</Private>207 </ProjectReference>208 <ProjectReference Include="..\..\HeuristicLab.Encodings.SymbolicExpressionTreeEncoding\3.4\HeuristicLab.Encodings.SymbolicExpressionTreeEncoding-3.4.csproj">209 <Project>{06D4A186-9319-48A0-BADE-A2058D462EEA}</Project>210 <Name>HeuristicLab.Encodings.SymbolicExpressionTreeEncoding-3.4</Name>211 <Private>False</Private>212 </ProjectReference>213 <ProjectReference Include="..\..\HeuristicLab.Operators\3.3\HeuristicLab.Operators-3.3.csproj">214 <Project>{23DA7FF4-D5B8-41B6-AA96-F0561D24F3EE}</Project>215 <Name>HeuristicLab.Operators-3.3</Name>216 <Private>False</Private>217 </ProjectReference>218 <ProjectReference Include="..\..\HeuristicLab.Optimization\3.3\HeuristicLab.Optimization-3.3.csproj">219 <Project>{14AB8D24-25BC-400C-A846-4627AA945192}</Project>220 <Name>HeuristicLab.Optimization-3.3</Name>221 <Private>False</Private>222 </ProjectReference>223 <ProjectReference Include="..\..\HeuristicLab.Parameters\3.3\HeuristicLab.Parameters-3.3.csproj">224 <Project>{56F9106A-079F-4C61-92F6-86A84C2D84B7}</Project>225 <Name>HeuristicLab.Parameters-3.3</Name>226 <Private>False</Private>227 </ProjectReference>228 <ProjectReference Include="..\..\HeuristicLab.Persistence\3.3\HeuristicLab.Persistence-3.3.csproj">229 <Project>{102BC7D3-0EF9-439C-8F6D-96FF0FDB8E1B}</Project>230 <Name>HeuristicLab.Persistence-3.3</Name>231 <Private>False</Private>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 <Private>False</Private>237 </ProjectReference>238 238 <ProjectReference Include="..\..\HeuristicLab.Problems.DataAnalysis.Symbolic\3.4\HeuristicLab.Problems.DataAnalysis.Symbolic-3.4.csproj"> 239 239 <Project>{3D28463F-EC96-4D82-AFEE-38BE91A0CA00}</Project> 240 240 <Name>HeuristicLab.Problems.DataAnalysis.Symbolic-3.4</Name> 241 <Private>False</Private>242 </ProjectReference>243 <ProjectReference Include="..\..\HeuristicLab.Problems.DataAnalysis\3.4\HeuristicLab.Problems.DataAnalysis-3.4.csproj">244 <Project>{DF87C13E-A889-46FF-8153-66DCAA8C5674}</Project>245 <Name>HeuristicLab.Problems.DataAnalysis-3.4</Name>246 <Private>False</Private>247 </ProjectReference>248 <ProjectReference Include="..\..\HeuristicLab.Problems.Instances\3.3\HeuristicLab.Problems.Instances-3.3.csproj">249 <Project>{3540E29E-4793-49E7-8EE2-FEA7F61C3994}</Project>250 <Name>HeuristicLab.Problems.Instances-3.3</Name>251 241 <Private>False</Private> 252 242 </ProjectReference> -
branches/Sliding Window GP/HeuristicLab.Problems.DataAnalysis.Symbolic.Classification/3.4/SymbolicClassificationPruningOperator.cs
r10469 r10681 28 28 #endregion 29 29 30 protected SymbolicClassificationPruningOperator(SymbolicClassificationPruningOperator original, Cloner cloner) 30 protected SymbolicClassificationPruningOperator(SymbolicClassificationPruningOperator 31 original, Cloner cloner) 31 32 : base(original, cloner) { 32 33 } -
branches/Sliding Window GP/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression/3.4/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression-3.4.csproj
r10596 r10681 93 93 </PropertyGroup> 94 94 <ItemGroup> 95 <Reference Include="ALGLIB-3.7.0, Version=3.7.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL"> 95 <Reference Include="ALGLIB-3.7.0"> 96 <HintPath>..\..\..\..\trunk\sources\bin\ALGLIB-3.7.0.dll</HintPath> 97 <Private>False</Private> 98 </Reference> 99 <Reference Include="AutoDiff-1.0"> 100 <HintPath>..\..\..\..\trunk\sources\bin\AutoDiff-1.0.dll</HintPath> 101 <Private>False</Private> 102 </Reference> 103 <Reference Include="HeuristicLab.Analysis-3.3"> 104 <HintPath>..\..\..\..\trunk\sources\bin\HeuristicLab.Analysis-3.3.dll</HintPath> 105 <Private>False</Private> 106 </Reference> 107 <Reference Include="HeuristicLab.Collections-3.3"> 108 <HintPath>..\..\..\..\trunk\sources\bin\HeuristicLab.Collections-3.3.dll</HintPath> 109 <Private>False</Private> 110 </Reference> 111 <Reference Include="HeuristicLab.Common-3.3"> 112 <HintPath>..\..\..\..\trunk\sources\bin\HeuristicLab.Common-3.3.dll</HintPath> 113 <Private>False</Private> 114 </Reference> 115 <Reference Include="HeuristicLab.Common.Resources-3.3"> 116 <HintPath>..\..\..\..\trunk\sources\bin\HeuristicLab.Common.Resources-3.3.dll</HintPath> 117 <Private>False</Private> 118 </Reference> 119 <Reference Include="HeuristicLab.Core-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL"> 96 120 <SpecificVersion>False</SpecificVersion> 97 <HintPath>..\..\bin\ALGLIB-3.7.0.dll</HintPath> 98 <Private>False</Private> 99 </Reference> 100 <Reference Include="AutoDiff-1.0, Version=1.0.0.14388, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL"> 101 <HintPath>..\..\bin\AutoDiff-1.0.dll</HintPath> 121 <HintPath>..\..\..\..\trunk\sources\bin\HeuristicLab.Core-3.3.dll</HintPath> 122 <Private>False</Private> 123 </Reference> 124 <Reference Include="HeuristicLab.Data-3.3"> 125 <HintPath>..\..\..\..\trunk\sources\bin\HeuristicLab.Data-3.3.dll</HintPath> 126 <Private>False</Private> 127 </Reference> 128 <Reference Include="HeuristicLab.Encodings.SymbolicExpressionTreeEncoding-3.4"> 129 <HintPath>..\..\..\..\trunk\sources\bin\HeuristicLab.Encodings.SymbolicExpressionTreeEncoding-3.4.dll</HintPath> 130 <Private>False</Private> 131 </Reference> 132 <Reference Include="HeuristicLab.Operators-3.3"> 133 <HintPath>..\..\..\..\trunk\sources\bin\HeuristicLab.Operators-3.3.dll</HintPath> 134 <Private>False</Private> 135 </Reference> 136 <Reference Include="HeuristicLab.Optimization-3.3"> 137 <HintPath>..\..\..\..\trunk\sources\bin\HeuristicLab.Optimization-3.3.dll</HintPath> 138 <Private>False</Private> 139 </Reference> 140 <Reference Include="HeuristicLab.Parameters-3.3"> 141 <HintPath>..\..\..\..\trunk\sources\bin\HeuristicLab.Parameters-3.3.dll</HintPath> 142 <Private>False</Private> 143 </Reference> 144 <Reference Include="HeuristicLab.Persistence-3.3"> 145 <HintPath>..\..\..\..\trunk\sources\bin\HeuristicLab.Persistence-3.3.dll</HintPath> 146 <Private>False</Private> 147 </Reference> 148 <Reference Include="HeuristicLab.PluginInfrastructure-3.3"> 149 <HintPath>..\..\..\..\trunk\sources\bin\HeuristicLab.PluginInfrastructure-3.3.dll</HintPath> 150 <Private>False</Private> 151 </Reference> 152 <Reference Include="HeuristicLab.Problems.DataAnalysis-3.4"> 153 <HintPath>..\..\..\..\trunk\sources\bin\HeuristicLab.Problems.DataAnalysis-3.4.dll</HintPath> 154 <Private>False</Private> 155 </Reference> 156 <Reference Include="HeuristicLab.Problems.Instances-3.3"> 157 <HintPath>..\..\..\..\trunk\sources\bin\HeuristicLab.Problems.Instances-3.3.dll</HintPath> 102 158 <Private>False</Private> 103 159 </Reference> … … 122 178 <Compile Include="SingleObjective\Evaluators\SymbolicRegressionMeanRelativeErrorEvaluator.cs" /> 123 179 <Compile Include="SingleObjective\SymbolicRegressionSolutionsAnalyzer.cs" /> 180 <Compile Include="SlidingWindow\GenerationalRegressionSlidingWindowAnalyzer.cs" /> 181 <Compile Include="SlidingWindow\OffspringSelectionRegressionSlidingWindowAnalyzer.cs" /> 182 <Compile Include="SlidingWindow\SlidingWindowBestRegressionSolutionsCollection.cs" /> 124 183 <Compile Include="SymbolicRegressionPruningAnalyzer.cs" /> 125 184 <Compile Include="SingleObjective\Evaluators\SymbolicRegressionLogResidualEvaluator.cs" /> … … 173 232 </ItemGroup> 174 233 <ItemGroup> 175 <ProjectReference Include="..\..\HeuristicLab.Analysis\3.3\HeuristicLab.Analysis-3.3.csproj">176 <Project>{887425B4-4348-49ED-A457-B7D2C26DDBF9}</Project>177 <Name>HeuristicLab.Analysis-3.3</Name>178 <Private>False</Private>179 </ProjectReference>180 <ProjectReference Include="..\..\HeuristicLab.Collections\3.3\HeuristicLab.Collections-3.3.csproj">181 <Project>{958B43BC-CC5C-4FA2-8628-2B3B01D890B6}</Project>182 <Name>HeuristicLab.Collections-3.3</Name>183 <Private>False</Private>184 </ProjectReference>185 <ProjectReference Include="..\..\HeuristicLab.Common\3.3\HeuristicLab.Common-3.3.csproj">186 <Project>{A9AD58B9-3EF9-4CC1-97E5-8D909039FF5C}</Project>187 <Name>HeuristicLab.Common-3.3</Name>188 <Private>False</Private>189 </ProjectReference>190 <ProjectReference Include="..\..\HeuristicLab.Core\3.3\HeuristicLab.Core-3.3.csproj">191 <Project>{C36BD924-A541-4A00-AFA8-41701378DDC5}</Project>192 <Name>HeuristicLab.Core-3.3</Name>193 <Private>False</Private>194 </ProjectReference>195 <ProjectReference Include="..\..\HeuristicLab.Data\3.3\HeuristicLab.Data-3.3.csproj">196 <Project>{BBAB9DF5-5EF3-4BA8-ADE9-B36E82114937}</Project>197 <Name>HeuristicLab.Data-3.3</Name>198 <Private>False</Private>199 </ProjectReference>200 <ProjectReference Include="..\..\HeuristicLab.Encodings.SymbolicExpressionTreeEncoding\3.4\HeuristicLab.Encodings.SymbolicExpressionTreeEncoding-3.4.csproj">201 <Project>{06D4A186-9319-48A0-BADE-A2058D462EEA}</Project>202 <Name>HeuristicLab.Encodings.SymbolicExpressionTreeEncoding-3.4</Name>203 <Private>False</Private>204 </ProjectReference>205 <ProjectReference Include="..\..\HeuristicLab.Operators\3.3\HeuristicLab.Operators-3.3.csproj">206 <Project>{23DA7FF4-D5B8-41B6-AA96-F0561D24F3EE}</Project>207 <Name>HeuristicLab.Operators-3.3</Name>208 <Private>False</Private>209 </ProjectReference>210 <ProjectReference Include="..\..\HeuristicLab.Optimization\3.3\HeuristicLab.Optimization-3.3.csproj">211 <Project>{14AB8D24-25BC-400C-A846-4627AA945192}</Project>212 <Name>HeuristicLab.Optimization-3.3</Name>213 <Private>False</Private>214 </ProjectReference>215 <ProjectReference Include="..\..\HeuristicLab.Parameters\3.3\HeuristicLab.Parameters-3.3.csproj">216 <Project>{56F9106A-079F-4C61-92F6-86A84C2D84B7}</Project>217 <Name>HeuristicLab.Parameters-3.3</Name>218 <Private>False</Private>219 </ProjectReference>220 <ProjectReference Include="..\..\HeuristicLab.Persistence\3.3\HeuristicLab.Persistence-3.3.csproj">221 <Project>{102BC7D3-0EF9-439C-8F6D-96FF0FDB8E1B}</Project>222 <Name>HeuristicLab.Persistence-3.3</Name>223 <Private>False</Private>224 </ProjectReference>225 <ProjectReference Include="..\..\HeuristicLab.PluginInfrastructure\3.3\HeuristicLab.PluginInfrastructure-3.3.csproj">226 <Project>{94186A6A-5176-4402-AE83-886557B53CCA}</Project>227 <Name>HeuristicLab.PluginInfrastructure-3.3</Name>228 <Private>False</Private>229 </ProjectReference>230 234 <ProjectReference Include="..\..\HeuristicLab.Problems.DataAnalysis.Symbolic\3.4\HeuristicLab.Problems.DataAnalysis.Symbolic-3.4.csproj"> 231 235 <Project>{3D28463F-EC96-4D82-AFEE-38BE91A0CA00}</Project> 232 236 <Name>HeuristicLab.Problems.DataAnalysis.Symbolic-3.4</Name> 233 <Private>False</Private>234 </ProjectReference>235 <ProjectReference Include="..\..\HeuristicLab.Problems.DataAnalysis\3.4\HeuristicLab.Problems.DataAnalysis-3.4.csproj">236 <Project>{DF87C13E-A889-46FF-8153-66DCAA8C5674}</Project>237 <Name>HeuristicLab.Problems.DataAnalysis-3.4</Name>238 <Private>False</Private>239 </ProjectReference>240 <ProjectReference Include="..\..\HeuristicLab.Problems.Instances\3.3\HeuristicLab.Problems.Instances-3.3.csproj">241 <Project>{3540E29E-4793-49E7-8EE2-FEA7F61C3994}</Project>242 <Name>HeuristicLab.Problems.Instances-3.3</Name>243 237 <Private>False</Private> 244 238 </ProjectReference> -
branches/Sliding Window GP/HeuristicLab.Problems.DataAnalysis.Symbolic.Views
- Property svn:mergeinfo changed
/trunk/sources/HeuristicLab.Problems.DataAnalysis.Symbolic.Views merged: 10492,10521-10522,10545,10561,10564
- Property svn:mergeinfo changed
-
branches/Sliding Window GP/HeuristicLab.Problems.DataAnalysis.Symbolic.Views/3.4/HeuristicLab.Problems.DataAnalysis.Symbolic.Views-3.4.csproj
r10419 r10681 117 117 <Private>False</Private> 118 118 </Reference> 119 <Reference Include="HeuristicLab.Common.Resources-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL"> 120 <SpecificVersion>False</SpecificVersion> 121 <HintPath>..\..\..\..\trunk\sources\bin\HeuristicLab.Common.Resources-3.3.dll</HintPath> 122 <Private>False</Private> 123 </Reference> 119 124 <Reference Include="HeuristicLab.Core-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL"> 120 125 <HintPath>..\..\..\..\trunk\sources\bin\HeuristicLab.Core-3.3.dll</HintPath> -
branches/Sliding Window GP/HeuristicLab.Problems.DataAnalysis.Symbolic.Views/3.4/InteractiveSymbolicDataAnalysisSolutionSimplifierView.Designer.cs
r9708 r10681 19 19 */ 20 20 #endregion 21 21 22 22 23 namespace HeuristicLab.Problems.DataAnalysis.Symbolic.Views { … … 137 138 // 138 139 // btnOptimizeConstants 139 // 140 this.btnOptimizeConstants.A nchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));140 // 141 this.btnOptimizeConstants.AutoSize = true; 141 142 this.btnOptimizeConstants.Enabled = false; 142 this.btnOptimizeConstants.Location = new System.Drawing.Point(104, 3); 143 this.btnOptimizeConstants.Image = HeuristicLab.Common.Resources.VSImageLibrary.Performance; 144 this.btnOptimizeConstants.ImageAlign = System.Drawing.ContentAlignment.MiddleCenter; 145 this.btnOptimizeConstants.Location = new System.Drawing.Point(105, 3); 143 146 this.btnOptimizeConstants.Name = "btnOptimizeConstants"; 144 this.btnOptimizeConstants.Size = new System.Drawing.Size( 97, 23);147 this.btnOptimizeConstants.Size = new System.Drawing.Size(80, 24); 145 148 this.btnOptimizeConstants.TabIndex = 2; 146 149 this.btnOptimizeConstants.Text = "Optimize"; 150 this.btnOptimizeConstants.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; 151 this.btnOptimizeConstants.TextImageRelation = System.Windows.Forms.TextImageRelation.ImageBeforeText; 147 152 this.btnOptimizeConstants.UseVisualStyleBackColor = true; 148 153 this.btnOptimizeConstants.Click += new System.EventHandler(this.btnOptimizeConstants_Click); … … 150 155 // btnSimplify 151 156 // 157 this.btnSimplify.AutoSize = true; 158 this.btnSimplify.Enabled = true; 159 this.btnSimplify.Image = HeuristicLab.Common.Resources.VSImageLibrary.FormulaEvaluator; 160 this.btnSimplify.ImageAlign = System.Drawing.ContentAlignment.MiddleCenter; 152 161 this.btnSimplify.Location = new System.Drawing.Point(3, 3); 153 162 this.btnSimplify.Name = "btnSimplify"; 154 this.btnSimplify.Size = new System.Drawing.Size( 95, 23);163 this.btnSimplify.Size = new System.Drawing.Size(80, 24); 155 164 this.btnSimplify.TabIndex = 1; 156 165 this.btnSimplify.Text = "Simplify"; 166 this.btnSimplify.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; 167 this.btnSimplify.TextImageRelation = System.Windows.Forms.TextImageRelation.ImageBeforeText; 157 168 this.btnSimplify.UseVisualStyleBackColor = true; 158 169 this.btnSimplify.Click += new System.EventHandler(this.btnSimplify_Click); -
branches/Sliding Window GP/HeuristicLab.Problems.DataAnalysis.Symbolic.Views/3.4/InteractiveSymbolicDataAnalysisSolutionSimplifierView.cs
r9708 r10681 52 52 Content.ModelChanged += Content_Changed; 53 53 Content.ProblemDataChanged += Content_Changed; 54 treeChart.Repainted += treeChart_Repainted; 54 55 } 55 56 protected override void DeregisterContentEvents() { … … 57 58 Content.ModelChanged -= Content_Changed; 58 59 Content.ProblemDataChanged -= Content_Changed; 60 treeChart.Repainted -= treeChart_Repainted; 59 61 } 60 62 … … 70 72 } 71 73 74 private void treeChart_Repainted(object sender, EventArgs e) { 75 if (nodeImpacts != null && nodeImpacts.Count > 0) 76 PaintNodeImpacts(); 77 } 78 72 79 private void UpdateView() { 73 80 if (Content == null || Content.Model == null || Content.ProblemData == null) return; … … 75 82 treeChart.Tree = tree.Root.SubtreeCount > 1 ? new SymbolicExpressionTree(tree.Root) : new SymbolicExpressionTree(tree.Root.GetSubtree(0).GetSubtree(0)); 76 83 77 var replacementValues = CalculateReplacementValues(tree); 84 var impactAndReplacementValues = CalculateImpactAndReplacementValues(tree); 85 nodeImpacts = impactAndReplacementValues.ToDictionary(x => x.Key, x => x.Value.Item1); 86 var replacementValues = impactAndReplacementValues.ToDictionary(x => x.Key, x => x.Value.Item2); 78 87 foreach (var pair in replacementValues.Where(pair => !(pair.Key is ConstantTreeNode))) { 79 88 foldedNodes[pair.Key] = MakeConstantTreeNode(pair.Value); 80 89 } 81 82 nodeImpacts = CalculateImpactValues(tree);83 90 PaintNodeImpacts(); 84 91 } … … 86 93 protected abstract Dictionary<ISymbolicExpressionTreeNode, double> CalculateReplacementValues(ISymbolicExpressionTree tree); 87 94 protected abstract Dictionary<ISymbolicExpressionTreeNode, double> CalculateImpactValues(ISymbolicExpressionTree tree); 95 protected abstract Dictionary<ISymbolicExpressionTreeNode, Tuple<double, double>> CalculateImpactAndReplacementValues(ISymbolicExpressionTree tree); 88 96 protected abstract void UpdateModel(ISymbolicExpressionTree tree); 89 97 … … 96 104 97 105 private void treeChart_SymbolicExpressionTreeNodeDoubleClicked(object sender, MouseEventArgs e) { 98 var visualNode = (Visual SymbolicExpressionTreeNode)sender;99 var symbExprTreeNode = (SymbolicExpressionTreeNode)visualNode. SymbolicExpressionTreeNode;106 var visualNode = (VisualTreeNode<ISymbolicExpressionTreeNode>)sender; 107 var symbExprTreeNode = (SymbolicExpressionTreeNode)visualNode.Content; 100 108 if (symbExprTreeNode == null) return; 101 109 var tree = Content.Model.SymbolicExpressionTree; … … 125 133 double max = impacts.Max(); 126 134 double min = impacts.Min(); 127 foreach ( ISymbolicExpressionTreeNodetreeNode in Content.Model.SymbolicExpressionTree.IterateNodesPostfix()) {128 Visual SymbolicExpressionTreeNodevisualTree = treeChart.GetVisualSymbolicExpressionTreeNode(treeNode);135 foreach (var treeNode in Content.Model.SymbolicExpressionTree.IterateNodesPostfix()) { 136 VisualTreeNode<ISymbolicExpressionTreeNode> visualTree = treeChart.GetVisualSymbolicExpressionTreeNode(treeNode); 129 137 130 138 if (!(treeNode is ConstantTreeNode) && nodeImpacts.ContainsKey(treeNode)) { -
branches/Sliding Window GP/HeuristicLab.Problems.DataAnalysis.Symbolic.Views/3.4/InteractiveSymbolicExpressionTreeChart.cs
r9708 r10681 33 33 internal sealed partial class InteractiveSymbolicExpressionTreeChart : SymbolicExpressionTreeChart { 34 34 private ISymbolicExpressionTreeNode tempNode; // node in clipboard (to be cut/copy/pasted etc) 35 private Visual SymbolicExpressionTreeNodecurrSelected; // currently selected node35 private VisualTreeNode<ISymbolicExpressionTreeNode> currSelected; // currently selected node 36 36 private enum EditOp { NoOp, CopySubtree, CutSubtree } 37 37 private EditOp lastOp = EditOp.NoOp; … … 65 65 pasteToolStripMenuItem.Visible = false; 66 66 } else { 67 var node = currSelected. SymbolicExpressionTreeNode;67 var node = currSelected.Content; 68 68 insertNodeToolStripMenuItem.Visible = true; 69 69 changeNodeToolStripMenuItem.Visible = true; … … 77 77 pasteToolStripMenuItem.Enabled = tempNode != null && insertNodeToolStripMenuItem.Enabled 78 78 && !(lastOp == EditOp.CutSubtree 79 && tempNode.IterateNodesBreadth().Contains(currSelected. SymbolicExpressionTreeNode));79 && tempNode.IterateNodesBreadth().Contains(currSelected.Content)); 80 80 } 81 81 } 82 82 83 83 protected override void OnSymbolicExpressionTreeNodeClicked(object sender, MouseEventArgs e) { 84 currSelected = (Visual SymbolicExpressionTreeNode)sender; ;84 currSelected = (VisualTreeNode<ISymbolicExpressionTreeNode>)sender; ; 85 85 if (currSelected != null) { 86 86 currSelected.LineColor = Color.FromArgb(130, currSelected.LineColor); … … 104 104 105 105 private void insertNodeToolStripMenuItem_Click(object sender, EventArgs e) { 106 if (currSelected == null || currSelected. SymbolicExpressionTreeNodeis SymbolicExpressionTreeTerminalNode) return;107 var parent = currSelected. SymbolicExpressionTreeNode;106 if (currSelected == null || currSelected.Content is SymbolicExpressionTreeTerminalNode) return; 107 var parent = currSelected.Content; 108 108 109 109 using (var dialog = new InsertNodeDialog()) { … … 138 138 if (currSelected == null) return; 139 139 140 var node = (ISymbolicExpressionTreeNode)currSelected. SymbolicExpressionTreeNode.Clone();141 var originalNode = currSelected. SymbolicExpressionTreeNode;140 var node = (ISymbolicExpressionTreeNode)currSelected.Content.Clone(); 141 var originalNode = currSelected.Content; 142 142 143 143 ISymbolicExpressionTreeNode newNode = null; … … 180 180 } 181 181 } 182 tempNode = currSelected. SymbolicExpressionTreeNode;182 tempNode = currSelected.Content; 183 183 foreach (var node in tempNode.IterateNodesPostfix()) { 184 184 var visualNode = GetVisualSymbolicExpressionTreeNode(node); … … 194 194 } 195 195 private void removeNodeToolStripMenuItem_Click(object sender, EventArgs e) { 196 var node = currSelected. SymbolicExpressionTreeNode;196 var node = currSelected.Content; 197 197 if (node == tempNode) tempNode = null; 198 198 ModifyTree(Tree, node.Parent, node, null, removeSubtree: false); … … 200 200 } 201 201 private void removeSubtreeToolStripMenuItem_Click(object sender, EventArgs e) { 202 var node = currSelected. SymbolicExpressionTreeNode;202 var node = currSelected.Content; 203 203 if (node.IterateNodesPostfix().Contains(tempNode)) tempNode = null; 204 204 ModifyTree(Tree, node.Parent, node, null, removeSubtree: true); … … 209 209 if (!(lastOp == EditOp.CopySubtree || lastOp == EditOp.CutSubtree)) return; 210 210 // check if the copied/cut node (stored in the tempNode) can be inserted as a child of the current selected node 211 var node = currSelected. SymbolicExpressionTreeNode;211 var node = currSelected.Content; 212 212 if (node is ConstantTreeNode || node is VariableTreeNode) return; 213 213 // check if the currently selected node can accept the copied node as a child … … 218 218 if (tempNode.IterateNodesBreadth().Contains(node)) 219 219 throw new ArgumentException();// cannot cut/paste a node into itself 220 ModifyTree(Tree, tempNode.Parent, tempNode, null); //remove node from its original parent 220 ModifyTree(Tree, tempNode.Parent, tempNode, null); //remove node from its original parent 221 221 ModifyTree(Tree, node, null, tempNode); //insert it as a child to the new parent 222 222 break; -
branches/Sliding Window GP/HeuristicLab.Problems.DataAnalysis.Symbolic.Views/3.4/Plugin.cs.frame
r10364 r10681 32 32 [PluginDependency("HeuristicLab.Collections", "3.3")] 33 33 [PluginDependency("HeuristicLab.Common", "3.3")] 34 [PluginDependency("HeuristicLab.Common.Resources", "3.3")] 34 35 [PluginDependency("HeuristicLab.Core", "3.3")] 35 36 [PluginDependency("HeuristicLab.Core.Views", "3.3")] -
branches/Sliding Window GP/HeuristicLab.Problems.DataAnalysis.Symbolic.Views/3.4/TextualSymbolicDataAnalysisModelView.designer.cs
r9708 r10681 48 48 this.SuspendLayout(); 49 49 // 50 // expressionTreeView50 // symbolicExpressionTreeView 51 51 // 52 52 this.symbolicExpressionTreeView.AllowDrop = true; … … 54 54 this.symbolicExpressionTreeView.Content = null; 55 55 this.symbolicExpressionTreeView.Dock = System.Windows.Forms.DockStyle.Fill; 56 this.symbolicExpressionTreeView.Font = new System.Drawing.Font("Consolas", 8.25F); 56 57 this.symbolicExpressionTreeView.Location = new System.Drawing.Point(0, 0); 57 this.symbolicExpressionTreeView.Name = " expressionTreeView";58 this.symbolicExpressionTreeView.Name = "symbolicExpressionTreeView"; 58 59 this.symbolicExpressionTreeView.ReadOnly = false; 59 60 this.symbolicExpressionTreeView.Size = new System.Drawing.Size(352, 413); 60 61 this.symbolicExpressionTreeView.TabIndex = 0; 61 62 // 62 // SymbolicExpressionModelView63 // TextualSymbolicDataAnalysisModelView 63 64 // 64 65 this.AllowDrop = true; 65 this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);66 66 this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Inherit; 67 67 this.Controls.Add(this.symbolicExpressionTreeView); 68 this.Name = " SymbolicExpressionModelView";68 this.Name = "TextualSymbolicDataAnalysisModelView"; 69 69 this.Size = new System.Drawing.Size(352, 413); 70 70 this.ResumeLayout(false); -
branches/Sliding Window GP/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Analyzers/SymbolicDataAnalysisAlleleFrequencyAnalyzer.cs
r9708 r10681 75 75 public static Allele[] CalculateAlleles(ISymbolicExpressionTree solution, int alleleTreedepth) { 76 76 return GetAllSubtreesOfDepth(solution, alleleTreedepth) 77 .AsParallel()78 77 .Select(t => GetAlleleFromSubtreeOfDepth(t, alleleTreedepth)) 79 78 .ToArray(); -
branches/Sliding Window GP/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Analyzers/SymbolicDataAnalysisMultiObjectiveValidationBestSolutionAnalyzer.cs
r9708 r10681 121 121 122 122 var qualities = tree 123 .AsParallel()124 123 .Select(t => evaluator.Evaluate(childContext, t, problemData, rows)) 125 124 .ToArray(); -
branches/Sliding Window GP/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Analyzers/SymbolicDataAnalysisSingleObjectivePruningAnalyzer.cs
r10429 r10681 5 5 using HeuristicLab.Core; 6 6 using HeuristicLab.Data; 7 using HeuristicLab. Encodings.SymbolicExpressionTreeEncoding;8 using HeuristicLab.Optimization ;7 using HeuristicLab.Operators; 8 using HeuristicLab.Optimization.Operators; 9 9 using HeuristicLab.Parameters; 10 10 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; … … 14 14 [Item("SymbolicDataAnalysisSingleObjectivePruningAnalyzer", "An analyzer that prunes introns from trees in single objective symbolic data analysis problems.")] 15 15 public abstract class SymbolicDataAnalysisSingleObjectivePruningAnalyzer : SymbolicDataAnalysisSingleObjectiveAnalyzer { 16 #region parameter names 16 17 private const string ProblemDataParameterName = "ProblemData"; 17 private const string InterpreterParameterName = "SymbolicExpressionTreeInterpreter";18 19 18 private const string UpdateIntervalParameterName = "UpdateInverval"; 20 19 private const string UpdateCounterParameterName = "UpdateCounter"; 21 22 20 private const string PopulationSliceParameterName = "PopulationSlice"; 23 21 private const string PruningProbabilityParameterName = "PruningProbability"; 24 25 private const string NumberOfPrunedSubtreesParameterName = "PrunedSubtrees"; 26 private const string NumberOfPrunedTreesParameterName = "PrunedTrees"; 27 22 private const string TotalNumberOfPrunedSubtreesParameterName = "Number of pruned subtrees"; 23 private const string TotalNumberOfPrunedTreesParameterName = "Number of pruned trees"; 28 24 private const string RandomParameterName = "Random"; 29 private const string EstimationLimitsParameterName = "EstimationLimits";30 31 25 private const string PruneOnlyZeroImpactNodesParameterName = "PruneOnlyZeroImpactNodes"; 32 26 private const string NodeImpactThresholdParameterName = "ImpactThreshold"; 33 34 private const string FitnessCalculationPartitionParameterName = "FitnessCalculationPartition"; 35 36 private bool reentry; 37 [Storable] 38 protected ISymbolicDataAnalysisSolutionImpactValuesCalculator impactValuesCalculator; 39 27 private const string PruningOperatorParameterName = "PruningOperator"; 28 private const string ResultsParameterName = "Results"; 29 #endregion 30 #region private members 31 private DataReducer prunedSubtreesReducer; 32 private DataReducer prunedTreesReducer; 33 private DataTableValuesCollector valuesCollector; 34 private ResultsCollector resultsCollector; 35 private EmptyOperator emptyOp; 36 #endregion 40 37 #region parameter properties 38 public IValueParameter<SymbolicDataAnalysisExpressionPruningOperator> PruningOperatorParameter { 39 get { return (IValueParameter<SymbolicDataAnalysisExpressionPruningOperator>)Parameters[PruningOperatorParameterName]; } 40 } 41 41 public IFixedValueParameter<BoolValue> PruneOnlyZeroImpactNodesParameter { 42 42 get { return (IFixedValueParameter<BoolValue>)Parameters[PruneOnlyZeroImpactNodesParameterName]; } … … 45 45 get { return (IFixedValueParameter<DoubleValue>)Parameters[NodeImpactThresholdParameterName]; } 46 46 } 47 public ILookupParameter<DoubleLimit> EstimationLimitsParameter {48 get { return (ILookupParameter<DoubleLimit>)Parameters[EstimationLimitsParameterName]; }49 }50 47 public ILookupParameter<IRandom> RandomParameter { 51 48 get { return (ILookupParameter<IRandom>)Parameters[RandomParameterName]; } … … 53 50 private ILookupParameter<IDataAnalysisProblemData> ProblemDataParameter { 54 51 get { return (ILookupParameter<IDataAnalysisProblemData>)Parameters[ProblemDataParameterName]; } 55 }56 public ILookupParameter<IntRange> FitnessCalculationPartitionParameter {57 get { return (ILookupParameter<IntRange>)Parameters[FitnessCalculationPartitionParameterName]; }58 }59 private ILookupParameter<ISymbolicDataAnalysisExpressionTreeInterpreter> InterpreterParameter {60 get { return (ILookupParameter<ISymbolicDataAnalysisExpressionTreeInterpreter>)Parameters[InterpreterParameterName]; }61 52 } 62 53 public IValueParameter<IntValue> UpdateIntervalParameter { … … 72 63 get { return (IValueParameter<DoubleValue>)Parameters[PruningProbabilityParameterName]; } 73 64 } 74 public IFixedValueParameter<DoubleValue> NumberOfPrunedSubtreesParameter {75 get { return (IFixedValueParameter<DoubleValue>)Parameters[NumberOfPrunedSubtreesParameterName]; }76 }77 public IFixedValueParameter<DoubleValue> NumberOfPrunedTreesParameter {78 get { return (IFixedValueParameter<DoubleValue>)Parameters[NumberOfPrunedTreesParameterName]; }79 }80 65 #endregion 81 66 #region properties 67 protected SymbolicDataAnalysisExpressionPruningOperator PruningOperator { get { return PruningOperatorParameter.Value; } } 82 68 protected IDataAnalysisProblemData ProblemData { get { return ProblemDataParameter.ActualValue; } } 83 protected IntRange FitnessCalculationPartition { get { return FitnessCalculationPartitionParameter.ActualValue; } }84 protected ISymbolicDataAnalysisExpressionTreeInterpreter Interpreter { get { return InterpreterParameter.ActualValue; } }85 69 protected IntValue UpdateInterval { get { return UpdateIntervalParameter.Value; } } 86 70 protected IntValue UpdateCounter { get { return UpdateCounterParameter.Value; } } 87 71 protected DoubleRange PopulationSlice { get { return PopulationSliceParameter.Value; } } 88 72 protected DoubleValue PruningProbability { get { return PruningProbabilityParameter.Value; } } 89 protected DoubleValue PrunedSubtrees { get { return NumberOfPrunedSubtreesParameter.Value; } }90 protected DoubleValue PrunedTrees { get { return NumberOfPrunedTreesParameter.Value; } }91 protected DoubleLimit EstimationLimits { get { return EstimationLimitsParameter.ActualValue; } }92 73 protected IRandom Random { get { return RandomParameter.ActualValue; } } 93 74 protected DoubleValue NodeImpactThreshold { get { return NodeImpactThresholdParameter.Value; } } 94 75 protected BoolValue PruneOnlyZeroImpactNodes { get { return PruneOnlyZeroImpactNodesParameter.Value; } } 95 76 #endregion 96 97 77 #region IStatefulItem members 98 78 public override void InitializeState() { 99 79 base.InitializeState(); 100 80 UpdateCounter.Value = 0; 101 PrunedSubtrees.Value = 0;102 PrunedTrees.Value = 0;103 81 } 104 82 public override void ClearState() { 105 83 base.ClearState(); 106 84 UpdateCounter.Value = 0; 107 PrunedSubtrees.Value = 0;108 PrunedTrees.Value = 0;109 85 } 110 86 #endregion … … 112 88 [StorableConstructor] 113 89 protected SymbolicDataAnalysisSingleObjectivePruningAnalyzer(bool deserializing) : base(deserializing) { } 114 [StorableHook(HookType.AfterDeserialization)]115 private void AfterDeserialization() {116 if (!Parameters.ContainsKey(FitnessCalculationPartitionParameterName))117 Parameters.Add(new LookupParameter<IntRange>(FitnessCalculationPartitionParameterName, ""));118 }119 90 protected SymbolicDataAnalysisSingleObjectivePruningAnalyzer(SymbolicDataAnalysisSingleObjectivePruningAnalyzer original, Cloner cloner) 120 91 : base(original, cloner) { 121 impactValuesCalculator = original.impactValuesCalculator; 92 if (original.prunedSubtreesReducer != null) 93 this.prunedSubtreesReducer = (DataReducer)original.prunedSubtreesReducer.Clone(); 94 if (original.prunedTreesReducer != null) 95 this.prunedTreesReducer = (DataReducer)original.prunedTreesReducer.Clone(); 96 if (original.valuesCollector != null) 97 this.valuesCollector = (DataTableValuesCollector)original.valuesCollector.Clone(); 98 if (original.resultsCollector != null) 99 this.resultsCollector = (ResultsCollector)original.resultsCollector.Clone(); 122 100 } 123 101 protected SymbolicDataAnalysisSingleObjectivePruningAnalyzer() { 102 #region add parameters 124 103 Parameters.Add(new ValueParameter<DoubleRange>(PopulationSliceParameterName, new DoubleRange(0.75, 1))); 125 104 Parameters.Add(new ValueParameter<DoubleValue>(PruningProbabilityParameterName, new DoubleValue(0.5))); 126 // analyzer parameters127 105 Parameters.Add(new ValueParameter<IntValue>(UpdateIntervalParameterName, "The interval in which the tree length analysis should be applied.", new IntValue(1))); 128 106 Parameters.Add(new ValueParameter<IntValue>(UpdateCounterParameterName, "The value which counts how many times the operator was called", new IntValue(0))); 129 107 Parameters.Add(new LookupParameter<IRandom>(RandomParameterName)); 130 108 Parameters.Add(new LookupParameter<IDataAnalysisProblemData>(ProblemDataParameterName)); 131 Parameters.Add(new LookupParameter<ISymbolicDataAnalysisExpressionTreeInterpreter>(InterpreterParameterName));132 133 Parameters.Add(new FixedValueParameter<DoubleValue>(NumberOfPrunedSubtreesParameterName, new DoubleValue(0)));134 Parameters.Add(new FixedValueParameter<DoubleValue>(NumberOfPrunedTreesParameterName, new DoubleValue(0)));135 Parameters.Add(new LookupParameter<DoubleLimit>(EstimationLimitsParameterName));136 109 Parameters.Add(new FixedValueParameter<DoubleValue>(NodeImpactThresholdParameterName, new DoubleValue(0.0))); 137 110 Parameters.Add(new FixedValueParameter<BoolValue>(PruneOnlyZeroImpactNodesParameterName, new BoolValue(false))); 138 Parameters.Add(new LookupParameter<IntRange>(FitnessCalculationPartitionParameterName, "")); 111 #endregion 112 } 113 114 private void InitializeOperators() { 115 prunedSubtreesReducer = new DataReducer(); 116 prunedSubtreesReducer.ParameterToReduce.ActualName = PruningOperator.PrunedSubtreesParameter.ActualName; 117 prunedSubtreesReducer.ReductionOperation.Value = new ReductionOperation(ReductionOperations.Sum); // sum all the pruned subtrees parameter values 118 prunedSubtreesReducer.TargetOperation.Value = new ReductionOperation(ReductionOperations.Assign); // asign the sum to the target parameter 119 prunedSubtreesReducer.TargetParameter.ActualName = TotalNumberOfPrunedSubtreesParameterName; 120 121 prunedTreesReducer = new DataReducer(); 122 prunedTreesReducer.ParameterToReduce.ActualName = PruningOperator.PrunedTreesParameter.ActualName; 123 prunedTreesReducer.ReductionOperation.Value = new ReductionOperation(ReductionOperations.Sum); 124 prunedTreesReducer.TargetOperation.Value = new ReductionOperation(ReductionOperations.Assign); 125 prunedTreesReducer.TargetParameter.ActualName = TotalNumberOfPrunedTreesParameterName; 126 127 valuesCollector = new DataTableValuesCollector(); 128 valuesCollector.CollectedValues.Add(new LookupParameter<IntValue>(TotalNumberOfPrunedSubtreesParameterName)); 129 valuesCollector.CollectedValues.Add(new LookupParameter<IntValue>(TotalNumberOfPrunedTreesParameterName)); 130 valuesCollector.DataTableParameter.ActualName = "Population pruning"; 131 132 resultsCollector = new ResultsCollector(); 133 resultsCollector.CollectedValues.Add(new LookupParameter<DataTable>("Population pruning")); 134 resultsCollector.ResultsParameter.ActualName = ResultsParameterName; 135 136 emptyOp = new EmptyOperator(); 137 } 138 139 // 140 /// <summary> 141 /// Computes the closed interval bounding the portion of the population that is to be pruned. 142 /// </summary> 143 /// <returns>Returns an int range [start, end]</returns> 144 private IntRange GetSliceBounds() { 145 var count = ExecutionContext.Scope.SubScopes.Count; 146 var start = (int)Math.Round(PopulationSlice.Start * count); 147 var end = (int)Math.Round(PopulationSlice.End * count); 148 if (end > count) end = count; 149 150 if (start >= end) throw new ArgumentOutOfRangeException("Invalid PopulationSlice bounds."); 151 return new IntRange(start, end); 152 } 153 154 private IOperation CreatePruningOperation() { 155 var oc = new OperationCollection { Parallel = true }; 156 var range = GetSliceBounds(); 157 var qualities = Quality.Select(x => x.Value).ToArray(); 158 var indices = Enumerable.Range(0, qualities.Length).ToArray(); 159 Array.Sort(qualities, indices); 160 if (!Maximization.Value) Array.Reverse(indices); 161 162 var subscopes = ExecutionContext.Scope.SubScopes; 163 164 for (int i = 0; i < subscopes.Count; ++i) { 165 IOperator op; 166 if (range.Start <= i && i < range.End && Random.NextDouble() <= PruningProbability.Value) 167 op = PruningOperator; 168 else op = emptyOp; 169 var index = indices[i]; 170 var subscope = subscopes[index]; 171 oc.Add(ExecutionContext.CreateChildOperation(op, subscope)); 172 } 173 return oc; 139 174 } 140 175 141 176 public override IOperation Apply() { 142 if (reentry) { 143 UpdateCounter.Value++; 177 UpdateCounter.Value++; 178 if (UpdateCounter.Value != UpdateInterval.Value) return base.Apply(); 179 UpdateCounter.Value = 0; 144 180 145 if (UpdateCounter.Value != UpdateInterval.Value) return base.Apply(); 146 UpdateCounter.Value = 0; 181 if (prunedSubtreesReducer == null || prunedTreesReducer == null || valuesCollector == null || resultsCollector == null) { InitializeOperators(); } 147 182 148 var trees = SymbolicExpressionTreeParameter.ActualValue.ToList(); 149 var qualities = QualityParameter.ActualValue.ToList(); 183 var prune = CreatePruningOperation(); 184 var reducePrunedSubtrees = ExecutionContext.CreateChildOperation(prunedSubtreesReducer); 185 var reducePrunedTrees = ExecutionContext.CreateChildOperation(prunedTreesReducer); 186 var collectValues = ExecutionContext.CreateChildOperation(valuesCollector); 187 var collectResults = ExecutionContext.CreateChildOperation(resultsCollector); 150 188 151 var population = trees.Zip(qualities, (tree, quality) => new { Tree = tree, Quality = quality }).ToList(); 152 Func<double, double, int> compare = (a, b) => Maximization.Value ? a.CompareTo(b) : b.CompareTo(a); 153 population.Sort((a, b) => compare(a.Quality.Value, b.Quality.Value)); 154 155 var start = (int)Math.Round(PopulationSlice.Start * trees.Count); 156 var end = (int)Math.Round(PopulationSlice.End * trees.Count); 157 158 if (end == population.Count) end--; 159 160 if (start >= end || end >= population.Count) throw new Exception("Invalid PopulationSlice bounds."); 161 162 PrunedSubtrees.Value = 0; 163 PrunedTrees.Value = 0; 164 165 reentry = false; 166 167 var operations = new OperationCollection { Parallel = true }; 168 foreach (var p in population.Skip(start).Take(end)) { 169 if (Random.NextDouble() > PruningProbability.Value) continue; 170 var op = new SymbolicDataAnalysisExpressionPruningOperator { 171 Model = CreateModel(p.Tree, Interpreter, EstimationLimits.Lower, EstimationLimits.Upper), 172 ImpactsCalculator = impactValuesCalculator, 173 ProblemData = ProblemData, 174 Random = Random, 175 PruneOnlyZeroImpactNodes = PruneOnlyZeroImpactNodes.Value, 176 NodeImpactThreshold = NodeImpactThreshold.Value, 177 FitnessCalculationPartition = FitnessCalculationPartition 178 }; 179 operations.Add(ExecutionContext.CreateChildOperation(op, ExecutionContext.Scope)); 180 } 181 return new OperationCollection { operations, ExecutionContext.CreateOperation(this) }; 182 } 183 184 DataTable table; 185 186 if (ResultCollection.ContainsKey("Population Pruning")) { 187 table = (DataTable)ResultCollection["Population Pruning"].Value; 188 } else { 189 table = new DataTable("Population Pruning"); 190 table.Rows.Add(new DataRow("Pruned Trees") { VisualProperties = { StartIndexZero = true } }); 191 table.Rows.Add(new DataRow("Pruned Subtrees") { VisualProperties = { StartIndexZero = true } }); 192 ResultCollection.Add(new Result("Population Pruning", table)); 193 } 194 195 table.Rows["Pruned Trees"].Values.Add(PrunedTrees.Value); 196 table.Rows["Pruned Subtrees"].Values.Add(PrunedSubtrees.Value); 197 198 reentry = true; 199 200 return base.Apply(); 189 return new OperationCollection { prune, reducePrunedSubtrees, reducePrunedTrees, collectValues, collectResults, base.Apply() }; 201 190 } 202 203 protected abstract ISymbolicDataAnalysisModel CreateModel(ISymbolicExpressionTree tree, ISymbolicDataAnalysisExpressionTreeInterpreter interpreter,204 double lowerEstimationLimit = double.MinValue, double upperEstimationLimit = double.MaxValue);205 191 } 206 192 } -
branches/Sliding Window GP/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Analyzers/SymbolicDataAnalysisSingleObjectiveTrainingBestSolutionAnalyzer.cs
r9708 r10681 35 35 [Item("SymbolicDataAnalysisSingleObjectiveTrainingBestSolutionAnalyzer", "An operator that analyzes the training best symbolic data analysis solution for single objective symbolic data analysis problems.")] 36 36 [StorableClass] 37 public abstract class SymbolicDataAnalysisSingleObjectiveTrainingBestSolutionAnalyzer<T> : SymbolicDataAnalysisSingleObjectiveAnalyzer 37 public abstract class SymbolicDataAnalysisSingleObjectiveTrainingBestSolutionAnalyzer<T> : SymbolicDataAnalysisSingleObjectiveAnalyzer, IIterationBasedOperator 38 38 39 where T : class, ISymbolicDataAnalysisSolution { 39 40 private const string TrainingBestSolutionParameterName = "Best training solution"; 40 41 private const string TrainingBestSolutionQualityParameterName = "Best training solution quality"; 42 private const string TrainingBestSolutionGenerationParameterName = "Best training solution generation"; 41 43 private const string UpdateAlwaysParameterName = "Always update best solution"; 44 private const string IterationsParameterName = "Iterations"; 45 private const string MaximumIterationsParameterName = "Maximum Iterations"; 42 46 43 47 #region parameter properties … … 48 52 get { return (ILookupParameter<DoubleValue>)Parameters[TrainingBestSolutionQualityParameterName]; } 49 53 } 54 public ILookupParameter<IntValue> TrainingBestSolutionGenerationParameter { 55 get { return (ILookupParameter<IntValue>)Parameters[TrainingBestSolutionGenerationParameterName]; } 56 } 50 57 public IFixedValueParameter<BoolValue> UpdateAlwaysParameter { 51 58 get { return (IFixedValueParameter<BoolValue>)Parameters[UpdateAlwaysParameterName]; } 59 } 60 public ILookupParameter<IntValue> IterationsParameter { 61 get { return (ILookupParameter<IntValue>)Parameters[IterationsParameterName]; } 62 } 63 public IValueLookupParameter<IntValue> MaximumIterationsParameter { 64 get { return (IValueLookupParameter<IntValue>)Parameters[MaximumIterationsParameterName]; } 52 65 } 53 66 #endregion … … 73 86 Parameters.Add(new LookupParameter<T>(TrainingBestSolutionParameterName, "The training best symbolic data analyis solution.")); 74 87 Parameters.Add(new LookupParameter<DoubleValue>(TrainingBestSolutionQualityParameterName, "The quality of the training best symbolic data analysis solution.")); 88 Parameters.Add(new LookupParameter<IntValue>(TrainingBestSolutionGenerationParameterName, "The generation in which the best training solution was found.")); 75 89 Parameters.Add(new FixedValueParameter<BoolValue>(UpdateAlwaysParameterName, "Determines if the best training solution should always be updated regardless of its quality.", new BoolValue(false))); 90 Parameters.Add(new LookupParameter<IntValue>(IterationsParameterName, "The number of performed iterations.")); 91 Parameters.Add(new ValueLookupParameter<IntValue>(MaximumIterationsParameterName, "The maximum number of performed iterations.") { Hidden = true }); 76 92 UpdateAlwaysParameter.Hidden = true; 77 93 } … … 83 99 UpdateAlwaysParameter.Hidden = true; 84 100 } 101 if (!Parameters.ContainsKey(TrainingBestSolutionGenerationParameterName)) 102 Parameters.Add(new LookupParameter<IntValue>(TrainingBestSolutionGenerationParameterName, "The generation in which the best training solution was found.")); 103 if (!Parameters.ContainsKey(IterationsParameterName)) 104 Parameters.Add(new LookupParameter<IntValue>(IterationsParameterName, "The number of performed iterations.")); 105 if (!Parameters.ContainsKey(MaximumIterationsParameterName)) 106 Parameters.Add(new ValueLookupParameter<IntValue>(MaximumIterationsParameterName, "The maximum number of performed iterations.") { Hidden = true }); 85 107 } 86 108 … … 104 126 TrainingBestSolution = CreateSolution(bestTree, bestQuality); 105 127 TrainingBestSolutionQuality = new DoubleValue(bestQuality); 128 if (IterationsParameter.ActualValue != null) 129 TrainingBestSolutionGenerationParameter.ActualValue = new IntValue(IterationsParameter.ActualValue.Value); 106 130 107 131 if (!results.ContainsKey(TrainingBestSolutionParameter.Name)) { 108 132 results.Add(new Result(TrainingBestSolutionParameter.Name, TrainingBestSolutionParameter.Description, TrainingBestSolution)); 109 133 results.Add(new Result(TrainingBestSolutionQualityParameter.Name, TrainingBestSolutionQualityParameter.Description, TrainingBestSolutionQuality)); 134 if (TrainingBestSolutionGenerationParameter.ActualValue != null) 135 results.Add(new Result(TrainingBestSolutionGenerationParameter.Name, TrainingBestSolutionGenerationParameter.Description, TrainingBestSolutionGenerationParameter.ActualValue)); 110 136 } else { 111 137 results[TrainingBestSolutionParameter.Name].Value = TrainingBestSolution; 112 138 results[TrainingBestSolutionQualityParameter.Name].Value = TrainingBestSolutionQuality; 139 if (TrainingBestSolutionGenerationParameter.ActualValue != null) 140 results[TrainingBestSolutionGenerationParameter.Name].Value = TrainingBestSolutionGenerationParameter.ActualValue; 141 113 142 } 114 143 } -
branches/Sliding Window GP/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Analyzers/SymbolicDataAnalysisSingleObjectiveValidationBestSolutionAnalyzer.cs
r9708 r10681 37 37 [Item("SymbolicDataAnalysisSingleObjectiveValidationBestSolutionAnalyzer", "An operator that analyzes the validation best symbolic data analysis solution for single objective symbolic data analysis problems.")] 38 38 [StorableClass] 39 public abstract class SymbolicDataAnalysisSingleObjectiveValidationBestSolutionAnalyzer<S, T, U> : SymbolicDataAnalysisSingleObjectiveValidationAnalyzer<T, U> 39 public abstract class SymbolicDataAnalysisSingleObjectiveValidationBestSolutionAnalyzer<S, T, U> : SymbolicDataAnalysisSingleObjectiveValidationAnalyzer<T, U>, IIterationBasedOperator 40 40 where S : class, ISymbolicDataAnalysisSolution 41 41 where T : class, ISymbolicDataAnalysisSingleObjectiveEvaluator<U> … … 43 43 private const string ValidationBestSolutionParameterName = "Best validation solution"; 44 44 private const string ValidationBestSolutionQualityParameterName = "Best validation solution quality"; 45 private const string ValidationBestSolutionGenerationParameterName = "Best validation solution generation"; 45 46 private const string UpdateAlwaysParameterName = "Always update best solution"; 47 private const string IterationsParameterName = "Iterations"; 48 private const string MaximumIterationsParameterName = "Maximum Iterations"; 46 49 47 50 #region parameter properties … … 52 55 get { return (ILookupParameter<DoubleValue>)Parameters[ValidationBestSolutionQualityParameterName]; } 53 56 } 57 public ILookupParameter<IntValue> ValidationBestSolutionGenerationParameter { 58 get { return (ILookupParameter<IntValue>)Parameters[ValidationBestSolutionGenerationParameterName]; } 59 } 54 60 public IFixedValueParameter<BoolValue> UpdateAlwaysParameter { 55 61 get { return (IFixedValueParameter<BoolValue>)Parameters[UpdateAlwaysParameterName]; } 62 } 63 public ILookupParameter<IntValue> IterationsParameter { 64 get { return (ILookupParameter<IntValue>)Parameters[IterationsParameterName]; } 65 } 66 public IValueLookupParameter<IntValue> MaximumIterationsParameter { 67 get { return (IValueLookupParameter<IntValue>)Parameters[MaximumIterationsParameterName]; } 56 68 } 57 69 #endregion … … 77 89 Parameters.Add(new LookupParameter<S>(ValidationBestSolutionParameterName, "The validation best symbolic data analyis solution.")); 78 90 Parameters.Add(new LookupParameter<DoubleValue>(ValidationBestSolutionQualityParameterName, "The quality of the validation best symbolic data analysis solution.")); 91 Parameters.Add(new LookupParameter<IntValue>(ValidationBestSolutionGenerationParameterName, "The generation in which the best validation solution was found.")); 79 92 Parameters.Add(new FixedValueParameter<BoolValue>(UpdateAlwaysParameterName, "Determines if the best validation solution should always be updated regardless of its quality.", new BoolValue(false))); 93 Parameters.Add(new LookupParameter<IntValue>(IterationsParameterName, "The number of performed iterations.")); 94 Parameters.Add(new ValueLookupParameter<IntValue>(MaximumIterationsParameterName, "The maximum number of performed iterations.") { Hidden = true }); 80 95 UpdateAlwaysParameter.Hidden = true; 81 96 } … … 84 99 private void AfterDeserialization() { 85 100 if (!Parameters.ContainsKey(UpdateAlwaysParameterName)) { 86 Parameters.Add(new FixedValueParameter<BoolValue>(UpdateAlwaysParameterName, "Determines if the best trainingsolution should always be updated regardless of its quality.", new BoolValue(false)));101 Parameters.Add(new FixedValueParameter<BoolValue>(UpdateAlwaysParameterName, "Determines if the best validation solution should always be updated regardless of its quality.", new BoolValue(false))); 87 102 UpdateAlwaysParameter.Hidden = true; 88 103 } 104 if (!Parameters.ContainsKey(ValidationBestSolutionGenerationParameterName)) 105 Parameters.Add(new LookupParameter<IntValue>(ValidationBestSolutionGenerationParameterName, "The generation in which the best validation solution was found.")); 106 if (!Parameters.ContainsKey(IterationsParameterName)) 107 Parameters.Add(new LookupParameter<IntValue>(IterationsParameterName, "The number of performed iterations.")); 108 if (!Parameters.ContainsKey(MaximumIterationsParameterName)) 109 Parameters.Add(new ValueLookupParameter<IntValue>(MaximumIterationsParameterName, "The maximum number of performed iterations.") { Hidden = true }); 89 110 } 90 111 … … 121 142 var quality = tree 122 143 .Take(topN) 123 .AsParallel()124 144 .Select(t => evaluator.Evaluate(childContext, t, problemData, rows)) 125 145 .ToArray(); … … 138 158 ValidationBestSolution = CreateSolution(bestTree, bestValidationQuality); 139 159 ValidationBestSolutionQuality = new DoubleValue(bestValidationQuality); 160 if (IterationsParameter.ActualValue != null) 161 ValidationBestSolutionGenerationParameter.ActualValue = new IntValue(IterationsParameter.ActualValue.Value); 140 162 141 163 if (!results.ContainsKey(ValidationBestSolutionParameter.Name)) { 142 164 results.Add(new Result(ValidationBestSolutionParameter.Name, ValidationBestSolutionParameter.Description, ValidationBestSolution)); 143 165 results.Add(new Result(ValidationBestSolutionQualityParameter.Name, ValidationBestSolutionQualityParameter.Description, ValidationBestSolutionQuality)); 166 if (ValidationBestSolutionGenerationParameter.ActualValue != null) 167 results.Add(new Result(ValidationBestSolutionGenerationParameter.Name, ValidationBestSolutionGenerationParameter.Description, ValidationBestSolutionGenerationParameter.ActualValue)); 144 168 } else { 145 169 results[ValidationBestSolutionParameter.Name].Value = ValidationBestSolution; 146 170 results[ValidationBestSolutionQualityParameter.Name].Value = ValidationBestSolutionQuality; 171 if (ValidationBestSolutionGenerationParameter.ActualValue != null) 172 results[ValidationBestSolutionGenerationParameter.Name].Value = ValidationBestSolutionGenerationParameter.ActualValue; 147 173 } 148 174 } -
branches/Sliding Window GP/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Analyzers/SymbolicDataAnalysisSingleObjectiveValidationParetoBestSolutionAnalyzer.cs
r9708 r10681 120 120 .Select(i => tree[i]) 121 121 .Take(topN) 122 .AsParallel()123 122 .Select(t => evaluator.Evaluate(childContext, t, problemData, rows)) 124 123 .ToArray(); -
branches/Sliding Window GP/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Analyzers/SymbolicDataAnalysisVariableFrequencyAnalyzer.cs
r9708 r10681 131 131 132 132 var variableFrequencies = trees 133 .AsParallel()134 133 .SelectMany(t => GetVariableReferences(t, aggregateLaggedVariables)) 135 134 .GroupBy(pair => pair.Key, pair => pair.Value) -
branches/Sliding Window GP/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/HeuristicLab.Problems.DataAnalysis.Symbolic-3.4.csproj
r10403 r10681 125 125 <HintPath>..\..\..\..\trunk\sources\bin\HeuristicLab.Optimization-3.3.dll</HintPath> 126 126 </Reference> 127 <Reference Include="HeuristicLab.Optimization.Operators-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL"> 128 <SpecificVersion>False</SpecificVersion> 129 <HintPath>..\..\..\..\trunk\sources\bin\HeuristicLab.Optimization.Operators-3.3.dll</HintPath> 130 <Private>False</Private> 131 </Reference> 127 132 <Reference Include="HeuristicLab.Parameters-3.3"> 128 133 <HintPath>..\..\..\..\trunk\sources\bin\HeuristicLab.Parameters-3.3.dll</HintPath> … … 177 182 <SubType>Code</SubType> 178 183 </Compile> 184 <Compile Include="Matching\SymbolicExpressionTreeCanonicalSorter.cs" /> 185 <Compile Include="Matching\SymbolicExpressionTreeEqualityComparer.cs" /> 186 <Compile Include="Matching\SymbolicExpressionTreeMatching.cs" /> 187 <Compile Include="Matching\SymbolicExpressionTreeMaxCommonSequenceCalculator.cs" /> 188 <Compile Include="Matching\SymbolicExpressionTreeNodeComparer.cs" /> 189 <Compile Include="Matching\SymbolicExpressionTreeNodeSimilarityComparer.cs" /> 179 190 <Compile Include="Analyzers\SymbolicDataAnalysisVariableFrequencyAnalyzer.cs" /> 180 191 <Compile Include="Analyzers\SymbolicDataAnalysisAlleleFrequencyAnalyzer.cs" /> -
branches/Sliding Window GP/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Interfaces/ISymbolicDataAnalysisImpactValuesCalculator.cs
r9126 r10681 1 1 using System.Collections.Generic; 2 using HeuristicLab.Core; 2 3 using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding; 3 4 4 5 namespace HeuristicLab.Problems.DataAnalysis.Symbolic { 5 public interface ISymbolicDataAnalysisSolutionImpactValuesCalculator {6 public interface ISymbolicDataAnalysisSolutionImpactValuesCalculator : IItem { 6 7 double CalculateReplacementValue(ISymbolicDataAnalysisModel model, ISymbolicExpressionTreeNode node, IDataAnalysisProblemData problemData, IEnumerable<int> rows); 7 8 double CalculateImpactValue(ISymbolicDataAnalysisModel model, ISymbolicExpressionTreeNode node, IDataAnalysisProblemData problemData, IEnumerable<int> rows, double originalQuality = double.NaN); 9 void CalculateImpactAndReplacementValues(ISymbolicDataAnalysisModel model, ISymbolicExpressionTreeNode node, IDataAnalysisProblemData problemData, 10 IEnumerable<int> rows, out double impactValue, out double replacementValue, double originalQuality = double.NaN); 8 11 } 9 12 } -
branches/Sliding Window GP/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Plugin.cs.frame
r10364 r10681 38 38 [PluginDependency("HeuristicLab.Operators", "3.3")] 39 39 [PluginDependency("HeuristicLab.Optimization", "3.3")] 40 [PluginDependency("HeuristicLab.Optimization.Operators", "3.3")] 40 41 [PluginDependency("HeuristicLab.Parameters", "3.3")] 41 42 [PluginDependency("HeuristicLab.Persistence", "3.3")] -
branches/Sliding Window GP/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/SymbolicDataAnalysisExpressionPruningOperator.cs
r10429 r10681 34 34 [StorableClass] 35 35 [Item("SymbolicExpressionTreePruningOperator", "An operator that replaces introns with constant values in a symbolic expression tree.")] 36 public class SymbolicDataAnalysisExpressionPruningOperator : SingleSuccessorOperator { 37 private const string NumberOfPrunedSubtreesParameterName = "PrunedSubtrees"; 38 private const string NumberOfPrunedTreesParameterName = "PrunedTrees"; 36 public abstract class SymbolicDataAnalysisExpressionPruningOperator : SingleSuccessorOperator { 37 #region parameter names 38 private const string ProblemDataParameterName = "ProblemData"; 39 private const string SymbolicDataAnalysisModelParameterName = "SymbolicDataAnalysisModel"; 40 private const string ImpactValuesCalculatorParameterName = "ImpactValuesCalculator"; 41 private const string PrunedSubtreesParameterName = "PrunedSubtrees"; 42 private const string PrunedTreesParameterName = "PrunedTrees"; 43 private const string FitnessCalculationPartitionParameterName = "FitnessCalculationPartition"; 44 private const string NodeImpactThresholdParameterName = "ImpactThreshold"; 45 private const string PruneOnlyZeroImpactNodesParameterName = "PruneOnlyZeroImpactNodes"; 46 private const string SymbolicExpressionTreeParameterName = "SymbolicExpressionTree"; // the tree to be pruned 47 private const string QualityParameterName = "Quality"; // the quality 48 private const string EstimationLimitsParameterName = "EstimationLimits"; 49 private const string InterpreterParameterName = "SymbolicExpressionTreeInterpreter"; 50 #endregion 51 39 52 #region parameter properties 40 public ILookupParameter< DoubleValue> NumberOfPrunedSubtreesParameter {41 get { return (ILookupParameter< DoubleValue>)Parameters[NumberOfPrunedSubtreesParameterName]; }53 public ILookupParameter<ISymbolicExpressionTree> SymbolicExpressionTreeParameter { 54 get { return (ILookupParameter<ISymbolicExpressionTree>)Parameters[SymbolicExpressionTreeParameterName]; } 42 55 } 43 public ILookupParameter<DoubleValue> NumberOfPrunedTreesParameter { 44 get { return (ILookupParameter<DoubleValue>)Parameters[NumberOfPrunedTreesParameterName]; } 56 public ILookupParameter<DoubleValue> QualityParameter { 57 get { return (ILookupParameter<DoubleValue>)Parameters[QualityParameterName]; } 58 } 59 public ILookupParameter<IDataAnalysisProblemData> ProblemDataParameter { 60 get { return (ILookupParameter<IDataAnalysisProblemData>)Parameters[ProblemDataParameterName]; } 61 } 62 public IValueParameter<ISymbolicDataAnalysisSolutionImpactValuesCalculator> ImpactValuesCalculatorParameter { 63 get { return (IValueParameter<ISymbolicDataAnalysisSolutionImpactValuesCalculator>)Parameters[ImpactValuesCalculatorParameterName]; } 64 } 65 public ILookupParameter<IntRange> FitnessCalculationPartitionParameter { 66 get { return (ILookupParameter<IntRange>)Parameters[FitnessCalculationPartitionParameterName]; } 67 } 68 public ILookupParameter<IntValue> PrunedSubtreesParameter { 69 get { return (ILookupParameter<IntValue>)Parameters[PrunedSubtreesParameterName]; } 70 } 71 public ILookupParameter<IntValue> PrunedTreesParameter { 72 get { return (ILookupParameter<IntValue>)Parameters[PrunedTreesParameterName]; } 73 } 74 public IFixedValueParameter<DoubleValue> NodeImpactThresholdParameter { 75 get { return (IFixedValueParameter<DoubleValue>)Parameters[NodeImpactThresholdParameterName]; } 76 } 77 public IFixedValueParameter<BoolValue> PruneOnlyZeroImpactNodesParameter { 78 get { return (IFixedValueParameter<BoolValue>)Parameters[PruneOnlyZeroImpactNodesParameterName]; } 79 } 80 public ILookupParameter<DoubleLimit> EstimationLimitsParameter { 81 get { return (ILookupParameter<DoubleLimit>)Parameters[EstimationLimitsParameterName]; } 82 } 83 public ILookupParameter<ISymbolicDataAnalysisExpressionTreeInterpreter> InterpreterParameter { 84 get { return (ILookupParameter<ISymbolicDataAnalysisExpressionTreeInterpreter>)Parameters[InterpreterParameterName]; } 45 85 } 46 86 #endregion 47 87 #region properties 48 private DoubleValue PrunedSubtrees { get { return NumberOfPrunedSubtreesParameter.ActualValue; } } 49 private DoubleValue PrunedTrees { get { return NumberOfPrunedTreesParameter.ActualValue; } } 88 protected IDataAnalysisProblemData ProblemData { get { return ProblemDataParameter.ActualValue; } } 89 protected ISymbolicDataAnalysisSolutionImpactValuesCalculator ImpactValuesCalculator { get { return ImpactValuesCalculatorParameter.Value; } } 90 protected IntRange FitnessCalculationPartition { get { return FitnessCalculationPartitionParameter.ActualValue; } } 91 protected BoolValue PruneOnlyZeroImpactNodes { get { return PruneOnlyZeroImpactNodesParameter.Value; } } 92 protected DoubleValue NodeImpactThreshold { get { return NodeImpactThresholdParameter.Value; } } 93 protected ISymbolicExpressionTree SymbolicExpressionTree { get { return SymbolicExpressionTreeParameter.ActualValue; } } 94 protected DoubleValue Quality { get { return QualityParameter.ActualValue; } } 95 protected DoubleLimit EstimationLimits { get { return EstimationLimitsParameter.ActualValue; } } 96 protected ISymbolicDataAnalysisExpressionTreeInterpreter Interpreter { get { return InterpreterParameter.ActualValue; } } 50 97 #endregion 51 98 52 99 [StorableConstructor] 53 100 protected SymbolicDataAnalysisExpressionPruningOperator(bool deserializing) : base(deserializing) { } 54 public override IDeepCloneable Clone(Cloner cloner) { 55 return new SymbolicDataAnalysisExpressionPruningOperator(this, cloner); 101 protected SymbolicDataAnalysisExpressionPruningOperator(SymbolicDataAnalysisExpressionPruningOperator original, Cloner cloner) 102 : base(original, cloner) { } 103 104 protected SymbolicDataAnalysisExpressionPruningOperator() { 105 #region add parameters 106 Parameters.Add(new LookupParameter<IDataAnalysisProblemData>(ProblemDataParameterName)); 107 Parameters.Add(new LookupParameter<ISymbolicDataAnalysisModel>(SymbolicDataAnalysisModelParameterName)); 108 Parameters.Add(new LookupParameter<IntRange>(FitnessCalculationPartitionParameterName)); 109 Parameters.Add(new LookupParameter<IntValue>(PrunedSubtreesParameterName, "A counter of how many subtrees were replaced.")); 110 Parameters.Add(new LookupParameter<IntValue>(PrunedTreesParameterName, "A counter of how many trees were pruned.")); 111 Parameters.Add(new FixedValueParameter<BoolValue>(PruneOnlyZeroImpactNodesParameterName, "Specify whether or not only zero impact nodes should be pruned.")); 112 Parameters.Add(new FixedValueParameter<DoubleValue>(NodeImpactThresholdParameterName, "Specifies an impact value threshold below which nodes should be pruned.")); 113 Parameters.Add(new LookupParameter<DoubleLimit>(EstimationLimitsParameterName)); 114 Parameters.Add(new LookupParameter<ISymbolicDataAnalysisExpressionTreeInterpreter>(InterpreterParameterName)); 115 Parameters.Add(new LookupParameter<ISymbolicExpressionTree>(SymbolicExpressionTreeParameterName)); 116 Parameters.Add(new LookupParameter<DoubleValue>(QualityParameterName)); 117 #endregion 56 118 } 57 protected SymbolicDataAnalysisExpressionPruningOperator(SymbolicDataAnalysisExpressionPruningOperator original, Cloner cloner)58 : base(original, cloner) {59 }60 61 public SymbolicDataAnalysisExpressionPruningOperator() {62 Parameters.Add(new LookupParameter<DoubleValue>(NumberOfPrunedSubtreesParameterName));63 Parameters.Add(new LookupParameter<DoubleValue>(NumberOfPrunedTreesParameterName));64 }65 66 public ISymbolicDataAnalysisModel Model { get; set; }67 public IDataAnalysisProblemData ProblemData { get; set; }68 public ISymbolicDataAnalysisSolutionImpactValuesCalculator ImpactsCalculator { get; set; }69 70 public IntRange FitnessCalculationPartition { get; set; }71 public IRandom Random { get; set; }72 73 public bool PruneOnlyZeroImpactNodes { get; set; }74 public double NodeImpactThreshold { get; set; }75 76 119 public override IOperation Apply() { 77 int prunedSubtrees = 0; 78 79 var nodes = Model.SymbolicExpressionTree.Root.GetSubtree(0).GetSubtree(0).IterateNodesPrefix().ToList(); 120 var model = CreateModel(); 121 var nodes = SymbolicExpressionTree.Root.GetSubtree(0).GetSubtree(0).IterateNodesPrefix().ToList(); 80 122 var rows = Enumerable.Range(FitnessCalculationPartition.Start, FitnessCalculationPartition.Size).ToList(); 81 123 82 for (int j = 0; j < nodes.Count; ++j) { 83 var node = nodes[j]; 124 var prunedSubtrees = 0; 125 var prunedTrees = 0; 126 127 double quality = Evaluate(model); 128 129 for (int i = 0; i < nodes.Count; ++i) { 130 var node = nodes[i]; 84 131 if (node is ConstantTreeNode) continue; 85 132 86 var impact = ImpactsCalculator.CalculateImpactValue(Model, node, ProblemData, rows); 133 double impactValue, replacementValue; 134 ImpactValuesCalculator.CalculateImpactAndReplacementValues(model, node, ProblemData, rows, out impactValue, out replacementValue, quality); 87 135 88 if (PruneOnlyZeroImpactNodes) { 89 if (!impact.IsAlmost(0.0)) continue; 90 } else { 91 if (NodeImpactThreshold < impact) continue; 92 } 136 if (PruneOnlyZeroImpactNodes.Value && (!impactValue.IsAlmost(0.0))) continue; 137 else if (NodeImpactThreshold.Value < impactValue) continue; 93 138 94 var replacementValue = ImpactsCalculator.CalculateReplacementValue(Model, node, ProblemData, rows);95 139 var constantNode = new ConstantTreeNode(new Constant()) { Value = replacementValue }; 96 140 ReplaceWithConstant(node, constantNode); 97 j += node.GetLength() - 1; // skip subtrees under the node that was folded 141 i += node.GetLength() - 1; // skip subtrees under the node that was folded 142 143 quality -= impactValue; 98 144 99 145 prunedSubtrees++; 100 146 } 101 147 102 if (prunedSubtrees > 0) {103 lock (PrunedSubtrees) { PrunedSubtrees.Value += prunedSubtrees; }104 lock (PrunedTrees) { PrunedTrees.Value += 1; }105 } 148 if (prunedSubtrees > 0) prunedTrees = 1; 149 PrunedSubtreesParameter.ActualValue = new IntValue(prunedSubtrees); 150 PrunedTreesParameter.ActualValue = new IntValue(prunedTrees); 151 106 152 return base.Apply(); 107 153 } … … 112 158 parent.InsertSubtree(i, replacement); 113 159 } 160 protected abstract ISymbolicDataAnalysisModel CreateModel(); 161 protected abstract double Evaluate(IDataAnalysisModel model); 114 162 } 115 163 } -
branches/Sliding Window GP/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/SymbolicDataAnalysisSolutionImpactValuesCalculator.cs
r9708 r10681 22 22 using System.Collections.Generic; 23 23 using HeuristicLab.Common; 24 using HeuristicLab.Core; 24 25 using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding; 26 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 25 27 26 28 namespace HeuristicLab.Problems.DataAnalysis.Symbolic { 27 public abstract class SymbolicDataAnalysisSolutionImpactValuesCalculator : ISymbolicDataAnalysisSolutionImpactValuesCalculator { 29 [StorableClass] 30 [Item("SymbolicDataAnalysisSolutionImpactValuesCalculator", "Calculates the impact values and replacements values for symbolic expression tree nodes.")] 31 public abstract class SymbolicDataAnalysisSolutionImpactValuesCalculator : Item, ISymbolicDataAnalysisSolutionImpactValuesCalculator { 32 protected SymbolicDataAnalysisSolutionImpactValuesCalculator() { } 33 34 protected SymbolicDataAnalysisSolutionImpactValuesCalculator(SymbolicDataAnalysisSolutionImpactValuesCalculator original, Cloner cloner) 35 : base(original, cloner) { } 36 [StorableConstructor] 37 protected SymbolicDataAnalysisSolutionImpactValuesCalculator(bool deserializing) : base(deserializing) { } 28 38 public abstract double CalculateReplacementValue(ISymbolicDataAnalysisModel model, ISymbolicExpressionTreeNode node, IDataAnalysisProblemData problemData, IEnumerable<int> rows); 29 39 public abstract double CalculateImpactValue(ISymbolicDataAnalysisModel model, ISymbolicExpressionTreeNode node, IDataAnalysisProblemData problemData, IEnumerable<int> rows, double originalQuality = double.NaN); 40 public abstract void CalculateImpactAndReplacementValues(ISymbolicDataAnalysisModel model, ISymbolicExpressionTreeNode node, IDataAnalysisProblemData problemData, IEnumerable<int> rows, out double impactValue, out double replacementValue, double originalQuality = double.NaN); 30 41 31 42 protected static double CalculateReplacementValue(ISymbolicExpressionTreeNode node, ISymbolicExpressionTree sourceTree, ISymbolicDataAnalysisExpressionTreeInterpreter interpreter,
Note: See TracChangeset
for help on using the changeset viewer.