Changeset 3710
- Timestamp:
- 05/07/10 21:10:46 (15 years ago)
- Location:
- trunk/sources
- Files:
-
- 1 added
- 25 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Analysis/3.3/DataTable.cs
r3431 r3710 33 33 public sealed class DataTable : NamedItem { 34 34 public override Image ItemImage { 35 get { return HeuristicLab.Common.Resources.VS2008ImageLibrary. Table; }35 get { return HeuristicLab.Common.Resources.VS2008ImageLibrary.Performance.ToBitmap(); } 36 36 } 37 37 -
trunk/sources/HeuristicLab.Analysis/3.3/MinAverageMaxValueAnalyzer.cs
r3662 r3710 56 56 get { return (ValueLookupParameter<VariableCollection>)Parameters["Results"]; } 57 57 } 58 public ValueParameter<BoolValue> CollectMinValueInResultsParameter { 59 get { return (ValueParameter<BoolValue>)Parameters["CollectMinValueInResults"]; } 60 } 61 public ValueParameter<BoolValue> CollectMaxValueInResultsParameter { 62 get { return (ValueParameter<BoolValue>)Parameters["CollectMaxValueInResults"]; } 63 } 64 public ValueParameter<BoolValue> CollectAverageValueInResultsParameter { 65 get { return (ValueParameter<BoolValue>)Parameters["CollectAverageValueInResults"]; } 66 } 58 67 #endregion 59 68 … … 62 71 get { return (MinAverageMaxValueCalculator)OperatorGraph.InitialOperator; } 63 72 } 73 private BoolValue CollectMinValueInResults { 74 get { return CollectMinValueInResultsParameter.Value; } 75 } 76 private BoolValue CollectMaxValueInResults { 77 get { return CollectMaxValueInResultsParameter.Value; } 78 } 79 private BoolValue CollectAverageValueInResults { 80 get { return CollectAverageValueInResultsParameter.Value; } 81 } 64 82 #endregion 65 83 [Storable] 84 private ResultsCollector resultsCollector; 66 85 public MinAverageMaxValueAnalyzer() 67 86 : base() { … … 69 88 Parameters.Add(new ScopeTreeLookupParameter<DoubleValue>("Value", "The value contained in the scope tree which should be analyzed.")); 70 89 Parameters.Add(new ValueLookupParameter<DoubleValue>("MinValue", "The minimum of the value.")); 90 Parameters.Add(new ValueParameter<BoolValue>("CollectMinValueInResults", "Determines if the minimum of the value should also be stored in the results.", new BoolValue(true))); 71 91 Parameters.Add(new ValueLookupParameter<DoubleValue>("AverageValue", "The average of the value.")); 92 Parameters.Add(new ValueParameter<BoolValue>("CollectAverageValueInResults", "Determines if the average of the value should also be stored in the results.", new BoolValue(true))); 72 93 Parameters.Add(new ValueLookupParameter<DoubleValue>("MaxValue", "The maximum of the value.")); 94 Parameters.Add(new ValueParameter<BoolValue>("CollectMaxValueInResults", "Determines if the maximum of the value should also be stored in the results.", new BoolValue(true))); 73 95 Parameters.Add(new ValueLookupParameter<DataTable>("Values", "The data table to store the minimum, average and maximum of the value.")); 74 96 Parameters.Add(new ValueLookupParameter<VariableCollection>("Results", "The results collection where the analysis values should be stored.")); … … 78 100 MinAverageMaxValueCalculator minAverageMaxValueCalculator = new MinAverageMaxValueCalculator(); 79 101 DataTableValuesCollector dataTableValuesCollector = new DataTableValuesCollector(); 80 ResultsCollectorresultsCollector = new ResultsCollector();102 resultsCollector = new ResultsCollector(); 81 103 82 104 minAverageMaxValueCalculator.AverageValueParameter.ActualName = AverageValueParameter.Name; … … 91 113 dataTableValuesCollector.DataTableParameter.ActualName = ValuesParameter.Name; 92 114 93 resultsCollector.CollectedValues.Add(new LookupParameter<DoubleValue>("MinValue", null, MinValueParameter.Name)); 94 resultsCollector.CollectedValues.Add(new LookupParameter<DoubleValue>("AverageValue", null, AverageValueParameter.Name)); 95 resultsCollector.CollectedValues.Add(new LookupParameter<DoubleValue>("MaxValue", null, MaxValueParameter.Name)); 115 if (CollectMinValueInResults.Value) 116 resultsCollector.CollectedValues.Add(new LookupParameter<DoubleValue>("MinValue", null, MinValueParameter.Name)); 117 if (CollectAverageValueInResults.Value) 118 resultsCollector.CollectedValues.Add(new LookupParameter<DoubleValue>("AverageValue", null, AverageValueParameter.Name)); 119 if (CollectMaxValueInResults.Value) 120 resultsCollector.CollectedValues.Add(new LookupParameter<DoubleValue>("MaxValue", null, MaxValueParameter.Name)); 96 121 resultsCollector.CollectedValues.Add(new LookupParameter<DataTable>(ValuesParameter.Name)); 97 122 resultsCollector.ResultsParameter.ActualName = ResultsParameter.Name; … … 113 138 private void Initialize() { 114 139 ValueParameter.DepthChanged += new EventHandler(ValueParameter_DepthChanged); 140 CollectMinValueInResultsParameter.ValueChanged += new EventHandler(CollectMinValueInResultsParameter_ValueChanged); 141 CollectMinValueInResultsParameter.Value.ValueChanged += new EventHandler(CollectMinValueInResultsParameter_ValueChanged); 142 CollectMaxValueInResultsParameter.ValueChanged += new EventHandler(CollectMaxValueInResultsParameter_ValueChanged); 143 CollectMaxValueInResultsParameter.Value.ValueChanged += new EventHandler(CollectMaxValueInResultsParameter_ValueChanged); 144 CollectAverageValueInResultsParameter.ValueChanged += new EventHandler(CollectAverageValueInResultsParameter_ValueChanged); 145 CollectAverageValueInResultsParameter.Value.ValueChanged += new EventHandler(CollectAverageValueInResultsParameter_ValueChanged); 146 } 147 148 private void CollectAverageValueInResultsParameter_ValueChanged(object sender, EventArgs e) { 149 if (CollectAverageValueInResults.Value) 150 resultsCollector.CollectedValues.Add(new LookupParameter<DoubleValue>("AverageValue", null, AverageValueParameter.Name)); 151 else { 152 IParameter avgValueParameter; 153 resultsCollector.CollectedValues.TryGetValue("AverageValue", out avgValueParameter); 154 resultsCollector.CollectedValues.Remove(avgValueParameter); 155 } 156 } 157 158 private void CollectMaxValueInResultsParameter_ValueChanged(object sender, EventArgs e) { 159 if (CollectMaxValueInResults.Value) 160 resultsCollector.CollectedValues.Add(new LookupParameter<DoubleValue>("MaxValue", null, MaxValueParameter.Name)); 161 else { 162 IParameter maxValueParameter; 163 resultsCollector.CollectedValues.TryGetValue("MaxValue", out maxValueParameter); 164 resultsCollector.CollectedValues.Remove(maxValueParameter); 165 } 166 } 167 168 private void CollectMinValueInResultsParameter_ValueChanged(object sender, EventArgs e) { 169 if (CollectMinValueInResults.Value) 170 resultsCollector.CollectedValues.Add(new LookupParameter<DoubleValue>("MinValue", null, MinValueParameter.Name)); 171 else { 172 IParameter minValueParameter; 173 resultsCollector.CollectedValues.TryGetValue("MinValue", out minValueParameter); 174 resultsCollector.CollectedValues.Remove(minValueParameter); 175 } 115 176 } 116 177 -
trunk/sources/HeuristicLab.Common.Resources/3.3/HeuristicLab.Common.Resources-3.3.csproj
r3702 r3710 429 429 <ItemGroup> 430 430 <Content Include="Resources\VS2008ImageLibrary\VS2008ImageLibrary_Actions_ActualSize.png" /> 431 <Content Include="Resources\VS2008ImageLibrary\VS2008ImageLibrary_Objects_Performance.ico" /> 431 432 </ItemGroup> 432 433 <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> -
trunk/sources/HeuristicLab.Common.Resources/3.3/VS2008ImageLibrary.Designer.cs
r3511 r3710 509 509 } 510 510 511 public static System.Drawing.Icon Performance { 512 get { 513 object obj = ResourceManager.GetObject("Performance", resourceCulture); 514 return ((System.Drawing.Icon)(obj)); 515 } 516 } 517 511 518 public static System.Drawing.Bitmap Play { 512 519 get { -
trunk/sources/HeuristicLab.Common.Resources/3.3/VS2008ImageLibrary.resx
r3511 r3710 311 311 <value>Resources\VS2008ImageLibrary\VS2008ImageLibrary_Actions_Pause.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value> 312 312 </data> 313 <data name="Performance" type="System.Resources.ResXFileRef, System.Windows.Forms"> 314 <value>Resources\VS2008ImageLibrary\VS2008ImageLibrary_Objects_Performance.ico;System.Drawing.Icon, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value> 315 </data> 313 316 <data name="Play" type="System.Resources.ResXFileRef, System.Windows.Forms"> 314 317 <value>Resources\VS2008ImageLibrary\VS2008ImageLibrary_Actions_Play.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value> -
trunk/sources/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.3/Analyzers/MinAvgMaxSymbolicExpressionTreeSizeAnalyzer.cs
r3683 r3710 33 33 using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Interfaces; 34 34 using System; 35 using HeuristicLab.Optimization.Operators; 35 36 36 37 namespace HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Analyzers { … … 43 44 private const string SymbolicExpressionTreeParameterName = "SymbolicExpressionTree"; 44 45 private const string SymbolicExpressionTreeSizeParameterName = "SymbolicExpressionTreeSize"; 45 private const string SymbolicExpressionTreeSizesParameterName = "SymbolicExpressionTreeSizes"; 46 private const string SymbolicExpressionTreeSizesParameterName = "Symbolic expression tree size"; 47 private const string MinTreeSizeParameterName = "Min tree size"; 48 private const string AverageTreeSizeParameterName = "Average tree size"; 49 private const string MaxTreeSizeParameterName = "Max tree size"; 46 50 private const string ResultsParameterName = "Results"; 47 51 … … 59 63 get { return (ValueLookupParameter<VariableCollection>)Parameters[ResultsParameterName]; } 60 64 } 61 65 62 66 [Storable] 63 67 private MinAverageMaxValueAnalyzer valueAnalyzer; 64 68 [Storable] 65 private SymbolicExpressionTreeSizeCalculator sizeCalculator;69 private UniformSubScopesProcessor subScopesProcessor; 66 70 67 71 #endregion … … 73 77 Parameters.Add(new ValueLookupParameter<VariableCollection>(ResultsParameterName, "The results collection where the analysis values should be stored.")); 74 78 75 sizeCalculator = new SymbolicExpressionTreeSizeCalculator(); 79 subScopesProcessor = new UniformSubScopesProcessor(); 80 SymbolicExpressionTreeSizeCalculator sizeCalculator = new SymbolicExpressionTreeSizeCalculator(); 76 81 valueAnalyzer = new MinAverageMaxValueAnalyzer(); 82 83 subScopesProcessor.Depth.Value = SymbolicExpressionTreeParameter.Depth; 77 84 sizeCalculator.SymbolicExpressionTreeParameter.ActualName = SymbolicExpressionTreeParameter.Name; 78 sizeCalculator.SymbolicExpressionTreeParameter.Depth = SymbolicExpressionTreeParameter.Depth;79 85 sizeCalculator.SymbolicExpressionTreeSizeParameter.ActualName = SymbolicExpressionTreeSizeParameter.Name; 80 sizeCalculator.SymbolicExpressionTreeSizeParameter.Depth = SymbolicExpressionTreeSizeParameter.Depth;81 86 valueAnalyzer.ValueParameter.ActualName = sizeCalculator.SymbolicExpressionTreeSizeParameter.Name; 82 87 valueAnalyzer.ValueParameter.Depth = SymbolicExpressionTreeSizeParameter.Depth; 88 valueAnalyzer.AverageValueParameter.ActualName = AverageTreeSizeParameterName; 89 valueAnalyzer.CollectAverageValueInResultsParameter.Value = new BoolValue(false); 90 valueAnalyzer.MaxValueParameter.ActualName = MaxTreeSizeParameterName; 91 valueAnalyzer.CollectMaxValueInResultsParameter.Value = new BoolValue(false); 92 valueAnalyzer.MinValueParameter.ActualName = MinTreeSizeParameterName; 93 valueAnalyzer.CollectMinValueInResultsParameter.Value = new BoolValue(false); 83 94 valueAnalyzer.ValuesParameter.ActualName = SymbolicExpressionTreeSizesParameter.Name; 84 valueAnalyzer.ResultsParameter.ActualName = ResultsParameter.Name;85 valueAnalyzer.AverageValueParameter.ActualName = "Avg. Tree Size";86 valueAnalyzer.MaxValueParameter.ActualName = "Max Tree Size";87 valueAnalyzer.MinValueParameter.ActualName = "Min Tree Size";88 95 89 OperatorGraph.InitialOperator = sizeCalculator; 90 sizeCalculator.Successor = valueAnalyzer; 96 OperatorGraph.InitialOperator = subScopesProcessor; 97 subScopesProcessor.Operator = sizeCalculator; 98 sizeCalculator.Successor = null; 99 subScopesProcessor.Successor = valueAnalyzer; 91 100 valueAnalyzer.Successor = null; 92 101 … … 119 128 private void OnDepthParameterChanged() { 120 129 valueAnalyzer.ValueParameter.Depth = SymbolicExpressionTreeParameter.Depth; 121 sizeCalculator.SymbolicExpressionTreeParameter.Depth = SymbolicExpressionTreeParameter.Depth; 122 sizeCalculator.SymbolicExpressionTreeSizeParameter.Depth = SymbolicExpressionTreeSizeParameter.Depth; 130 subScopesProcessor.Depth.Value = SymbolicExpressionTreeParameter.Depth; 123 131 } 124 132 } -
trunk/sources/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.3/Analyzers/SymbolicExpressionTreeSizeCalculator.cs
r3683 r3710 42 42 43 43 #region parameter properties 44 public ScopeTreeLookupParameter<SymbolicExpressionTree> SymbolicExpressionTreeParameter {45 get { return ( ScopeTreeLookupParameter<SymbolicExpressionTree>)Parameters[SymbolicExpressionTreeParameterName]; }44 public ILookupParameter<SymbolicExpressionTree> SymbolicExpressionTreeParameter { 45 get { return (ILookupParameter<SymbolicExpressionTree>)Parameters[SymbolicExpressionTreeParameterName]; } 46 46 } 47 public ScopeTreeLookupParameter<DoubleValue> SymbolicExpressionTreeSizeParameter {48 get { return ( ScopeTreeLookupParameter<DoubleValue>)Parameters[SymbolicExpressionTreeSizeParameterName]; }47 public ILookupParameter<DoubleValue> SymbolicExpressionTreeSizeParameter { 48 get { return (ILookupParameter<DoubleValue>)Parameters[SymbolicExpressionTreeSizeParameterName]; } 49 49 } 50 50 #endregion 51 51 52 52 #region properties 53 public ItemArray<SymbolicExpressionTree>SymbolicExpressionTree {53 public SymbolicExpressionTree SymbolicExpressionTree { 54 54 get { return SymbolicExpressionTreeParameter.ActualValue; } 55 55 } 56 public ItemArray<DoubleValue>SymbolicExpressionTreeSize {56 public DoubleValue SymbolicExpressionTreeSize { 57 57 get { return SymbolicExpressionTreeSizeParameter.ActualValue; } 58 58 set { SymbolicExpressionTreeSizeParameter.ActualValue = value; } … … 62 62 public SymbolicExpressionTreeSizeCalculator() 63 63 : base() { 64 Parameters.Add(new ScopeTreeLookupParameter<SymbolicExpressionTree>(SymbolicExpressionTreeParameterName, "The symbolic expression tree whose size should be calculated."));65 Parameters.Add(new ScopeTreeLookupParameter<DoubleValue>(SymbolicExpressionTreeSizeParameterName, "The tree size of the symbolic expression tree."));64 Parameters.Add(new LookupParameter<SymbolicExpressionTree>(SymbolicExpressionTreeParameterName, "The symbolic expression tree whose size should be calculated.")); 65 Parameters.Add(new LookupParameter<DoubleValue>(SymbolicExpressionTreeSizeParameterName, "The tree size of the symbolic expression tree.")); 66 66 } 67 67 68 68 public override IOperation Apply() { 69 ItemArray<SymbolicExpressionTree> trees = SymbolicExpressionTree; 70 SymbolicExpressionTreeSize = new ItemArray<DoubleValue>(from tree in trees 71 select new DoubleValue(tree.Size)); 69 SymbolicExpressionTree tree = SymbolicExpressionTree; 70 SymbolicExpressionTreeSize = new DoubleValue(tree.Size); 72 71 return base.Apply(); 73 72 } -
trunk/sources/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.3/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding-3.3.csproj
r3681 r3710 150 150 <Name>HeuristicLab.Collections-3.3</Name> 151 151 </ProjectReference> 152 <ProjectReference Include="..\..\HeuristicLab.Common.Resources\3.3\HeuristicLab.Common.Resources-3.3.csproj"> 153 <Project>{0E27A536-1C4A-4624-A65E-DC4F4F23E3E1}</Project> 154 <Name>HeuristicLab.Common.Resources-3.3</Name> 155 </ProjectReference> 152 156 <ProjectReference Include="..\..\HeuristicLab.Common\3.3\HeuristicLab.Common-3.3.csproj"> 153 157 <Project>{A9AD58B9-3EF9-4CC1-97E5-8D909039FF5C}</Project> … … 165 169 <Project>{23DA7FF4-D5B8-41B6-AA96-F0561D24F3EE}</Project> 166 170 <Name>HeuristicLab.Operators-3.3</Name> 171 </ProjectReference> 172 <ProjectReference Include="..\..\HeuristicLab.Optimization.Operators\3.3\HeuristicLab.Optimization.Operators-3.3.csproj"> 173 <Project>{25087811-F74C-4128-BC86-8324271DA13E}</Project> 174 <Name>HeuristicLab.Optimization.Operators-3.3</Name> 167 175 </ProjectReference> 168 176 <ProjectReference Include="..\..\HeuristicLab.Optimization\3.3\HeuristicLab.Optimization-3.3.csproj"> -
trunk/sources/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.3/HeuristicLabEncodingsSymbolicExpressionTreeEncodingPlugin.cs.frame
r3651 r3710 31 31 [PluginDependency("HeuristicLab.Collections", "3.3.0.0")] 32 32 [PluginDependency("HeuristicLab.Common", "3.3.0.0")] 33 [PluginDependency("HeuristicLab.Common.Resources", "3.3.0.0")] 33 34 [PluginDependency("HeuristicLab.Core", "3.3.0.0")] 34 35 [PluginDependency("HeuristicLab.Data", "3.3.0.0")] -
trunk/sources/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.3/SymbolicExpressionTree.cs
r3442 r3710 29 29 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 30 30 using HeuristicLab.Data; 31 using System.Drawing; 31 32 32 33 namespace HeuristicLab.Encodings.SymbolicExpressionTreeEncoding { … … 34 35 [Item("SymbolicExpressionTree", "Represents a symbolic expression tree.")] 35 36 public class SymbolicExpressionTree : Item { 37 public override Image ItemImage { 38 get { return HeuristicLab.Common.Resources.VS2008ImageLibrary.Function; } 39 } 36 40 [Storable] 37 41 private SymbolicExpressionTreeNode root; -
trunk/sources/HeuristicLab.Operators/3.3/SubScopesProcessor.cs
r3407 r3710 20 20 #endregion 21 21 22 using System.Linq; 22 23 using HeuristicLab.Common; 23 24 using HeuristicLab.Core; … … 25 26 using HeuristicLab.Parameters; 26 27 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 28 using System.Collections.Generic; 29 using System; 27 30 28 31 namespace HeuristicLab.Operators { 29 32 /// <summary> 30 /// An operator which contains multiple operators of which each is applied on one sub-scope of the current scope. The first operator is applied on the first sub-scope, the second on the second, and so on.33 /// An operator which contains multiple operators of which each is applied on one sub-scope at the given depth of the current scope. The first operator is applied on the first sub-scope, the second on the second, and so on. 31 34 /// </summary> 32 [Item("SubScopesProcessor", "An operator which contains multiple operators of which each is applied on one sub-scope of the current scope. The first operator is applied on the first sub-scope, the second on the second, and so on.")]35 [Item("SubScopesProcessor", "An operator which contains multiple operators of which each is applied on one sub-scope at the given depth of the current scope. The first operator is applied on the first sub-scope, the second on the second, and so on.")] 33 36 [StorableClass] 34 37 public sealed class SubScopesProcessor : MultiOperator<IOperator> { 35 38 public ValueLookupParameter<BoolValue> ParallelParameter { 36 39 get { return (ValueLookupParameter<BoolValue>)Parameters["Parallel"]; } 40 } 41 public ValueParameter<IntValue> DepthParameter { 42 get { return (ValueParameter<IntValue>)Parameters["Depth"]; } 37 43 } 38 44 … … 41 47 set { ParallelParameter.Value = value; } 42 48 } 49 public IntValue Depth { 50 get { return DepthParameter.Value; } 51 set { DepthParameter.Value = value; } 52 } 43 53 44 54 public SubScopesProcessor() 45 55 : base() { 46 56 Parameters.Add(new ValueLookupParameter<BoolValue>("Parallel", "True if the operators should be applied in parallel on the sub-scopes, otherwise false.", new BoolValue(false))); 57 Parameters.Add(new ValueParameter<IntValue>("Depth", "The number of steps to descend in the scope tree before applying operator.", new IntValue(1))); 47 58 } 48 59 49 60 public override IOperation Apply() { 50 BoolValue parallel = ParallelParameter.ActualValue;61 List<IScope> scopes = GetScopesOnLevel(ExecutionContext.Scope, Depth.Value).ToList(); 51 62 OperationCollection next = new OperationCollection(base.Apply()); 52 if ( Operators.Count > 0) {53 OperationCollection inner = new OperationCollection();54 inner.Parallel = parallel == null ? false : parallel.Value;55 for (int i = 0; (i < ExecutionContext.Scope.SubScopes.Count) && (i < Operators.Count); i++)56 if (Operators[i] != null) inner.Add(ExecutionContext.CreateOperation(Operators[i], ExecutionContext.Scope.SubScopes[i]));57 next.Insert(0, inner);63 if (scopes.Count != Operators.Count) 64 throw new ArgumentException("The number of operators doesn't match the number of sub-scopes at depth " + Depth.Value); 65 OperationCollection inner = new OperationCollection(); 66 inner.Parallel = Parallel == null ? false : Parallel.Value; 67 for (int i = 0; i < scopes.Count(); i++) { 68 inner.Add(ExecutionContext.CreateOperation(Operators[i], scopes[i])); 58 69 } 70 next.Insert(0, inner); 59 71 return next; 72 } 73 74 private IEnumerable<IScope> GetScopesOnLevel(IScope scope, int d) { 75 if (d == 0) yield return scope; 76 else { 77 foreach (IScope subScope in scope.SubScopes) { 78 foreach (IScope scopesOfSubScope in GetScopesOnLevel(subScope, d - 1)) { 79 yield return scopesOfSubScope; 80 } 81 } 82 } 60 83 } 61 84 } -
trunk/sources/HeuristicLab.Operators/3.3/UniformSubScopesProcessor.cs
r3376 r3710 25 25 using HeuristicLab.Parameters; 26 26 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 27 using System.Collections.Generic; 28 using System; 29 using System.Linq; 27 30 28 31 namespace HeuristicLab.Operators { 29 32 /// <summary> 30 /// An operator which applies a specified operator on all sub-scopes of the current scope.33 /// An operator which applies a specified operator on all sub-scopes at the given depth of the current scope. 31 34 /// </summary> 32 [Item("UniformSubScopesProcessor", "An operator which applies a specified operator on all sub-scopes of the current scope.")]35 [Item("UniformSubScopesProcessor", "An operator which applies a specified operator on all sub-scopes at the given depth of the current scope.")] 33 36 [StorableClass] 34 37 public sealed class UniformSubScopesProcessor : SingleSuccessorOperator { … … 38 41 public ValueLookupParameter<BoolValue> ParallelParameter { 39 42 get { return (ValueLookupParameter<BoolValue>)Parameters["Parallel"]; } 43 } 44 public ValueParameter<IntValue> DepthParameter { 45 get { return (ValueParameter<IntValue>)Parameters["Depth"]; } 40 46 } 41 47 … … 48 54 set { ParallelParameter.Value = value; } 49 55 } 56 public IntValue Depth { 57 get { return DepthParameter.Value; } 58 set { DepthParameter.Value = value; } 59 } 50 60 51 61 public UniformSubScopesProcessor() … … 53 63 Parameters.Add(new OperatorParameter("Operator", "The operator which should be applied on all sub-scopes of the current scope.")); 54 64 Parameters.Add(new ValueLookupParameter<BoolValue>("Parallel", "True if the operator should be applied in parallel on all sub-scopes, otherwise false.", new BoolValue(false))); 65 Parameters.Add(new ValueParameter<IntValue>("Depth", "The number of steps to descend in the scope tree before applying operator.", new IntValue(1))); 55 66 } 56 67 57 68 public override IOperation Apply() { 58 BoolValue parallel = ParallelParameter.ActualValue;59 69 OperationCollection next = new OperationCollection(base.Apply()); 60 70 if (Operator != null) { 71 List<IScope> scopes = GetScopesOnLevel(ExecutionContext.Scope, Depth.Value).ToList(); 61 72 OperationCollection inner = new OperationCollection(); 62 inner.Parallel = parallel == null ? false : parallel.Value; 63 for (int i = 0; i < ExecutionContext.Scope.SubScopes.Count; i++) 64 inner.Add(ExecutionContext.CreateOperation(Operator, ExecutionContext.Scope.SubScopes[i])); 73 inner.Parallel = Parallel == null ? false : Parallel.Value; 74 for (int i = 0; i < scopes.Count; i++) { 75 inner.Add(ExecutionContext.CreateOperation(Operator, scopes[i])); 76 } 65 77 next.Insert(0, inner); 66 78 } 67 79 return next; 68 80 } 81 82 private IEnumerable<IScope> GetScopesOnLevel(IScope scope, int d) { 83 if (d == 0) yield return scope; 84 else { 85 foreach (IScope subScope in scope.SubScopes) { 86 foreach (IScope scopesOfSubScope in GetScopesOnLevel(subScope, d - 1)) { 87 yield return scopesOfSubScope; 88 } 89 } 90 } 91 } 69 92 } 70 93 } -
trunk/sources/HeuristicLab.PluginInfrastructure/Advanced/UploadPluginsView.cs
r3627 r3710 118 118 var selectedPlugins = (IEnumerable<IPluginDescription>)e.Argument; 119 119 DeploymentService.AdminClient adminClient = DeploymentService.AdminClientFactory.CreateClient(); 120 Dictionary<IPluginDescription, DeploymentService.PluginDescription> cachedPluginDescriptions = 121 new Dictionary<IPluginDescription, DeploymentService.PluginDescription>(); 120 122 try { 121 123 foreach (var plugin in IteratePlugins(selectedPlugins)) { 122 adminClient.DeployPlugin(MakePluginDescription(plugin ), CreateZipPackage(plugin));124 adminClient.DeployPlugin(MakePluginDescription(plugin, cachedPluginDescriptions), CreateZipPackage(plugin)); 123 125 } 124 126 adminClient.Close(); … … 227 229 var matchingLocalPlugin = (from localPlugin in localAndServerPlugins.Keys 228 230 where localPlugin.Name == plugin.Name 229 where localPlugin.Version == localPlugin.Version231 where localPlugin.Version == plugin.Version 230 232 select localPlugin).SingleOrDefault(); 231 233 if (matchingLocalPlugin != null) { … … 296 298 } 297 299 298 private DeploymentService.PluginDescription MakePluginDescription(IPluginDescription plugin) { 299 var dependencies = from dep in plugin.Dependencies 300 select MakePluginDescription(dep); 301 return new DeploymentService.PluginDescription(plugin.Name, plugin.Version, dependencies, plugin.ContactName, plugin.ContactEmail, plugin.LicenseText); 300 private DeploymentService.PluginDescription MakePluginDescription(IPluginDescription plugin, Dictionary<IPluginDescription, DeploymentService.PluginDescription> cachedPluginDescriptions) { 301 if (!cachedPluginDescriptions.ContainsKey(plugin)) { 302 var dependencies = (from dep in plugin.Dependencies 303 select MakePluginDescription(dep, cachedPluginDescriptions)) 304 .ToList(); 305 cachedPluginDescriptions.Add(plugin, 306 new DeploymentService.PluginDescription(plugin.Name, plugin.Version, dependencies, plugin.ContactName, plugin.ContactEmail, plugin.LicenseText)); 307 } 308 return cachedPluginDescriptions[plugin]; 302 309 } 303 310 #endregion -
trunk/sources/HeuristicLab.Problems.ArtificialAnt/3.3/AntTrail.cs
r3431 r3710 26 26 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 27 27 using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding; 28 using System.Drawing; 28 29 29 30 namespace HeuristicLab.Problems.ArtificialAnt { … … 34 35 [StorableClass] 35 36 public sealed class AntTrail : Item { 37 public override Image ItemImage { 38 get { return HeuristicLab.Common.Resources.VS2008ImageLibrary.Image; } 39 } 36 40 [Storable] 37 41 private SymbolicExpressionTree expression; -
trunk/sources/HeuristicLab.Problems.DataAnalysis.Regression/3.3/HeuristicLab.Problems.DataAnalysis.Regression-3.3.csproj
r3702 r3710 87 87 <Compile Include="Properties\AssemblyInfo.cs" /> 88 88 <Compile Include="Symbolic\Analyzers\BestSymbolicRegressionSolutionAnalyzer.cs" /> 89 <Compile Include="Symbolic\Analyzers\SymbolicRegressionMeanSquaredErrorCalculator.cs" />90 89 <Compile Include="Symbolic\Analyzers\ISymbolicRegressionAnalyzer.cs" /> 91 90 <Compile Include="Symbolic\Analyzers\SymbolicRegressionModelQualityAnalyzer.cs" /> 92 <Compile Include="Symbolic\Analyzers\SymbolicRegressionModelQualityCalculator.cs" /> 91 <Compile Include="Symbolic\Analyzers\SymbolicRegressionModelQualityCalculator.cs"> 92 <SubType>Code</SubType> 93 </Compile> 93 94 <Compile Include="Symbolic\Analyzers\SymbolicRegressionSolutionLinearScaler.cs" /> 94 95 <Compile Include="Symbolic\Analyzers\SymbolicRegressionVariableFrequencyAnalyzer.cs" /> -
trunk/sources/HeuristicLab.Problems.DataAnalysis.Regression/3.3/Symbolic/Analyzers/BestSymbolicRegressionSolutionAnalyzer.cs
r3681 r3710 34 34 using HeuristicLab.Problems.DataAnalysis.Symbolic.Symbols; 35 35 using HeuristicLab.Problems.DataAnalysis; 36 using HeuristicLab.Problems.DataAnalysis.Evaluators; 36 37 37 38 namespace HeuristicLab.Problems.DataAnalysis.Regression.Symbolic.Analyzers { … … 48 49 private const string BestSolutionQualityParameterName = "BestSolutionQuality"; 49 50 private const string ResultsParameterName = "Results"; 50 51 private const string BestSolutionResultName = "Best Solution (on validiation set)"; 52 private const string BestSolutionInputvariableCountResultName = "Variables Used by Best Solution"; 51 private const string BestSolutionResultName = "Best solution (on validiation set)"; 52 private const string BestSolutionInputvariableCountResultName = "Variables used by best solution"; 53 private const string BestSolutionTrainingRSquared = "Best solution R² (training)"; 54 private const string BestSolutionTestRSquared = "Best solution R² (test)"; 55 private const string BestSolutionTrainingMse = "Best solution mean squared error (training)"; 56 private const string BestSolutionTestMse = "Best solution mean squared error (test)"; 57 private const string BestSolutionTrainingRelativeError = "Best solution average relative error (training)"; 58 private const string BestSolutionTestRelativeError = "Best solution average relative error (test)"; 53 59 54 60 public ScopeTreeLookupParameter<SymbolicExpressionTree> SymbolicExpressionTreeParameter { … … 112 118 results.Add(new Result(BestSolutionResultName, solution)); 113 119 results.Add(new Result(BestSolutionInputvariableCountResultName, new IntValue(model.InputVariables.Count()))); 120 #region calculate R2,MSE,Rel Error 121 double[] trainingValues = problemData.Dataset.GetVariableValues( 122 problemData.TargetVariable.Value, 123 problemData.TrainingSamplesStart.Value, 124 problemData.TrainingSamplesEnd.Value); 125 double[] testValues = problemData.Dataset.GetVariableValues( 126 problemData.TargetVariable.Value, 127 problemData.TestSamplesStart.Value, 128 problemData.TestSamplesEnd.Value); 129 double trainingR2 = SimpleRSquaredEvaluator.Calculate(trainingValues, solution.EstimatedTrainingValues); 130 double testR2 = SimpleRSquaredEvaluator.Calculate(testValues, solution.EstimatedTestValues); 131 double trainingMse = SimpleMSEEvaluator.Calculate(trainingValues, solution.EstimatedTrainingValues); 132 double testMse = SimpleMSEEvaluator.Calculate(testValues, solution.EstimatedTestValues); 133 double trainingRelError = SimpleMeanAbsolutePercentageErrorEvaluator.Calculate(trainingValues, solution.EstimatedTrainingValues); 134 double testRelError = SimpleMeanAbsolutePercentageErrorEvaluator.Calculate(testValues, solution.EstimatedTestValues); 135 results.Add(new Result(BestSolutionTrainingRSquared, new DoubleValue(trainingR2))); 136 results.Add(new Result(BestSolutionTestRSquared, new DoubleValue(testR2))); 137 results.Add(new Result(BestSolutionTrainingMse, new DoubleValue(trainingMse))); 138 results.Add(new Result(BestSolutionTestMse, new DoubleValue(testMse))); 139 results.Add(new Result(BestSolutionTrainingRelativeError, new DoubleValue(trainingRelError))); 140 results.Add(new Result(BestSolutionTestRelativeError, new DoubleValue(testRelError))); 141 #endregion 114 142 } else { 115 143 if (BestSolutionQualityParameter.ActualValue.Value > qualities[i].Value) { … … 120 148 results[BestSolutionResultName].Value = solution; 121 149 results[BestSolutionInputvariableCountResultName].Value = new IntValue(model.InputVariables.Count()); 150 #region update R2,MSE, Rel Error 151 double[] trainingValues = problemData.Dataset.GetVariableValues( 152 problemData.TargetVariable.Value, 153 problemData.TrainingSamplesStart.Value, 154 problemData.TrainingSamplesEnd.Value); 155 double[] testValues = problemData.Dataset.GetVariableValues( 156 problemData.TargetVariable.Value, 157 problemData.TestSamplesStart.Value, 158 problemData.TestSamplesEnd.Value); 159 double trainingR2 = SimpleRSquaredEvaluator.Calculate(trainingValues, solution.EstimatedTrainingValues); 160 double testR2 = SimpleRSquaredEvaluator.Calculate(testValues, solution.EstimatedTestValues); 161 double trainingMse = SimpleMSEEvaluator.Calculate(trainingValues, solution.EstimatedTrainingValues); 162 double testMse = SimpleMSEEvaluator.Calculate(testValues, solution.EstimatedTestValues); 163 double trainingRelError = SimpleMeanAbsolutePercentageErrorEvaluator.Calculate(trainingValues, solution.EstimatedTrainingValues); 164 double testRelError = SimpleMeanAbsolutePercentageErrorEvaluator.Calculate(testValues, solution.EstimatedTestValues); 165 results[BestSolutionTrainingRSquared].Value = new DoubleValue(trainingR2); 166 results[BestSolutionTestRSquared].Value = new DoubleValue(testR2); 167 results[BestSolutionTrainingMse].Value = new DoubleValue(trainingMse); 168 results[BestSolutionTestMse].Value = new DoubleValue(testMse); 169 results[BestSolutionTrainingRelativeError].Value = new DoubleValue(trainingRelError); 170 results[BestSolutionTestRelativeError].Value = new DoubleValue(testRelError); 171 #endregion 122 172 } 123 173 } -
trunk/sources/HeuristicLab.Problems.DataAnalysis.Regression/3.3/Symbolic/Analyzers/SymbolicRegressionModelQualityAnalyzer.cs
r3683 r3710 51 51 private const string ResultsParameterName = "Results"; 52 52 53 private const string TrainingMeanSquaredErrorQualityParameterName = " TrainingMeanSquaredError";54 private const string MinTrainingMeanSquaredErrorQualityParameterName = "Min TrainingMeanSquaredError";55 private const string MaxTrainingMeanSquaredErrorQualityParameterName = "Max TrainingMeanSquaredError";56 private const string AverageTrainingMeanSquaredErrorQualityParameterName = "Average TrainingMeanSquaredError";57 private const string BestTrainingMeanSquaredErrorQualityParameterName = "Best TrainingMeanSquaredError";58 59 private const string TrainingAverageRelativeErrorQualityParameterName = " TrainingAverageRelativeError";60 private const string MinTrainingAverageRelativeErrorQualityParameterName = "Min TrainingAverageRelativeError";61 private const string MaxTrainingAverageRelativeErrorQualityParameterName = "Max TrainingAverageRelativeError";62 private const string AverageTrainingAverageRelativeErrorQualityParameterName = "Average TrainingAverageRelativeError";63 private const string BestTrainingAverageRelativeErrorQualityParameterName = "Best TrainingAverageRelativeError";64 65 private const string TrainingRSquaredQualityParameterName = " TrainingRSquared";66 private const string MinTrainingRSquaredQualityParameterName = "Min TrainingRSquared";67 private const string MaxTrainingRSquaredQualityParameterName = "Max TrainingRSquared";68 private const string AverageTrainingRSquaredQualityParameterName = "Average TrainingRSquared";69 private const string BestTrainingRSquaredQualityParameterName = "Best TrainingRSquared";70 71 private const string TestMeanSquaredErrorQualityParameterName = " TestMeanSquaredError";72 private const string MinTestMeanSquaredErrorQualityParameterName = "Min TestMeanSquaredError";73 private const string MaxTestMeanSquaredErrorQualityParameterName = "Max TestMeanSquaredError";74 private const string AverageTestMeanSquaredErrorQualityParameterName = "Average TestMeanSquaredError";75 private const string BestTestMeanSquaredErrorQualityParameterName = "Best TestMeanSquaredError";76 77 private const string TestAverageRelativeErrorQualityParameterName = " TestAverageRelativeError";78 private const string MinTestAverageRelativeErrorQualityParameterName = "Min TestAverageRelativeError";79 private const string MaxTestAverageRelativeErrorQualityParameterName = "Max TestAverageRelativeError";80 private const string AverageTestAverageRelativeErrorQualityParameterName = "Average TestAverageRelativeError";81 private const string BestTestAverageRelativeErrorQualityParameterName = "Best TestAverageRelativeError";82 83 private const string TestRSquaredQualityParameterName = " TestRSquared";84 private const string MinTestRSquaredQualityParameterName = "Min TestRSquared";85 private const string MaxTestRSquaredQualityParameterName = "Max TestRSquared";86 private const string AverageTestRSquaredQualityParameterName = "Average TestRSquared";87 private const string BestTestRSquaredQualityParameterName = "Best TestRSquared";88 89 private const string RSquaredValuesParameterName = "R -squared Values";90 private const string MeanSquaredErrorValuesParameterName = "Mean Squared Error Values";91 private const string RelativeErrorValuesParameterName = "Average Relative Error Values";53 private const string TrainingMeanSquaredErrorQualityParameterName = "Mean squared error (training)"; 54 private const string MinTrainingMeanSquaredErrorQualityParameterName = "Min mean squared error (training)"; 55 private const string MaxTrainingMeanSquaredErrorQualityParameterName = "Max mean squared error (training)"; 56 private const string AverageTrainingMeanSquaredErrorQualityParameterName = "Average mean squared error (training)"; 57 private const string BestTrainingMeanSquaredErrorQualityParameterName = "Best mean squared error (training)"; 58 59 private const string TrainingAverageRelativeErrorQualityParameterName = "Average relative error (training)"; 60 private const string MinTrainingAverageRelativeErrorQualityParameterName = "Min average relative error (training)"; 61 private const string MaxTrainingAverageRelativeErrorQualityParameterName = "Max average relative error (training)"; 62 private const string AverageTrainingAverageRelativeErrorQualityParameterName = "Average average relative error (training)"; 63 private const string BestTrainingAverageRelativeErrorQualityParameterName = "Best average relative error (training)"; 64 65 private const string TrainingRSquaredQualityParameterName = "R² (training)"; 66 private const string MinTrainingRSquaredQualityParameterName = "Min R² (training)"; 67 private const string MaxTrainingRSquaredQualityParameterName = "Max R² (training)"; 68 private const string AverageTrainingRSquaredQualityParameterName = "Average R² (training)"; 69 private const string BestTrainingRSquaredQualityParameterName = "Best R² (training)"; 70 71 private const string TestMeanSquaredErrorQualityParameterName = "Mean squared error (test)"; 72 private const string MinTestMeanSquaredErrorQualityParameterName = "Min mean squared error (test)"; 73 private const string MaxTestMeanSquaredErrorQualityParameterName = "Max mean squared error (test)"; 74 private const string AverageTestMeanSquaredErrorQualityParameterName = "Average mean squared error (test)"; 75 private const string BestTestMeanSquaredErrorQualityParameterName = "Best mean squared error (test)"; 76 77 private const string TestAverageRelativeErrorQualityParameterName = "Average relative error (test)"; 78 private const string MinTestAverageRelativeErrorQualityParameterName = "Min average relative error (test)"; 79 private const string MaxTestAverageRelativeErrorQualityParameterName = "Max average relative error (test)"; 80 private const string AverageTestAverageRelativeErrorQualityParameterName = "Average average relative error (test)"; 81 private const string BestTestAverageRelativeErrorQualityParameterName = "Best average relative error (test)"; 82 83 private const string TestRSquaredQualityParameterName = "R² (test)"; 84 private const string MinTestRSquaredQualityParameterName = "Min R² (test)"; 85 private const string MaxTestRSquaredQualityParameterName = "Max R² (test)"; 86 private const string AverageTestRSquaredQualityParameterName = "Average R² (test)"; 87 private const string BestTestRSquaredQualityParameterName = "Best R² (test)"; 88 89 private const string RSquaredValuesParameterName = "R²"; 90 private const string MeanSquaredErrorValuesParameterName = "Mean squared error"; 91 private const string RelativeErrorValuesParameterName = "Average relative error"; 92 92 93 93 private const string TrainingSamplesStartParameterName = "TrainingSamplesStart"; … … 132 132 133 133 [Storable] 134 private SymbolicRegressionModelQualityCalculator trainingQualityCalculator; 135 [Storable] 136 private SymbolicRegressionModelQualityCalculator testQualityCalculator; 134 private UniformSubScopesProcessor subScopesProcessor; 137 135 [Storable] 138 136 private MinAverageMaxValueAnalyzer minAvgMaxTrainingMseAnalyzer; … … 165 163 166 164 #region operator initialization 167 trainingQualityCalculator = new SymbolicRegressionModelQualityCalculator(); 168 testQualityCalculator = new SymbolicRegressionModelQualityCalculator(); 165 subScopesProcessor = new UniformSubScopesProcessor(); 166 SymbolicRegressionModelQualityCalculator trainingQualityCalculator = new SymbolicRegressionModelQualityCalculator(); 167 SymbolicRegressionModelQualityCalculator testQualityCalculator = new SymbolicRegressionModelQualityCalculator(); 169 168 minAvgMaxTrainingMseAnalyzer = new MinAverageMaxValueAnalyzer(); 170 169 minAvgMaxTestMseAnalyzer = new MinAverageMaxValueAnalyzer(); … … 178 177 179 178 #region parameter wiring 179 subScopesProcessor.Depth.Value = SymbolicExpressionTreeParameter.Depth; 180 180 trainingQualityCalculator.LowerEstimationLimitParameter.ActualName = LowerEstimationLimitParameter.Name; 181 181 trainingQualityCalculator.ProblemDataParameter.ActualName = ProblemDataParameter.Name; … … 184 184 trainingQualityCalculator.SymbolicExpressionTreeInterpreterParameter.ActualName = SymbolicExpressionTreeInterpreterParameter.Name; 185 185 trainingQualityCalculator.SymbolicExpressionTreeParameter.ActualName = SymbolicExpressionTreeParameter.Name; 186 trainingQualityCalculator.SymbolicExpressionTreeParameter.Depth = SymbolicExpressionTreeParameter.Depth;187 186 trainingQualityCalculator.UpperEstimationLimitParameter.ActualName = UpperEstimationLimitParameter.Name; 188 187 trainingQualityCalculator.AverageRelativeErrorQualityParameter.ActualName = TrainingAverageRelativeErrorQualityParameterName; … … 196 195 testQualityCalculator.SymbolicExpressionTreeInterpreterParameter.ActualName = SymbolicExpressionTreeInterpreterParameter.Name; 197 196 testQualityCalculator.SymbolicExpressionTreeParameter.ActualName = SymbolicExpressionTreeParameter.Name; 198 testQualityCalculator.SymbolicExpressionTreeParameter.Depth = SymbolicExpressionTreeParameter.Depth;199 197 testQualityCalculator.UpperEstimationLimitParameter.ActualName = UpperEstimationLimitParameter.Name; 200 198 testQualityCalculator.AverageRelativeErrorQualityParameter.ActualName = TestAverageRelativeErrorQualityParameterName; … … 209 207 minAvgMaxTrainingMseAnalyzer.ValuesParameter.ActualName = MeanSquaredErrorValuesParameterName; 210 208 minAvgMaxTrainingMseAnalyzer.ResultsParameter.ActualName = ResultsParameter.Name; 209 minAvgMaxTrainingMseAnalyzer.CollectMinValueInResultsParameter.Value = new BoolValue(false); 210 minAvgMaxTrainingMseAnalyzer.CollectAverageValueInResultsParameter.Value = new BoolValue(false); 211 minAvgMaxTrainingMseAnalyzer.CollectMaxValueInResultsParameter.Value = new BoolValue(false); 211 212 212 213 minAvgMaxTestMseAnalyzer.ValueParameter.ActualName = TestMeanSquaredErrorQualityParameterName; … … 217 218 minAvgMaxTestMseAnalyzer.ValuesParameter.ActualName = MeanSquaredErrorValuesParameterName; 218 219 minAvgMaxTestMseAnalyzer.ResultsParameter.ActualName = ResultsParameter.Name; 220 minAvgMaxTestMseAnalyzer.CollectMinValueInResultsParameter.Value = new BoolValue(false); 221 minAvgMaxTestMseAnalyzer.CollectAverageValueInResultsParameter.Value = new BoolValue(false); 222 minAvgMaxTestMseAnalyzer.CollectMaxValueInResultsParameter.Value = new BoolValue(false); 223 219 224 #endregion 220 225 #region training/test R² … … 226 231 minAvgMaxTrainingRSquaredAnalyzer.ValuesParameter.ActualName = RSquaredValuesParameterName; 227 232 minAvgMaxTrainingRSquaredAnalyzer.ResultsParameter.ActualName = ResultsParameter.Name; 233 minAvgMaxTrainingRSquaredAnalyzer.CollectMinValueInResultsParameter.Value = new BoolValue(false); 234 minAvgMaxTrainingRSquaredAnalyzer.CollectAverageValueInResultsParameter.Value = new BoolValue(false); 235 minAvgMaxTrainingRSquaredAnalyzer.CollectMaxValueInResultsParameter.Value = new BoolValue(false); 236 228 237 229 238 minAvgMaxTestRSquaredAnalyzer.ValueParameter.ActualName = TestRSquaredQualityParameterName; … … 234 243 minAvgMaxTestRSquaredAnalyzer.ValuesParameter.ActualName = RSquaredValuesParameterName; 235 244 minAvgMaxTestRSquaredAnalyzer.ResultsParameter.ActualName = ResultsParameter.Name; 245 minAvgMaxTestRSquaredAnalyzer.CollectMinValueInResultsParameter.Value = new BoolValue(false); 246 minAvgMaxTestRSquaredAnalyzer.CollectAverageValueInResultsParameter.Value = new BoolValue(false); 247 minAvgMaxTestRSquaredAnalyzer.CollectMaxValueInResultsParameter.Value = new BoolValue(false); 248 236 249 #endregion 237 250 #region training/test avg. rel. error … … 243 256 minAvgMaxTrainingRelErrorAnalyzer.ValuesParameter.ActualName = RelativeErrorValuesParameterName; 244 257 minAvgMaxTrainingRelErrorAnalyzer.ResultsParameter.ActualName = ResultsParameter.Name; 258 minAvgMaxTrainingRelErrorAnalyzer.CollectMinValueInResultsParameter.Value = new BoolValue(false); 259 minAvgMaxTrainingRelErrorAnalyzer.CollectAverageValueInResultsParameter.Value = new BoolValue(false); 260 minAvgMaxTrainingRelErrorAnalyzer.CollectMaxValueInResultsParameter.Value = new BoolValue(false); 245 261 246 262 minAvgMaxTestRelErrorAnalyzer.ValueParameter.ActualName = TestAverageRelativeErrorQualityParameterName; … … 251 267 minAvgMaxTestRelErrorAnalyzer.ValuesParameter.ActualName = RelativeErrorValuesParameterName; 252 268 minAvgMaxTestRelErrorAnalyzer.ResultsParameter.ActualName = ResultsParameter.Name; 269 minAvgMaxTestRelErrorAnalyzer.CollectMinValueInResultsParameter.Value = new BoolValue(false); 270 minAvgMaxTestRelErrorAnalyzer.CollectAverageValueInResultsParameter.Value = new BoolValue(false); 271 minAvgMaxTestRelErrorAnalyzer.CollectMaxValueInResultsParameter.Value = new BoolValue(false); 253 272 #endregion 254 273 #endregion 255 274 256 275 #region operator graph 257 OperatorGraph.InitialOperator = trainingQualityCalculator; 276 OperatorGraph.InitialOperator = subScopesProcessor; 277 subScopesProcessor.Operator = trainingQualityCalculator; 258 278 trainingQualityCalculator.Successor = testQualityCalculator; 259 testQualityCalculator.Successor = minAvgMaxTrainingMseAnalyzer; 279 testQualityCalculator.Successor = null; 280 subScopesProcessor.Successor = minAvgMaxTrainingMseAnalyzer; 260 281 minAvgMaxTrainingMseAnalyzer.Successor = minAvgMaxTestMseAnalyzer; 261 282 minAvgMaxTestMseAnalyzer.Successor = minAvgMaxTrainingRSquaredAnalyzer; … … 284 305 285 306 private void SymbolicExpressionTreeParameter_DepthChanged(object sender, EventArgs e) { 286 trainingQualityCalculator.SymbolicExpressionTreeParameter.Depth = SymbolicExpressionTreeParameter.Depth; 287 testQualityCalculator.SymbolicExpressionTreeParameter.Depth = SymbolicExpressionTreeParameter.Depth; 307 subScopesProcessor.Depth.Value = SymbolicExpressionTreeParameter.Depth; 288 308 minAvgMaxTrainingMseAnalyzer.ValueParameter.Depth = SymbolicExpressionTreeParameter.Depth; 289 309 minAvgMaxTrainingRelErrorAnalyzer.ValueParameter.Depth = SymbolicExpressionTreeParameter.Depth; -
trunk/sources/HeuristicLab.Problems.DataAnalysis.Regression/3.3/Symbolic/Analyzers/SymbolicRegressionModelQualityCalculator.cs
r3683 r3710 57 57 58 58 #region parameter properties 59 public ScopeTreeLookupParameter<SymbolicExpressionTree> SymbolicExpressionTreeParameter {60 get { return ( ScopeTreeLookupParameter<SymbolicExpressionTree>)Parameters[SymbolicExpressionTreeParameterName]; }59 public ILookupParameter<SymbolicExpressionTree> SymbolicExpressionTreeParameter { 60 get { return (ILookupParameter<SymbolicExpressionTree>)Parameters[SymbolicExpressionTreeParameterName]; } 61 61 } 62 62 public IValueLookupParameter<ISymbolicExpressionTreeInterpreter> SymbolicExpressionTreeInterpreterParameter { … … 91 91 public SymbolicRegressionModelQualityCalculator() 92 92 : base() { 93 Parameters.Add(new LookupParameter<SymbolicExpressionTree>(SymbolicExpressionTreeParameterName, "The symbolic expression tree to analyze.")); 93 94 Parameters.Add(new ValueLookupParameter<ISymbolicExpressionTreeInterpreter>(SymbolicExpressionTreeInterpreterParameterName, "The interpreter that should be used to calculate the output values of the symbolic expression tree.")); 94 Parameters.Add(new ScopeTreeLookupParameter<SymbolicExpressionTree>(SymbolicExpressionTreeParameterName, "The symbolic expression tree to analyze."));95 95 Parameters.Add(new ValueLookupParameter<DataAnalysisProblemData>(ProblemDataParameterName, "The problem data containing the input varaibles for the symbolic regression problem.")); 96 96 Parameters.Add(new ValueLookupParameter<IntValue>(SamplesStartParameterName, "The first index of the data set partition on which the model quality values should be calculated.")); … … 102 102 Parameters.Add(new ValueLookupParameter<DoubleValue>(RSQuaredQualityParameterName, "The R² correlation coefficient of the output of the model and the original target values.")); 103 103 Parameters.Add(new ValueLookupParameter<DoubleValue>(RelativeErrorQualityParameterName, "The average relative percentage error of the output of the model.")); 104 104 105 #region operator initialization 105 106 SimpleSymbolicRegressionEvaluator simpleEvaluator = new SimpleSymbolicRegressionEvaluator(); … … 143 144 144 145 } 145 146 // need to create custom operations for each solution scope (this has to be adapted on basis of the depth value of SymbolicExpressionTreeParameter)147 public override IOperation Apply() {148 var scopes = GetScopesOnLevel(ExecutionContext.Scope, SymbolicExpressionTreeParameter.Depth);149 OperationCollection operations = new OperationCollection();150 foreach (IScope treeScopes in scopes) {151 operations.Add(ExecutionContext.CreateChildOperation(OperatorGraph.InitialOperator, treeScopes));152 }153 if (Successor != null) operations.Add(ExecutionContext.CreateOperation(Successor));154 return operations;155 }156 157 private IEnumerable<IScope> GetScopesOnLevel(IScope scope, int d) {158 if (d == 0) yield return scope;159 else {160 foreach (IScope subScope in scope.SubScopes) {161 foreach (IScope scopesOfSubScope in GetScopesOnLevel(subScope, d - 1)) {162 yield return scopesOfSubScope;163 }164 }165 }166 }167 146 } 168 147 } -
trunk/sources/HeuristicLab.Problems.DataAnalysis.Regression/3.3/Symbolic/Analyzers/SymbolicRegressionSolutionLinearScaler.cs
r3683 r3710 47 47 private const string BetaParameterName = "Beta"; 48 48 49 public ScopeTreeLookupParameter<SymbolicExpressionTree> SymbolicExpressionTreeParameter {50 get { return ( ScopeTreeLookupParameter<SymbolicExpressionTree>)Parameters[SymbolicExpressionTreeParameterName]; }49 public ILookupParameter<SymbolicExpressionTree> SymbolicExpressionTreeParameter { 50 get { return (ILookupParameter<SymbolicExpressionTree>)Parameters[SymbolicExpressionTreeParameterName]; } 51 51 } 52 public ScopeTreeLookupParameter<SymbolicExpressionTree> ScaledSymbolicExpressionTreeParameter {53 get { return ( ScopeTreeLookupParameter<SymbolicExpressionTree>)Parameters[ScaledSymbolicExpressionTreeParameterName]; }52 public ILookupParameter<SymbolicExpressionTree> ScaledSymbolicExpressionTreeParameter { 53 get { return (ILookupParameter<SymbolicExpressionTree>)Parameters[ScaledSymbolicExpressionTreeParameterName]; } 54 54 } 55 public ScopeTreeLookupParameter<DoubleValue> AlphaParameter {56 get { return ( ScopeTreeLookupParameter<DoubleValue>)Parameters[AlphaParameterName]; }55 public ILookupParameter<DoubleValue> AlphaParameter { 56 get { return (ILookupParameter<DoubleValue>)Parameters[AlphaParameterName]; } 57 57 } 58 public ScopeTreeLookupParameter<DoubleValue> BetaParameter {59 get { return ( ScopeTreeLookupParameter<DoubleValue>)Parameters[BetaParameterName]; }58 public ILookupParameter<DoubleValue> BetaParameter { 59 get { return (ILookupParameter<DoubleValue>)Parameters[BetaParameterName]; } 60 60 } 61 61 62 62 public SymbolicRegressionSolutionLinearScaler() 63 63 : base() { 64 Parameters.Add(new ScopeTreeLookupParameter<SymbolicExpressionTree>(SymbolicExpressionTreeParameterName, "The symbolic expression trees to transform."));65 Parameters.Add(new ScopeTreeLookupParameter<SymbolicExpressionTree>(ScaledSymbolicExpressionTreeParameterName, "The resulting symbolic expression trees after transformation."));66 Parameters.Add(new ScopeTreeLookupParameter<DoubleValue>(AlphaParameterName, "Alpha parameter for linear transformation."));67 Parameters.Add(new ScopeTreeLookupParameter<DoubleValue>(BetaParameterName, "Beta parameter for linear transformation."));64 Parameters.Add(new LookupParameter<SymbolicExpressionTree>(SymbolicExpressionTreeParameterName, "The symbolic expression trees to transform.")); 65 Parameters.Add(new LookupParameter<SymbolicExpressionTree>(ScaledSymbolicExpressionTreeParameterName, "The resulting symbolic expression trees after transformation.")); 66 Parameters.Add(new LookupParameter<DoubleValue>(AlphaParameterName, "Alpha parameter for linear transformation.")); 67 Parameters.Add(new LookupParameter<DoubleValue>(BetaParameterName, "Beta parameter for linear transformation.")); 68 68 } 69 69 70 70 public override IOperation Apply() { 71 ItemArray<SymbolicExpressionTree> trees = SymbolicExpressionTreeParameter.ActualValue; 72 ItemArray<DoubleValue> alphas = AlphaParameter.ActualValue; 73 ItemArray<DoubleValue> betas = BetaParameter.ActualValue; 74 ItemArray<SymbolicExpressionTree> scaledTrees = new ItemArray<SymbolicExpressionTree>(trees.Length); 75 for (int i = 0; i < trees.Length; i++) { 76 var mainBranch = trees[i].Root.SubTrees[0].SubTrees[0]; 77 var scaledMainBranch = MakeSum(MakeProduct(betas[i].Value, mainBranch), alphas[i].Value); 71 SymbolicExpressionTree tree = SymbolicExpressionTreeParameter.ActualValue; 72 DoubleValue alpha = AlphaParameter.ActualValue; 73 DoubleValue beta = BetaParameter.ActualValue; 74 var mainBranch = tree.Root.SubTrees[0].SubTrees[0]; 75 var scaledMainBranch = MakeSum(MakeProduct(beta.Value, mainBranch), alpha.Value); 78 76 79 // remove the main branch before cloning to prevent cloning of sub-trees 80 trees[i].Root.SubTrees[0].RemoveSubTree(0); 81 var scaledTree = (SymbolicExpressionTree)trees[i].Clone(); 82 // insert main branch into the original tree again 83 trees[i].Root.SubTrees[0].InsertSubTree(0, mainBranch); 84 // insert the scaled main branch into the cloned tree 85 scaledTree.Root.SubTrees[0].InsertSubTree(0, scaledMainBranch); 86 scaledTrees[i] = scaledTree; 87 } 88 ScaledSymbolicExpressionTreeParameter.ActualValue = scaledTrees; 77 // remove the main branch before cloning to prevent cloning of sub-trees 78 tree.Root.SubTrees[0].RemoveSubTree(0); 79 var scaledTree = (SymbolicExpressionTree)tree.Clone(); 80 // insert main branch into the original tree again 81 tree.Root.SubTrees[0].InsertSubTree(0, mainBranch); 82 // insert the scaled main branch into the cloned tree 83 scaledTree.Root.SubTrees[0].InsertSubTree(0, scaledMainBranch); 84 ScaledSymbolicExpressionTreeParameter.ActualValue = scaledTree; 89 85 return base.Apply(); 90 86 } -
trunk/sources/HeuristicLab.Problems.DataAnalysis.Regression/3.3/Symbolic/Analyzers/ValidationBestScaledSymbolicRegressionSolutionAnalyzer.cs
r3683 r3710 56 56 private const string AlphaParameterName = "Alpha"; 57 57 private const string BetaParameterName = "Beta"; 58 private const string BestSolutionParameterName = "ValidationBestSolution"; 59 private const string BestSolutionQualityParameterName = "ValidationBestSolutionQuality"; 58 private const string BestSolutionParameterName = "Best solution (validation)"; 59 private const string BestSolutionQualityParameterName = "Best solution quality (validation)"; 60 private const string CurrentBestValidationQualityParameterName = "Current best validation quality"; 60 61 private const string ResultsParameterName = "Results"; 61 62 … … 91 92 } 92 93 93 [Storable]94 private BestQualityMemorizer validationQualityMemorizer;95 94 [Storable] 96 95 private BestSymbolicRegressionSolutionAnalyzer bestSolutionAnalyzer; 97 96 [Storable] 98 private SymbolicRegressionSolutionLinearScaler linearScaler;97 private UniformSubScopesProcessor subScopesProcessor; 99 98 [Storable] 100 private SymbolicRegressionMeanSquaredErrorCalculator validationMseCalculator;99 private BestAverageWorstQualityCalculator bestAvgWorstValidationQualityCalculator; 101 100 102 101 public ValidationBestScaledSymbolicRegressionSolutionAnalyzer() … … 114 113 115 114 #region operator initialization 116 linearScaler = new SymbolicRegressionSolutionLinearScaler(); 117 validationMseCalculator = new SymbolicRegressionMeanSquaredErrorCalculator(); 115 subScopesProcessor = new UniformSubScopesProcessor(); 116 SymbolicRegressionSolutionLinearScaler linearScaler = new SymbolicRegressionSolutionLinearScaler(); 117 SymbolicRegressionMeanSquaredErrorEvaluator validationMseEvaluator = new SymbolicRegressionMeanSquaredErrorEvaluator(); 118 118 bestSolutionAnalyzer = new BestSymbolicRegressionSolutionAnalyzer(); 119 validationQualityMemorizer = new BestQualityMemorizer(); 120 BestAverageWorstQualityCalculator bestAvgWorstValidationQualityCalculator = new BestAverageWorstQualityCalculator(); 119 bestAvgWorstValidationQualityCalculator = new BestAverageWorstQualityCalculator(); 121 120 DataTableValuesCollector validationValuesCollector = new DataTableValuesCollector(); 122 121 ResultsCollector resultsCollector = new ResultsCollector(); … … 124 123 125 124 #region parameter wiring 125 subScopesProcessor.Depth.Value = SymbolicExpressionTreeParameter.Depth; 126 126 127 linearScaler.AlphaParameter.ActualName = AlphaParameterName; 127 linearScaler.AlphaParameter.Depth = SymbolicExpressionTreeParameter.Depth;128 128 linearScaler.BetaParameter.ActualName = BetaParameterName; 129 linearScaler.BetaParameter.Depth = SymbolicExpressionTreeParameter.Depth;130 129 linearScaler.SymbolicExpressionTreeParameter.ActualName = SymbolicExpressionTreeParameter.Name; 131 linearScaler.SymbolicExpressionTreeParameter.Depth = SymbolicExpressionTreeParameter.Depth;132 130 linearScaler.ScaledSymbolicExpressionTreeParameter.ActualName = ScaledSymbolicExpressionTreeParameterName; 133 linearScaler.ScaledSymbolicExpressionTreeParameter.Depth = SymbolicExpressionTreeParameter.Depth; 134 135 validationMseCalculator.LowerEstimationLimitParameter.ActualName = LowerEstimationLimitParameter.Name; 136 validationMseCalculator.UpperEstimationLimitParameter.ActualName = UpperEstimationLimitParameter.Name; 137 validationMseCalculator.SymbolicExpressionTreeParameter.ActualName = ScaledSymbolicExpressionTreeParameterName; 138 validationMseCalculator.SymbolicExpressionTreeParameter.Depth = SymbolicExpressionTreeParameter.Depth; 139 validationMseCalculator.SymbolicExpressionTreeInterpreterParameter.ActualName = SymbolicExpressionTreeInterpreterParameter.Name; 140 validationMseCalculator.QualityParameter.ActualName = QualityParameterName; 141 validationMseCalculator.ProblemDataParameter.ActualName = ProblemDataParameter.Name; 142 validationMseCalculator.SamplesStartParameter.ActualName = SamplesStartParameter.Name; 143 validationMseCalculator.SamplesEndParameter.ActualName = SamplesEndParameter.Name; 131 132 validationMseEvaluator.LowerEstimationLimitParameter.ActualName = LowerEstimationLimitParameter.Name; 133 validationMseEvaluator.UpperEstimationLimitParameter.ActualName = UpperEstimationLimitParameter.Name; 134 validationMseEvaluator.SymbolicExpressionTreeParameter.ActualName = ScaledSymbolicExpressionTreeParameterName; 135 validationMseEvaluator.SymbolicExpressionTreeInterpreterParameter.ActualName = SymbolicExpressionTreeInterpreterParameter.Name; 136 validationMseEvaluator.QualityParameter.ActualName = QualityParameterName; 137 validationMseEvaluator.RegressionProblemDataParameter.ActualName = ProblemDataParameter.Name; 138 validationMseEvaluator.SamplesStartParameter.ActualName = SamplesStartParameter.Name; 139 validationMseEvaluator.SamplesEndParameter.ActualName = SamplesEndParameter.Name; 144 140 145 141 bestSolutionAnalyzer.BestSolutionParameter.ActualName = BestSolutionParameter.Name; … … 154 150 bestSolutionAnalyzer.UpperEstimationLimitParameter.ActualName = UpperEstimationLimitParameter.Name; 155 151 156 bestAvgWorstValidationQualityCalculator.AverageQualityParameter.ActualName = "Current Average Validation Quality";157 bestAvgWorstValidationQualityCalculator.BestQualityParameter.ActualName = "Current Best Validation Quality";152 bestAvgWorstValidationQualityCalculator.AverageQualityParameter.ActualName = "Current average validation quality"; 153 bestAvgWorstValidationQualityCalculator.BestQualityParameter.ActualName = CurrentBestValidationQualityParameterName; 158 154 bestAvgWorstValidationQualityCalculator.MaximizationParameter.Value = new BoolValue(false); 159 155 bestAvgWorstValidationQualityCalculator.QualityParameter.ActualName = QualityParameterName; 160 bestAvgWorstValidationQualityCalculator.WorstQualityParameter.ActualName = "Current Worst Validation Quality"; 161 162 validationQualityMemorizer.BestQualityParameter.ActualName = "Best Validation Quality"; 163 validationQualityMemorizer.QualityParameter.ActualName = QualityParameterName; 164 validationQualityMemorizer.QualityParameter.Depth = SymbolicExpressionTreeParameter.Depth; 165 166 validationValuesCollector.DataTableParameter.ActualName = "Validation Qualities"; 167 validationValuesCollector.CollectedValues.Add(new LookupParameter<DoubleValue>("Current Best Validation Quality", null, "Current Best Validation Quality")); 168 validationValuesCollector.CollectedValues.Add(new LookupParameter<DoubleValue>("Best Validation Quality", null, "Best Validation Quality")); 169 170 resultsCollector.CollectedValues.Add(new LookupParameter<DoubleValue>("Current Best Validation Quality", null, "Current Best Validation Quality")); 171 resultsCollector.CollectedValues.Add(new LookupParameter<DoubleValue>("Best Validation Quality", null, "Best Validation Quality")); 172 resultsCollector.CollectedValues.Add(new LookupParameter<DataTable>("Validation Qualities")); 156 bestAvgWorstValidationQualityCalculator.QualityParameter.Depth = SymbolicExpressionTreeParameter.Depth; 157 bestAvgWorstValidationQualityCalculator.WorstQualityParameter.ActualName = "Current worst validation quality"; 158 159 validationValuesCollector.DataTableParameter.ActualName = "Validation quality"; 160 validationValuesCollector.CollectedValues.Add(new LookupParameter<DoubleValue>(CurrentBestValidationQualityParameterName, null, CurrentBestValidationQualityParameterName)); 161 validationValuesCollector.CollectedValues.Add(new LookupParameter<DoubleValue>(BestSolutionQualityParameter.Name, null, BestSolutionQualityParameter.Name)); 162 163 resultsCollector.CollectedValues.Add(new LookupParameter<DoubleValue>(CurrentBestValidationQualityParameterName, null, CurrentBestValidationQualityParameterName)); 164 resultsCollector.CollectedValues.Add(new LookupParameter<DoubleValue>(BestSolutionQualityParameter.Name, null, BestSolutionQualityParameter.Name)); 165 resultsCollector.CollectedValues.Add(new LookupParameter<DataTable>("Validation quality")); 173 166 resultsCollector.ResultsParameter.ActualName = ResultsParameter.Name; 174 167 #endregion 175 168 176 169 #region operator graph 177 OperatorGraph.InitialOperator = linearScaler; 178 linearScaler.Successor = validationMseCalculator; 179 validationMseCalculator.Successor = bestSolutionAnalyzer; 170 OperatorGraph.InitialOperator = subScopesProcessor; 171 subScopesProcessor.Operator = linearScaler; 172 linearScaler.Successor = validationMseEvaluator; 173 validationMseEvaluator.Successor = null; 174 subScopesProcessor.Successor = bestSolutionAnalyzer; 180 175 bestSolutionAnalyzer.Successor = bestAvgWorstValidationQualityCalculator; 181 bestAvgWorstValidationQualityCalculator.Successor = validationQualityMemorizer; 182 validationQualityMemorizer.Successor = validationValuesCollector; 176 bestAvgWorstValidationQualityCalculator.Successor = validationValuesCollector; 183 177 validationValuesCollector.Successor = resultsCollector; 184 178 resultsCollector.Successor = null; … … 203 197 204 198 private void SymbolicExpressionTreeParameter_DepthChanged(object sender, EventArgs e) { 205 validationMseCalculator.SymbolicExpressionTreeParameter.Depth = SymbolicExpressionTreeParameter.Depth; 206 validationQualityMemorizer.QualityParameter.Depth = SymbolicExpressionTreeParameter.Depth; 199 subScopesProcessor.Depth.Value = SymbolicExpressionTreeParameter.Depth; 207 200 bestSolutionAnalyzer.SymbolicExpressionTreeParameter.Depth = SymbolicExpressionTreeParameter.Depth; 208 201 bestSolutionAnalyzer.QualityParameter.Depth = SymbolicExpressionTreeParameter.Depth; 209 linearScaler.AlphaParameter.Depth = SymbolicExpressionTreeParameter.Depth; 210 linearScaler.BetaParameter.Depth = SymbolicExpressionTreeParameter.Depth; 211 linearScaler.SymbolicExpressionTreeParameter.Depth = SymbolicExpressionTreeParameter.Depth; 212 linearScaler.ScaledSymbolicExpressionTreeParameter.Depth = SymbolicExpressionTreeParameter.Depth; 202 bestAvgWorstValidationQualityCalculator.QualityParameter.Depth = SymbolicExpressionTreeParameter.Depth; 213 203 } 214 204 } -
trunk/sources/HeuristicLab.Problems.DataAnalysis.Regression/3.3/Symbolic/SymbolicRegressionSolution.cs
r3513 r3710 28 28 using System.Collections.Generic; 29 29 using System.Linq; 30 using System.Drawing; 30 31 31 32 namespace HeuristicLab.Problems.DataAnalysis.Regression.Symbolic { … … 36 37 [StorableClass] 37 38 public sealed class SymbolicRegressionSolution : DataAnalysisSolution { 39 public override Image ItemImage { 40 get { return HeuristicLab.Common.Resources.VS2008ImageLibrary.Function; } 41 } 38 42 [Storable] 39 43 private SymbolicRegressionModel model; -
trunk/sources/HeuristicLab.Problems.DataAnalysis.Views/3.3/ScatterPlotView.cs
r3707 r3710 122 122 123 123 private void UpdateCursorInterval() { 124 var estimatedValues = this.chart.Series[ALL_SERIES].Points.Select(x => x. YValues[0]).DefaultIfEmpty(1.0);125 var targetValues = this.chart.Series[ALL_SERIES].Points.Select(x => x.YValues[ 1]).DefaultIfEmpty(1.0);124 var estimatedValues = this.chart.Series[ALL_SERIES].Points.Select(x => x.XValue).DefaultIfEmpty(1.0); 125 var targetValues = this.chart.Series[ALL_SERIES].Points.Select(x => x.YValues[0]).DefaultIfEmpty(1.0); 126 126 double estimatedValuesRange = estimatedValues.Max() - estimatedValues.Min(); 127 127 double targetValuesRange = targetValues.Max() - targetValues.Min(); … … 170 170 this.chart.Series[ALL_SERIES].Points.Clear(); 171 171 this.chart.Series[TRAINING_SERIES].Points.Clear(); 172 this.chart.Series[TEST_SERIES].Points.Clear(); 172 this.chart.Series[TEST_SERIES].Points.Clear(); 173 173 } 174 174 -
trunk/sources/HeuristicLab.Problems.DataAnalysis/3.3/DataAnalysisSolution.cs
r3549 r3710 78 78 public abstract IEnumerable<double> EstimatedTestValues { get; } 79 79 80 protected DataAnalysisSolution() : base() { } 80 protected DataAnalysisSolution() : base() { 81 Name = ItemName; 82 Description = ItemDescription; 83 } 81 84 protected DataAnalysisSolution(DataAnalysisProblemData problemData) : this(problemData, double.NegativeInfinity, double.PositiveInfinity) { } 82 85 protected DataAnalysisSolution(DataAnalysisProblemData problemData, double lowerEstimationLimit, double upperEstimationLimit)
Note: See TracChangeset
for help on using the changeset viewer.