Changeset 16303 for branches/2956_apriori_knowledge
- Timestamp:
- 11/16/18 11:55:13 (6 years ago)
- Location:
- branches/2956_apriori_knowledge
- Files:
-
- 19 added
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/2956_apriori_knowledge/HeuristicLab 3.3.sln
r15682 r16303 2 2 Microsoft Visual Studio Solution File, Format Version 12.00 3 3 # Visual Studio 15 4 VisualStudioVersion = 15.0.26 730.164 VisualStudioVersion = 15.0.26403.7 5 5 MinimumVisualStudioVersion = 10.0.40219.1 6 6 Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{96396439-A764-4022-A8D2-BE021449B8D1}" … … 462 462 EndProject 463 463 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "HeuristicLab.Algorithms.MOCMAEvolutionStrategy-3.3", "HeuristicLab.Algorithms.MOCMAEvolutionStrategy\3.3\HeuristicLab.Algorithms.MOCMAEvolutionStrategy-3.3.csproj", "{0E2E224F-E9B2-41F3-B510-09183EEBA2AF}" 464 EndProject 465 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "HeuristicLab.Algorithms.DataAnalysis.KnowledgeIntegration", "HeuristicLab.Algorithms.DataAnalysis.KnowledgeIntegration\3.4\HeuristicLab.Algorithms.DataAnalysis.KnowledgeIntegration-3.4.csproj", "{5E8B5347-4281-4D89-92E5-8D81E297BBCA}" 464 466 EndProject 465 467 Global … … 2249 2251 {0E2E224F-E9B2-41F3-B510-09183EEBA2AF}.Release|x86.ActiveCfg = Release|x86 2250 2252 {0E2E224F-E9B2-41F3-B510-09183EEBA2AF}.Release|x86.Build.0 = Release|x86 2253 {5E8B5347-4281-4D89-92E5-8D81E297BBCA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 2254 {5E8B5347-4281-4D89-92E5-8D81E297BBCA}.Debug|Any CPU.Build.0 = Debug|Any CPU 2255 {5E8B5347-4281-4D89-92E5-8D81E297BBCA}.Debug|x64.ActiveCfg = Debug|Any CPU 2256 {5E8B5347-4281-4D89-92E5-8D81E297BBCA}.Debug|x64.Build.0 = Debug|Any CPU 2257 {5E8B5347-4281-4D89-92E5-8D81E297BBCA}.Debug|x86.ActiveCfg = Debug|Any CPU 2258 {5E8B5347-4281-4D89-92E5-8D81E297BBCA}.Debug|x86.Build.0 = Debug|Any CPU 2259 {5E8B5347-4281-4D89-92E5-8D81E297BBCA}.Release|Any CPU.ActiveCfg = Release|Any CPU 2260 {5E8B5347-4281-4D89-92E5-8D81E297BBCA}.Release|Any CPU.Build.0 = Release|Any CPU 2261 {5E8B5347-4281-4D89-92E5-8D81E297BBCA}.Release|x64.ActiveCfg = Release|Any CPU 2262 {5E8B5347-4281-4D89-92E5-8D81E297BBCA}.Release|x64.Build.0 = Release|Any CPU 2263 {5E8B5347-4281-4D89-92E5-8D81E297BBCA}.Release|x86.ActiveCfg = Release|Any CPU 2264 {5E8B5347-4281-4D89-92E5-8D81E297BBCA}.Release|x86.Build.0 = Release|Any CPU 2251 2265 EndGlobalSection 2252 2266 GlobalSection(SolutionProperties) = preSolution -
branches/2956_apriori_knowledge/HeuristicLab.Algorithms.DataAnalysis.Views/3.4/HeuristicLab.Algorithms.DataAnalysis.Views-3.4.csproj
r15124 r16303 353 353 </PreBuildEvent> 354 354 </PropertyGroup> 355 <PropertyGroup> 356 <PreBuildEvent>set Path=%25Path%25;$(ProjectDir);$(SolutionDir) 357 set ProjectDir=$(ProjectDir) 358 set SolutionDir=$(SolutionDir) 359 set Outdir=$(Outdir) 360 361 call PreBuildEvent.cmd 362 </PreBuildEvent> 363 </PropertyGroup> 355 364 <!-- To modify your build process, add your task inside one of the targets below and uncomment it. 356 365 Other similar extension points exist, see Microsoft.Common.targets. -
branches/2956_apriori_knowledge/HeuristicLab.Data.Views/3.3/HeuristicLab.Data.Views-3.3.csproj
r15009 r16303 177 177 <DependentUpon>StringConvertibleMatrixRowVisibilityDialog.cs</DependentUpon> 178 178 </Compile> 179 <Compile Include="StringIntervalView.cs"> 180 <SubType>UserControl</SubType> 181 </Compile> 182 <Compile Include="StringIntervalView.Designer.cs"> 183 <DependentUpon>StringIntervalView.cs</DependentUpon> 184 </Compile> 179 185 <Compile Include="StringConvertibleValueTupleView.cs"> 180 186 <SubType>UserControl</SubType> … … 272 278 <Name>HeuristicLab.PluginInfrastructure-3.3</Name> 273 279 <Private>False</Private> 280 </ProjectReference> 281 <ProjectReference Include="..\..\HeuristicLab.Problems.DataAnalysis\3.4\HeuristicLab.Problems.DataAnalysis-3.4.csproj"> 282 <Project>{DF87C13E-A889-46FF-8153-66DCAA8C5674}</Project> 283 <Name>HeuristicLab.Problems.DataAnalysis-3.4</Name> 274 284 </ProjectReference> 275 285 </ItemGroup> … … 290 300 <Install>true</Install> 291 301 </BootstrapperPackage> 302 </ItemGroup> 303 <ItemGroup> 304 <EmbeddedResource Include="StringIntervalView.resx"> 305 <DependentUpon>StringIntervalView.cs</DependentUpon> 306 </EmbeddedResource> 292 307 </ItemGroup> 293 308 <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> -
branches/2956_apriori_knowledge/HeuristicLab.Problems.DataAnalysis.Symbolic.Views/3.4/HeuristicLab.Problems.DataAnalysis.Symbolic.Views-3.4.csproj
r14255 r16303 206 206 </ItemGroup> 207 207 <ItemGroup> 208 <ProjectReference Include="..\..\HeuristicLab.Algorithms.DataAnalysis.KnowledgeIntegration\3.4\HeuristicLab.Algorithms.DataAnalysis.KnowledgeIntegration-3.4.csproj"> 209 <Project>{5e8b5347-4281-4d89-92e5-8d81e297bbca}</Project> 210 <Name>HeuristicLab.Algorithms.DataAnalysis.KnowledgeIntegration-3.4</Name> 211 </ProjectReference> 208 212 <ProjectReference Include="..\..\HeuristicLab.Collections\3.3\HeuristicLab.Collections-3.3.csproj"> 209 213 <Project>{958B43BC-CC5C-4FA2-8628-2B3B01D890B6}</Project> -
branches/2956_apriori_knowledge/HeuristicLab.Problems.DataAnalysis.Symbolic.Views/3.4/InteractiveSymbolicDataAnalysisSolutionSimplifierView.cs
r15583 r16303 26 26 using System.Threading.Tasks; 27 27 using System.Windows.Forms; 28 using HeuristicLab.Algorithms.DataAnalysis.KnowledgeIntegration.Interpreter; 29 using HeuristicLab.Algorithms.DataAnalysis.KnowledgeIntegration.IntervalArithmetic; 30 using HeuristicLab.Algorithms.DataAnalysis.KnowledgeIntegration.Util; 28 31 using HeuristicLab.Common; 29 32 using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding; … … 36 39 private Dictionary<ISymbolicExpressionTreeNode, ISymbolicExpressionTreeNode> foldedNodes; 37 40 private Dictionary<ISymbolicExpressionTreeNode, ISymbolicExpressionTreeNode> changedNodes; 41 //private Dictionary<ISymbolicExpressionTreeNode, Interval> intervals; 42 private Dictionary<ISymbolicExpressionTreeNode, Interval> intervals; 38 43 private Dictionary<ISymbolicExpressionTreeNode, double> nodeImpacts; 39 44 … … 50 55 changedNodes = new Dictionary<ISymbolicExpressionTreeNode, ISymbolicExpressionTreeNode>(); 51 56 nodeImpacts = new Dictionary<ISymbolicExpressionTreeNode, double>(); 57 //intervals = new Dictionary<ISymbolicExpressionTreeNode, Interval>(); 52 58 this.Caption = "Interactive Solution Simplifier"; 53 59 this.impactCalculator = impactCalculator; … … 185 191 progress.Start("Calculate Impact and Replacement Values ..."); 186 192 var impactAndReplacementValues = await Task.Run(() => CalculateImpactAndReplacementValues(tree)); 193 var interpreter = new SymbolicDataAnalysisIntervalArithmeticInterpreter(); 194 195 //var intervalParam = ((IRegressionProblemData)Content.ProblemData).IntervalVariable; 196 var customIntervals = new Dictionary<String, Interval>(); 197 var parser = new FormulationParser(); 198 //foreach (var ci in intervalParam) { 199 //var inter = parser.Parse(ci.Formulation.GetValue()); 200 //customIntervals.Add(ci.Variable.GetValue(), new Interval(0, 1)); 201 //} 202 var resultInterval = interpreter.GetSymbolicExressionTreeIntervals(tree, Content.ProblemData.Dataset, Content.ProblemData.TrainingIndices, out intervals); 187 203 await Task.Delay(500); // wait for progressbar to finish animation 188 204 var replacementValues = impactAndReplacementValues.ToDictionary(x => x.Key, x => x.Value.Item2); … … 190 206 foldedNodes[pair.Key] = MakeConstantTreeNode(pair.Value); 191 207 } 208 //Instruction currentInstr = instructions.NextInstruction(); 209 //while (instructions.HasNextInstruction()) { 210 // //intervals[currentInstr.dynamicNode] = (Interval)currentInstr.data; 211 // intervals.Add(Tuple.Create(currentInstr.dynamicNode, (Interval)currentInstr.data)); 212 // currentInstr = instructions.NextInstruction(); 213 //} 214 215 216 217 //intervals.Add(Tuple.Create(currentInstr.dynamicNode, (Interval)currentInstr.data)); 192 218 nodeImpacts = impactAndReplacementValues.ToDictionary(x => x.Key, x => x.Value.Item1); 193 219 progress.Finish(); 194 PaintNodeImpacts(); 220 PaintIntervals(); 221 //PaintNodeImpacts(); 195 222 } 196 223 … … 253 280 } 254 281 282 private void PaintIntervals() { 283 int node = 0; 284 var impacts = nodeImpacts.Values; 285 double max = impacts.Max(); 286 double min = impacts.Min(); 287 288 foreach (ISymbolicExpressionTreeNode treeNode in Content.Model.SymbolicExpressionTree.IterateNodesPrefix()) { 289 VisualTreeNode<ISymbolicExpressionTreeNode> visualTree = treeChart.GetVisualSymbolicExpressionTreeNode(treeNode); 290 291 if (visualTree != null) { 292 visualTree.ToolTip = visualTree.Content.ToString(); 293 //visualTree.ToolTip += String.Format($"{Environment.NewLine}Intervals: [{intervals[node].Item2.LowerBound:E4} ... {intervals[node].Item2.UpperBound:E4}]{Environment.NewLine}"); 294 visualTree.ToolTip += String.Format($"{Environment.NewLine}Intervals: [{intervals[treeNode].LowerBound:E4} ... {intervals[treeNode].UpperBound:E4}]{Environment.NewLine}]"); 295 node++; 296 297 if (!(treeNode is ConstantTreeNode) && nodeImpacts.ContainsKey(treeNode)) { 298 double impact = nodeImpacts[treeNode]; 299 300 // impact = 0 if no change 301 // impact < 0 if new solution is better 302 // impact > 0 if new solution is worse 303 if (impact < 0.0) { 304 visualTree.FillColor = Color.FromArgb((int)(impact / min * 255), Color.Red); 305 } else if (impact.IsAlmost(0.0)) { 306 visualTree.FillColor = Color.White; 307 } else { 308 // max is guaranteed to be > 0 309 visualTree.FillColor = Color.FromArgb((int)(impact / max * 255), Color.Green); 310 } 311 visualTree.ToolTip += String.Format($"{Environment.NewLine} Node impact: {impact:E4}"); 312 var constantReplacementNode = foldedNodes[treeNode] as ConstantTreeNode; 313 if (constantReplacementNode != null) { 314 visualTree.ToolTip += String.Format($"{Environment.NewLine} Replacement value: {constantReplacementNode.Value:E4}"); 315 } 316 } 317 if (changedNodes.ContainsKey(treeNode)) { 318 visualTree.LineColor = Color.DodgerBlue; 319 } else if (treeNode is ConstantTreeNode && foldedNodes.ContainsKey(treeNode)) { 320 visualTree.LineColor = Color.DarkOrange; 321 } 322 } 323 } 324 treeChart.RepaintNodes(); 325 } 326 255 327 private void PaintNodeImpacts() { 256 328 var impacts = nodeImpacts.Values; -
branches/2956_apriori_knowledge/HeuristicLab.Problems.DataAnalysis/3.4/HeuristicLab.Problems.DataAnalysis-3.4.csproj
r15638 r16303 176 176 <Compile Include="Interfaces\IDataset.cs" /> 177 177 <Compile Include="Interfaces\IDependencyCalculator.cs" /> 178 <Compile Include="Interfaces\IInterval.cs" /> 178 179 <Compile Include="Interfaces\ITransformation.cs" /> 179 180 <Compile Include="Interfaces\ITransformationMapper.cs" /> … … 190 191 <Compile Include="Interfaces\TimeSeriesPrognosis\ITimeSeriesPrognosisProblemData.cs" /> 191 192 <Compile Include="Interfaces\TimeSeriesPrognosis\ITimeSeriesPrognosisSolution.cs" /> 193 <Compile Include="IntervalItem.cs" /> 192 194 <Compile Include="ModifiableDataset.cs" /> 193 195 <Compile Include="OnlineCalculators\AutoCorrelationCalculator.cs" /> -
branches/2956_apriori_knowledge/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/Regression/RegressionProblemData.cs
r16244 r16303 34 34 public class RegressionProblemData : DataAnalysisProblemData, IRegressionProblemData, IStorableContent { 35 35 protected const string TargetVariableParameterName = "TargetVariable"; 36 protected const string VariableRangeParameterName = "VariableRanges"; 36 37 public string Filename { get; set; } 37 38 … … 91 92 problemData.Parameters.Add(new FixedValueParameter<IntRange>(TestPartitionParameterName, "", (IntRange)new IntRange(0, 0).AsReadOnly())); 92 93 problemData.Parameters.Add(new ConstrainedValueParameter<StringValue>(TargetVariableParameterName, new ItemSet<StringValue>())); 94 problemData.Parameters.Add(new OptionalValueParameter<DoubleMatrix>(VariableRangeParameterName, "")); 93 95 emptyProblemData = problemData; 94 96 } 95 97 #endregion 98 99 public OptionalValueParameter<DoubleMatrix> VariableRangeParameter { 100 get { return (OptionalValueParameter<DoubleMatrix>)Parameters[VariableRangeParameterName]; } 101 } 96 102 97 103 public IConstrainedValueParameter<StringValue> TargetVariableParameter { … … 120 126 } 121 127 128 public DoubleMatrix VariableRanges { 129 get { return VariableRangeParameter.Value; } 130 } 122 131 123 132 [StorableConstructor] … … 152 161 var variables = InputVariables.Select(x => x.AsReadOnly()).ToList(); 153 162 Parameters.Add(new ConstrainedValueParameter<StringValue>(TargetVariableParameterName, new ItemSet<StringValue>(variables), variables.Where(x => x.Value == targetVariable).First())); 163 164 DoubleMatrix variableRanges = new DoubleMatrix(variables.Count, 2, new string[] { "Lower Bound", "Upper Bound" }, variables.Select(x => x.Value)); 165 Parameters.Add(new FixedValueParameter<DoubleMatrix>(VariableRangeParameterName, variableRanges)); 166 167 int row = 0; 168 foreach (var variable in variables) { 169 IList<double> values = new List<double>(); 170 foreach (var value in dataset.GetReadOnlyDoubleValues(variable.Value)) { 171 values.Add(value); 172 } 173 variableRanges[row, 0] = values.Min(); 174 variableRanges[row, 1] = values.Max(); 175 ++row; 176 } 177 154 178 RegisterParameterEvents(); 155 179 } -
branches/2956_apriori_knowledge/HeuristicLab.Problems.DataAnalysis/3.4/Interfaces/Regression/IRegressionProblemData.cs
r15583 r16303 21 21 22 22 using System.Collections.Generic; 23 using HeuristicLab.Core; 24 using HeuristicLab.Data; 23 25 24 26 namespace HeuristicLab.Problems.DataAnalysis { 25 27 public interface IRegressionProblemData : IDataAnalysisProblemData { 26 28 string TargetVariable { get; set; } 29 DoubleMatrix VariableRanges { get; } 27 30 28 31 IEnumerable<double> TargetVariableValues { get; }
Note: See TracChangeset
for help on using the changeset viewer.