Changeset 17434 for branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Analyzers
- Timestamp:
- 02/11/20 13:36:02 (5 years ago)
- Location:
- branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic
- Files:
-
- 21 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic
- Property svn:mergeinfo changed
-
branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Analyzers
- Property svn:ignore
-
old new 1 BuidingBlocks 1 SymbolicDataAnalysisBuildingBlockAnalyzer.cs 2 SymbolicDataAnalysisHashBasedDiversityAnalyzer.cs
-
- Property svn:ignore
-
branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Analyzers/BuildingBlockAnalyzers/SymbolicDataAnalysisPoly10Analyzer.cs
r12891 r17434 20 20 #endregion 21 21 22 using System; 23 using System.Collections.Generic; 24 using System.Linq; 22 using HEAL.Attic; 25 23 using HeuristicLab.Common; 26 24 using HeuristicLab.Core; … … 29 27 using HeuristicLab.Optimization; 30 28 using HeuristicLab.Parameters; 31 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 29 using System; 30 using System.Collections.Generic; 31 using System.Linq; 32 32 using DataRow = HeuristicLab.Analysis.DataRow; 33 33 using DataTable = HeuristicLab.Analysis.DataTable; 34 34 35 namespace HeuristicLab.Problems.DataAnalysis.Symbolic.Analyzers.BuidingBlocks { 35 namespace HeuristicLab.Problems.DataAnalysis.Symbolic 36 { 36 37 [Item("Poly-10 building blocks analyzer", "An analyzer which attempts to identify parts of the Poly-10 formula")] 37 [StorableClass] 38 public class SymbolicDataAnalysisPoly10Analyzer : SymbolicDataAnalysisAnalyzer { 38 [StorableType("FA93D06D-B7CE-428A-8B22-ACB9A2BCE3CB")] 39 public class SymbolicDataAnalysisPoly10Analyzer : SymbolicDataAnalysisAnalyzer 40 { 39 41 private const string SymbolicDataAnalysisTreeInterpreterParameterName = "SymbolicExpressionTreeInterpreter"; 40 42 private const string ProblemDataParameterName = "ProblemData"; … … 94 96 #endregion 95 97 96 public SymbolicDataAnalysisPoly10Analyzer() { 98 public SymbolicDataAnalysisPoly10Analyzer() 99 { 97 100 #region Add parameters 98 101 Parameters.Add(new LookupParameter<IDataAnalysisProblemData>(ProblemDataParameterName)); … … 106 109 107 110 [StorableConstructor] 108 protected SymbolicDataAnalysisPoly10Analyzer(bool deserializing) 109 : base(deserializing) { 110 } 111 protected SymbolicDataAnalysisPoly10Analyzer(StorableConstructorFlag _) : base(_) { } 111 112 112 113 protected SymbolicDataAnalysisPoly10Analyzer(SymbolicDataAnalysisPoly10Analyzer original, Cloner cloner) 113 : base(original, cloner) { 114 } 115 116 public override IDeepCloneable Clone(Cloner cloner) { 114 : base(original, cloner) 115 { 116 } 117 118 public override IDeepCloneable Clone(Cloner cloner) 119 { 117 120 return new SymbolicDataAnalysisPoly10Analyzer(this, cloner); 118 121 } … … 122 125 } 123 126 124 public override IOperation Apply() { 127 public override IOperation Apply() 128 { 125 129 #region Update counter & update interval 126 130 UpdateCounter++; 127 if (UpdateCounter != UpdateInterval) { 131 if (UpdateCounter != UpdateInterval) 132 { 128 133 return base.Apply(); 129 134 } … … 142 147 var bbFrequencies = evaluationMap.Keys.ToDictionary(x => x, x => 0); 143 148 144 foreach (var key in evaluationMap.Keys) { 149 foreach (var key in evaluationMap.Keys) 150 { 145 151 var bb = fragmentMap[key]; 146 152 int len = bb.GetLength(); 147 foreach (var t in trees) { 153 foreach (var t in trees) 154 { 148 155 var root = t.Root.GetSubtree(0).GetSubtree(0); 149 156 var nodes = root.IterateNodesPrefix().Where(x => x.GetLength() > len).ToList(); 150 157 151 for (int i = 0; i < nodes.Count; ++i) { 158 for (int i = 0; i < nodes.Count; ++i) 159 { 152 160 var s = nodes[i]; 153 161 var values = interpreter.GetValues(s, dataset, rows); … … 155 163 var r = OnlinePearsonsRCalculator.Calculate(values, evaluationMap[key], out error); 156 164 var r2 = error == OnlineCalculatorError.None ? r * r : double.NaN; 157 if (!double.IsNaN(r2) && r2 >= PhenotypicSimilarityThreshold) { 165 if (!double.IsNaN(r2) && r2 >= PhenotypicSimilarityThreshold) 166 { 158 167 bbFrequencies[key]++; 159 168 i += s.GetLength(); … … 163 172 } 164 173 var table = (DataTable)results[BuildingBlocksFrequenciesTableName].Value; 165 foreach (var pair in bbFrequencies) { 174 foreach (var pair in bbFrequencies) 175 { 166 176 var formatter = new SymbolicExpressionTreeStringFormatter(); 167 177 // var label = formatter.Format(fragmentMap[pair.Key]) + "(" + prettyLabels[pair.Key] + ")"; 168 178 var label = prettyLabels[pair.Key]; 169 if (table.Rows.ContainsKey(label)) { 179 if (table.Rows.ContainsKey(label)) 180 { 170 181 var row = table.Rows[label]; 171 182 row.Values.Add(pair.Value); … … 176 187 } 177 188 178 private void InitializeBuildingBlockCollection() { 189 private void InitializeBuildingBlockCollection() 190 { 179 191 #region Add building blocks 180 192 // building blocks … … 215 227 var rows = ProblemDataParameter.ActualValue.TrainingIndices.ToList(); 216 228 217 foreach (var s in new[] { s1, s2, s3, s4, s5, s6, s7, s8, s9, s10 }) { 229 foreach (var s in new[] { s1, s2, s3, s4, s5, s6, s7, s8, s9, s10 }) 230 { 218 231 if (evaluationMap.ContainsKey(s)) continue; 219 232 var t = importer.Import(s); … … 224 237 var results = ResultCollectionParameter.ActualValue; 225 238 DataTable table; 226 if (!results.ContainsKey(BuildingBlocksFrequenciesTableName)) { 239 if (!results.ContainsKey(BuildingBlocksFrequenciesTableName)) 240 { 227 241 table = new DataTable(BuildingBlocksFrequenciesTableName); 228 242 results.Add(new Result(BuildingBlocksFrequenciesTableName, table)); 229 } else { 243 } 244 else 245 { 230 246 table = (DataTable)results[BuildingBlocksFrequenciesTableName].Value; 231 247 } 232 248 table.Rows.Clear(); 233 foreach (var key in evaluationMap.Keys) { 249 foreach (var key in evaluationMap.Keys) 250 { 234 251 table.Rows.Add(new DataRow(prettyLabels[key]) { VisualProperties = { StartIndexZero = true } }); 235 252 } -
branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Analyzers/SymbolicDataAnalysisAlleleFrequencyAnalyzer.cs
r16130 r17434 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-2018Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. … … 29 29 using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding; 30 30 using HeuristicLab.Parameters; 31 using H euristicLab.Persistence.Default.CompositeSerializers.Storable;31 using HEAL.Attic; 32 32 33 33 namespace HeuristicLab.Problems.DataAnalysis.Symbolic { 34 34 [Item("SymbolicDataAnalysisAlleleFrequencyAnalyzer", "")] 35 [Storable Class]35 [StorableType("36383269-BEEF-4B2C-A95E-5A3DCE6B2DB8")] 36 36 public sealed class SymbolicDataAnalysisAlleleFrequencyAnalyzer : AlleleFrequencyAnalyzer<ISymbolicExpressionTree>, ISymbolicDataAnalysisAnalyzer { 37 37 private const string AlleleTreeDepthParameterName = "AlleleTreeDepth"; … … 58 58 59 59 [StorableConstructor] 60 private SymbolicDataAnalysisAlleleFrequencyAnalyzer( bool deserializing) : base(deserializing) { }60 private SymbolicDataAnalysisAlleleFrequencyAnalyzer(StorableConstructorFlag _) : base(_) { } 61 61 private SymbolicDataAnalysisAlleleFrequencyAnalyzer(SymbolicDataAnalysisAlleleFrequencyAnalyzer original, Cloner cloner) : base(original, cloner) { } 62 62 public SymbolicDataAnalysisAlleleFrequencyAnalyzer() -
branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Analyzers/SymbolicDataAnalysisAnalyzer.cs
r16130 r17434 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-2018Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. … … 26 26 using HeuristicLab.Optimization; 27 27 using HeuristicLab.Parameters; 28 using H euristicLab.Persistence.Default.CompositeSerializers.Storable;28 using HEAL.Attic; 29 29 30 30 namespace HeuristicLab.Problems.DataAnalysis.Symbolic { … … 32 32 /// Abstract base class for symbolic data analysis analyzers. 33 33 /// </summary> 34 [Storable Class]34 [StorableType("A88BA918-D933-449E-9816-8C2A509CC0C4")] 35 35 public abstract class SymbolicDataAnalysisAnalyzer : SingleSuccessorOperator, ISymbolicDataAnalysisAnalyzer { 36 36 private const string SymbolicExpressionTreeParameterName = "SymbolicExpressionTree"; … … 57 57 #endregion 58 58 [StorableConstructor] 59 protected SymbolicDataAnalysisAnalyzer( bool deserializing) : base(deserializing) { }59 protected SymbolicDataAnalysisAnalyzer(StorableConstructorFlag _) : base(_) { } 60 60 protected SymbolicDataAnalysisAnalyzer(SymbolicDataAnalysisAnalyzer original, Cloner cloner) 61 61 : base(original, cloner) { -
branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Analyzers/SymbolicDataAnalysisBottomUpDiversityAnalyzer.cs
r16130 r17434 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-2018Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. … … 23 23 using HeuristicLab.Common; 24 24 using HeuristicLab.Core; 25 using HEAL.Attic; 25 26 using HeuristicLab.Data; 26 27 using HeuristicLab.Parameters; 27 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;28 28 29 29 namespace HeuristicLab.Problems.DataAnalysis.Symbolic { 30 30 [Item("SymbolicDataAnalysisBottomUpDiversityAnalyzer", "A diversity analyzer based on the bottom-up distance between trees.")] 31 [Storable Class]31 [StorableType("822FB7E4-3CFF-4413-90EB-96E90CE1D1D4")] 32 32 public class SymbolicDataAnalysisBottomUpDiversityAnalyzer : PopulationSimilarityAnalyzer { 33 33 private const string MatchConstantValuesParameterName = "MatchConstantValues"; … … 58 58 59 59 [StorableConstructor] 60 protected SymbolicDataAnalysisBottomUpDiversityAnalyzer( bool deserializing) : base(deserializing) { }60 protected SymbolicDataAnalysisBottomUpDiversityAnalyzer(StorableConstructorFlag _) : base(_) { } 61 61 62 62 protected SymbolicDataAnalysisBottomUpDiversityAnalyzer(SymbolicDataAnalysisBottomUpDiversityAnalyzer original, Cloner cloner) -
branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Analyzers/SymbolicDataAnalysisGenealogyAnalyzer.cs
r12892 r17434 21 21 22 22 using System.Linq; 23 using HEAL.Attic; 23 24 using HeuristicLab.Common; 24 25 using HeuristicLab.Core; … … 28 29 using HeuristicLab.Optimization; 29 30 using HeuristicLab.Parameters; 30 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;31 31 32 32 namespace HeuristicLab.Problems.DataAnalysis.Symbolic { 33 33 [Item("SymbolicDataAnalysisGenealogyAnalyzer", "Genealogy analyzer for symbolic data analysis problems")] 34 [Storable Class]34 [StorableType("A3D2A9C6-D304-47F1-9F02-6ABA9A0F4428")] 35 35 public class SymbolicDataAnalysisGenealogyAnalyzer : GenealogyAnalyzer<ISymbolicExpressionTree> { 36 36 private const string EvaluatorParameterName = "Evaluator"; … … 85 85 86 86 [StorableConstructor] 87 protected SymbolicDataAnalysisGenealogyAnalyzer( bool deserializing) : base(deserializing) {87 protected SymbolicDataAnalysisGenealogyAnalyzer(StorableConstructorFlag _) : base(_) { 88 88 } 89 89 -
branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Analyzers/SymbolicDataAnalysisGeneticOperatorImprovementAnalyzer.cs
r14574 r17434 22 22 using System.Collections.Generic; 23 23 using System.Linq; 24 using HEAL.Attic; 24 25 using HeuristicLab.Analysis; 25 26 using HeuristicLab.Common; … … 30 31 using HeuristicLab.Optimization; 31 32 using HeuristicLab.Parameters; 32 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;33 33 34 34 namespace HeuristicLab.Problems.DataAnalysis.Symbolic.Analyzers { 35 [StorableClass]36 35 [Item("SymbolicDataAnalysisGeneticOperatorImprovementAnalyzer", "An analyzer which records the best and average genetic operator improvement")] 36 [StorableType("A139170C-FB98-49B0-884C-5BD20F296AC1")] 37 37 public class SymbolicDataAnalysisGeneticOperatorImprovementAnalyzer : EvolutionTrackingAnalyzer<ISymbolicExpressionTree> { 38 38 public const string QualityParameterName = "Quality"; … … 67 67 68 68 [StorableConstructor] 69 protected SymbolicDataAnalysisGeneticOperatorImprovementAnalyzer( bool deserializing) : base(deserializing) { }69 protected SymbolicDataAnalysisGeneticOperatorImprovementAnalyzer(StorableConstructorFlag _) : base(_) { } 70 70 71 71 public SymbolicDataAnalysisGeneticOperatorImprovementAnalyzer( -
branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Analyzers/SymbolicDataAnalysisMultiObjectiveAnalyzer.cs
r16130 r17434 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-2018Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. … … 24 24 using HeuristicLab.Data; 25 25 using HeuristicLab.Parameters; 26 using H euristicLab.Persistence.Default.CompositeSerializers.Storable;26 using HEAL.Attic; 27 27 28 28 namespace HeuristicLab.Problems.DataAnalysis.Symbolic { … … 30 30 /// Abstract base class for multi objective symbolic data analysis analyzers. 31 31 /// </summary> 32 [Storable Class]32 [StorableType("C9896773-7A11-4D68-86EC-DB04AE075637")] 33 33 public abstract class SymbolicDataAnalysisMultiObjectiveAnalyzer : SymbolicDataAnalysisAnalyzer, ISymbolicDataAnalysisMultiObjectiveAnalyzer { 34 34 private const string QualitiesParameterName = "Qualities"; … … 55 55 #endregion 56 56 [StorableConstructor] 57 protected SymbolicDataAnalysisMultiObjectiveAnalyzer( bool deserializing) : base(deserializing) { }57 protected SymbolicDataAnalysisMultiObjectiveAnalyzer(StorableConstructorFlag _) : base(_) { } 58 58 protected SymbolicDataAnalysisMultiObjectiveAnalyzer(SymbolicDataAnalysisMultiObjectiveAnalyzer original, Cloner cloner) 59 59 : base(original, cloner) { -
branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Analyzers/SymbolicDataAnalysisMultiObjectiveTrainingBestSolutionAnalyzer.cs
r16130 r17434 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-2018Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. … … 28 28 using HeuristicLab.Optimization; 29 29 using HeuristicLab.Parameters; 30 using H euristicLab.Persistence.Default.CompositeSerializers.Storable;30 using HEAL.Attic; 31 31 32 32 namespace HeuristicLab.Problems.DataAnalysis.Symbolic { … … 35 35 /// </summary> 36 36 [Item("SymbolicDataAnalysisMultiObjectiveTrainingBestSolutionAnalyzer", "An operator that analyzes the training best symbolic data analysis solution for multi objective symbolic data analysis problems.")] 37 [Storable Class]37 [StorableType("D43D38D1-EEA8-4DEF-AA95-6E941194D708")] 38 38 public abstract class SymbolicDataAnalysisMultiObjectiveTrainingBestSolutionAnalyzer<T> : SymbolicDataAnalysisMultiObjectiveAnalyzer 39 39 where T : class, ISymbolicDataAnalysisSolution { … … 70 70 71 71 [StorableConstructor] 72 protected SymbolicDataAnalysisMultiObjectiveTrainingBestSolutionAnalyzer( bool deserializing) : base(deserializing) { }72 protected SymbolicDataAnalysisMultiObjectiveTrainingBestSolutionAnalyzer(StorableConstructorFlag _) : base(_) { } 73 73 protected SymbolicDataAnalysisMultiObjectiveTrainingBestSolutionAnalyzer(SymbolicDataAnalysisMultiObjectiveTrainingBestSolutionAnalyzer<T> original, Cloner cloner) : base(original, cloner) { } 74 74 public SymbolicDataAnalysisMultiObjectiveTrainingBestSolutionAnalyzer() -
branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Analyzers/SymbolicDataAnalysisMultiObjectiveValidationAnalyzer.cs
r16130 r17434 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-2018Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. … … 27 27 using HeuristicLab.Data; 28 28 using HeuristicLab.Parameters; 29 using H euristicLab.Persistence.Default.CompositeSerializers.Storable;29 using HEAL.Attic; 30 30 using HeuristicLab.Random; 31 31 … … 34 34 /// Abstract base class for symbolic data analysis analyzers that validate a solution on a separate data partition using the evaluator. 35 35 /// </summary> 36 [Storable Class]36 [StorableType("506B8D0E-891C-453B-842C-18CB33F5CE32")] 37 37 public abstract class SymbolicDataAnalysisMultiObjectiveValidationAnalyzer<T, U> : SymbolicDataAnalysisMultiObjectiveAnalyzer, 38 38 ISymbolicDataAnalysisValidationAnalyzer<T, U> … … 68 68 69 69 [StorableConstructor] 70 protected SymbolicDataAnalysisMultiObjectiveValidationAnalyzer( bool deserializing) : base(deserializing) { }70 protected SymbolicDataAnalysisMultiObjectiveValidationAnalyzer(StorableConstructorFlag _) : base(_) { } 71 71 protected SymbolicDataAnalysisMultiObjectiveValidationAnalyzer(SymbolicDataAnalysisMultiObjectiveValidationAnalyzer<T, U> original, Cloner cloner) 72 72 : base(original, cloner) { -
branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Analyzers/SymbolicDataAnalysisMultiObjectiveValidationBestSolutionAnalyzer.cs
r16130 r17434 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-2018Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. … … 29 29 using HeuristicLab.Optimization; 30 30 using HeuristicLab.Parameters; 31 using H euristicLab.Persistence.Default.CompositeSerializers.Storable;31 using HEAL.Attic; 32 32 33 33 namespace HeuristicLab.Problems.DataAnalysis.Symbolic { … … 36 36 /// </summary> 37 37 [Item("SymbolicDataAnalysisMultiObjectiveValidationBestSolutionAnalyzer", "An operator that analyzes the validation best symbolic data analysis solution for multi objective symbolic data analysis problems.")] 38 [Storable Class]38 [StorableType("ABDCE5CB-E177-4382-B478-90372FE6D47F")] 39 39 public abstract class SymbolicDataAnalysisMultiObjectiveValidationBestSolutionAnalyzer<S, T, U> : SymbolicDataAnalysisMultiObjectiveValidationAnalyzer<T, U>, 40 40 ISymbolicDataAnalysisMultiObjectiveAnalyzer … … 72 72 73 73 [StorableConstructor] 74 protected SymbolicDataAnalysisMultiObjectiveValidationBestSolutionAnalyzer( bool deserializing) : base(deserializing) { }74 protected SymbolicDataAnalysisMultiObjectiveValidationBestSolutionAnalyzer(StorableConstructorFlag _) : base(_) { } 75 75 protected SymbolicDataAnalysisMultiObjectiveValidationBestSolutionAnalyzer(SymbolicDataAnalysisMultiObjectiveValidationBestSolutionAnalyzer<S, T, U> original, Cloner cloner) : base(original, cloner) { } 76 76 public SymbolicDataAnalysisMultiObjectiveValidationBestSolutionAnalyzer() … … 177 177 } 178 178 179 [StorableType("69cfeefe-8654-4d07-93f1-fdca6fe02338")] 179 180 private class DoubleArrayComparer : IEqualityComparer<double[]> { 180 181 public bool Equals(double[] x, double[] y) { -
branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Analyzers/SymbolicDataAnalysisSingleObjectiveAnalyzer.cs
r16130 r17434 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-2018Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. … … 24 24 using HeuristicLab.Data; 25 25 using HeuristicLab.Parameters; 26 using H euristicLab.Persistence.Default.CompositeSerializers.Storable;26 using HEAL.Attic; 27 27 28 28 namespace HeuristicLab.Problems.DataAnalysis.Symbolic { … … 30 30 /// Abstract base class for single objective symbolic data analysis analyzers. 31 31 /// </summary> 32 [Storable Class]32 [StorableType("D5972132-2908-4878-97C5-C423164FCF65")] 33 33 public abstract class SymbolicDataAnalysisSingleObjectiveAnalyzer : SymbolicDataAnalysisAnalyzer, ISymbolicDataAnalysisSingleObjectiveAnalyzer { 34 34 private const string QualityParameterName = "Quality"; … … 56 56 #endregion 57 57 [StorableConstructor] 58 protected SymbolicDataAnalysisSingleObjectiveAnalyzer( bool deserializing) : base(deserializing) { }58 protected SymbolicDataAnalysisSingleObjectiveAnalyzer(StorableConstructorFlag _) : base(_) { } 59 59 protected SymbolicDataAnalysisSingleObjectiveAnalyzer(SymbolicDataAnalysisSingleObjectiveAnalyzer original, Cloner cloner) 60 60 : base(original, cloner) { -
branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Analyzers/SymbolicDataAnalysisSingleObjectivePruningAnalyzer.cs
r16130 r17434 2 2 3 3 /* HeuristicLab 4 * Copyright (C) 2002-2018Heuristic and Evolutionary Algorithms Laboratory (HEAL)4 * Copyright (C) Heuristic and Evolutionary Algorithms Laboratory (HEAL) 5 5 * 6 6 * This file is part of HeuristicLab. … … 31 31 using HeuristicLab.Optimization.Operators; 32 32 using HeuristicLab.Parameters; 33 using H euristicLab.Persistence.Default.CompositeSerializers.Storable;33 using HEAL.Attic; 34 34 35 35 namespace HeuristicLab.Problems.DataAnalysis.Symbolic { 36 [Storable Class]36 [StorableType("83603E95-3CBD-476C-B11F-B30C80ACD0D3")] 37 37 [Item("SymbolicDataAnalysisSingleObjectivePruningAnalyzer", "An analyzer that prunes introns from trees in single objective symbolic data analysis problems.")] 38 38 public abstract class SymbolicDataAnalysisSingleObjectivePruningAnalyzer : SymbolicDataAnalysisSingleObjectiveAnalyzer { … … 117 117 118 118 [StorableConstructor] 119 protected SymbolicDataAnalysisSingleObjectivePruningAnalyzer( bool deserializing) : base(deserializing) { }119 protected SymbolicDataAnalysisSingleObjectivePruningAnalyzer(StorableConstructorFlag _) : base(_) { } 120 120 121 121 protected SymbolicDataAnalysisSingleObjectivePruningAnalyzer(SymbolicDataAnalysisSingleObjectivePruningAnalyzer original, Cloner cloner) -
branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Analyzers/SymbolicDataAnalysisSingleObjectiveTrainingBestSolutionAnalyzer.cs
r16130 r17434 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-2018Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. … … 27 27 using HeuristicLab.Optimization; 28 28 using HeuristicLab.Parameters; 29 using H euristicLab.Persistence.Default.CompositeSerializers.Storable;29 using HEAL.Attic; 30 30 31 31 namespace HeuristicLab.Problems.DataAnalysis.Symbolic { … … 34 34 /// </summary> 35 35 [Item("SymbolicDataAnalysisSingleObjectiveTrainingBestSolutionAnalyzer", "An operator that analyzes the training best symbolic data analysis solution for single objective symbolic data analysis problems.")] 36 [Storable Class]36 [StorableType("DD82C026-CF68-40D7-A898-77EA6A872DE9")] 37 37 public abstract class SymbolicDataAnalysisSingleObjectiveTrainingBestSolutionAnalyzer<T> : SymbolicDataAnalysisSingleObjectiveAnalyzer, IIterationBasedOperator where T : class, ISymbolicDataAnalysisSolution { 38 38 private const string TrainingBestSolutionParameterName = "Best training solution"; … … 94 94 95 95 [StorableConstructor] 96 protected SymbolicDataAnalysisSingleObjectiveTrainingBestSolutionAnalyzer( bool deserializing) : base(deserializing) { }96 protected SymbolicDataAnalysisSingleObjectiveTrainingBestSolutionAnalyzer(StorableConstructorFlag _) : base(_) { } 97 97 protected SymbolicDataAnalysisSingleObjectiveTrainingBestSolutionAnalyzer(SymbolicDataAnalysisSingleObjectiveTrainingBestSolutionAnalyzer<T> original, Cloner cloner) : base(original, cloner) { } 98 98 public SymbolicDataAnalysisSingleObjectiveTrainingBestSolutionAnalyzer() -
branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Analyzers/SymbolicDataAnalysisSingleObjectiveTrainingParetoBestSolutionAnalyzer.cs
r16130 r17434 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-2018Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. … … 29 29 using HeuristicLab.Optimization; 30 30 using HeuristicLab.Parameters; 31 using H euristicLab.Persistence.Default.CompositeSerializers.Storable;31 using HEAL.Attic; 32 32 33 33 namespace HeuristicLab.Problems.DataAnalysis.Symbolic { … … 36 36 /// </summary> 37 37 [Item("SymbolicDataAnalysisSingleObjectiveTrainingParetoBestSolutionAnalyzer", "An operator that analyzes the Pareto-best symbolic data analysis solution for single objective symbolic data analysis problems.")] 38 [Storable Class]38 [StorableType("0C0557F2-DCBC-4699-9BA9-3E82C858605E")] 39 39 public abstract class SymbolicDataAnalysisSingleObjectiveTrainingParetoBestSolutionAnalyzer<S, T> : SymbolicDataAnalysisSingleObjectiveAnalyzer, ISymbolicDataAnalysisInterpreterOperator, ISymbolicDataAnalysisBoundedOperator 40 40 where T : class, ISymbolicDataAnalysisSolution … … 83 83 84 84 [StorableConstructor] 85 protected SymbolicDataAnalysisSingleObjectiveTrainingParetoBestSolutionAnalyzer( bool deserializing) : base(deserializing) { }85 protected SymbolicDataAnalysisSingleObjectiveTrainingParetoBestSolutionAnalyzer(StorableConstructorFlag _) : base(_) { } 86 86 protected SymbolicDataAnalysisSingleObjectiveTrainingParetoBestSolutionAnalyzer(SymbolicDataAnalysisSingleObjectiveTrainingParetoBestSolutionAnalyzer<S, T> original, Cloner cloner) : base(original, cloner) { } 87 87 public SymbolicDataAnalysisSingleObjectiveTrainingParetoBestSolutionAnalyzer() -
branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Analyzers/SymbolicDataAnalysisSingleObjectiveValidationAnalyzer.cs
r16130 r17434 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-2018Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. … … 28 28 using HeuristicLab.Optimization; 29 29 using HeuristicLab.Parameters; 30 using H euristicLab.Persistence.Default.CompositeSerializers.Storable;30 using HEAL.Attic; 31 31 using HeuristicLab.Random; 32 32 … … 35 35 /// Abstract base class for symbolic data analysis analyzers that validate a solution on a separate data partition using the evaluator. 36 36 /// </summary> 37 [Storable Class]37 [StorableType("B1A1F3CC-5C21-42F4-BED0-831E0D4AD1F6")] 38 38 public abstract class SymbolicDataAnalysisSingleObjectiveValidationAnalyzer<T, U> : SymbolicDataAnalysisSingleObjectiveAnalyzer, 39 39 ISymbolicDataAnalysisValidationAnalyzer<T, U>, IStochasticOperator … … 73 73 74 74 [StorableConstructor] 75 protected SymbolicDataAnalysisSingleObjectiveValidationAnalyzer( bool deserializing) : base(deserializing) { }75 protected SymbolicDataAnalysisSingleObjectiveValidationAnalyzer(StorableConstructorFlag _) : base(_) { } 76 76 protected SymbolicDataAnalysisSingleObjectiveValidationAnalyzer(SymbolicDataAnalysisSingleObjectiveValidationAnalyzer<T, U> original, Cloner cloner) 77 77 : base(original, cloner) { -
branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Analyzers/SymbolicDataAnalysisSingleObjectiveValidationBestSolutionAnalyzer.cs
r16130 r17434 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-2018Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. … … 29 29 using HeuristicLab.Optimization; 30 30 using HeuristicLab.Parameters; 31 using H euristicLab.Persistence.Default.CompositeSerializers.Storable;31 using HEAL.Attic; 32 32 33 33 namespace HeuristicLab.Problems.DataAnalysis.Symbolic { … … 36 36 /// </summary> 37 37 [Item("SymbolicDataAnalysisSingleObjectiveValidationBestSolutionAnalyzer", "An operator that analyzes the validation best symbolic data analysis solution for single objective symbolic data analysis problems.")] 38 [Storable Class]38 [StorableType("6A84F46D-0CC3-400D-BC3B-D7C6A86D958D")] 39 39 public abstract class SymbolicDataAnalysisSingleObjectiveValidationBestSolutionAnalyzer<S, T, U> : SymbolicDataAnalysisSingleObjectiveValidationAnalyzer<T, U>, IIterationBasedOperator 40 40 where S : class, ISymbolicDataAnalysisSolution … … 83 83 84 84 [StorableConstructor] 85 protected SymbolicDataAnalysisSingleObjectiveValidationBestSolutionAnalyzer( bool deserializing) : base(deserializing) { }85 protected SymbolicDataAnalysisSingleObjectiveValidationBestSolutionAnalyzer(StorableConstructorFlag _) : base(_) { } 86 86 protected SymbolicDataAnalysisSingleObjectiveValidationBestSolutionAnalyzer(SymbolicDataAnalysisSingleObjectiveValidationBestSolutionAnalyzer<S, T, U> original, Cloner cloner) : base(original, cloner) { } 87 87 public SymbolicDataAnalysisSingleObjectiveValidationBestSolutionAnalyzer() -
branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Analyzers/SymbolicDataAnalysisSingleObjectiveValidationParetoBestSolutionAnalyzer.cs
r16130 r17434 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-2018Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. … … 29 29 using HeuristicLab.Optimization; 30 30 using HeuristicLab.Parameters; 31 using H euristicLab.Persistence.Default.CompositeSerializers.Storable;31 using HEAL.Attic; 32 32 33 33 namespace HeuristicLab.Problems.DataAnalysis.Symbolic { … … 36 36 /// </summary> 37 37 [Item("SymbolicDataAnalysisSingleObjectiveValidationParetoBestSolutionAnalyzer", "An operator that analyzes the Pareto-best symbolic data analysis solution for single objective symbolic data analysis problems.")] 38 [Storable Class]38 [StorableType("892CE424-FAB0-4E78-8BC2-40BFD1F4A78A")] 39 39 public abstract class SymbolicDataAnalysisSingleObjectiveValidationParetoBestSolutionAnalyzer<S, T, U> : SymbolicDataAnalysisSingleObjectiveValidationAnalyzer<T, U>, ISymbolicDataAnalysisBoundedOperator 40 40 where S : class, ISymbolicDataAnalysisSolution … … 77 77 78 78 [StorableConstructor] 79 protected SymbolicDataAnalysisSingleObjectiveValidationParetoBestSolutionAnalyzer( bool deserializing) : base(deserializing) { }79 protected SymbolicDataAnalysisSingleObjectiveValidationParetoBestSolutionAnalyzer(StorableConstructorFlag _) : base(_) { } 80 80 protected SymbolicDataAnalysisSingleObjectiveValidationParetoBestSolutionAnalyzer(SymbolicDataAnalysisSingleObjectiveValidationParetoBestSolutionAnalyzer<S, T, U> original, Cloner cloner) : base(original, cloner) { } 81 81 public SymbolicDataAnalysisSingleObjectiveValidationParetoBestSolutionAnalyzer() -
branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Analyzers/SymbolicDataAnalysisUsefulGenesAnalyzer.cs
r13482 r17434 20 20 #endregion 21 21 22 using System; 23 using System.Collections.Generic; 24 using System.Linq; 22 using HEAL.Attic; 25 23 using HeuristicLab.Analysis; 26 24 using HeuristicLab.Common; … … 31 29 using HeuristicLab.Optimization; 32 30 using HeuristicLab.Parameters; 33 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 34 35 namespace HeuristicLab.Problems.DataAnalysis.Symbolic.Analyzers { 36 [StorableClass] 31 using System; 32 using System.Collections.Generic; 33 using System.Linq; 34 35 namespace HeuristicLab.Problems.DataAnalysis.Symbolic 36 { 37 37 [Item("SymbolicDataAnalysisUsefulGenesAnalyzer", "An analyzer which performs pruning by promoting genes in the population that outperform their containing individuals (the individuals are replaced by their subparts).")] 38 public class SymbolicDataAnalysisUsefulGenesAnalyzer : SingleSuccessorOperator, ISymbolicDataAnalysisAnalyzer { 38 [StorableType("2CB2C4EE-9360-4C81-B354-926510E0DCD0")] 39 public class SymbolicDataAnalysisUsefulGenesAnalyzer : SingleSuccessorOperator, ISymbolicDataAnalysisAnalyzer 40 { 39 41 private const string SymbolicExpressionTreeParameterName = "SymbolicExpressionTree"; 40 42 private const string QualityParameterName = "Quality"; … … 130 132 #endregion 131 133 132 public SymbolicDataAnalysisUsefulGenesAnalyzer() { 134 public SymbolicDataAnalysisUsefulGenesAnalyzer() 135 { 133 136 #region Add parameters 134 137 Parameters.Add(new ScopeTreeLookupParameter<ISymbolicExpressionTree>(SymbolicExpressionTreeParameterName)); … … 150 153 : base(original, cloner) { } 151 154 152 public override IDeepCloneable Clone(Cloner cloner) { 155 public override IDeepCloneable Clone(Cloner cloner) 156 { 153 157 return new SymbolicDataAnalysisUsefulGenesAnalyzer(this, cloner); 154 158 } 155 159 156 160 [StorableConstructor] 157 protected SymbolicDataAnalysisUsefulGenesAnalyzer(bool deserializing) 158 : base(deserializing) { 159 } 161 protected SymbolicDataAnalysisUsefulGenesAnalyzer(StorableConstructorFlag _) : base(_) { } 160 162 161 163 public bool EnabledByDefault { … … 163 165 } 164 166 165 public override void InitializeState() { 167 public override void InitializeState() 168 { 166 169 UpdateCounter = 0; 167 170 base.InitializeState(); 168 171 } 169 172 170 public override IOperation Apply() { 173 public override IOperation Apply() 174 { 171 175 int generations = GenerationsParameter.ActualValue.Value; 172 176 #region Update counter & update interval … … 174 178 return base.Apply(); 175 179 UpdateCounter++; 176 if (UpdateCounter != UpdateInterval) { 180 if (UpdateCounter != UpdateInterval) 181 { 177 182 return base.Apply(); 178 183 } … … 196 201 var count = (int)Math.Floor(trees.Length * PercentageOfBestSolutions); 197 202 198 for (int i = trees.Length - 1; i >= trees.Length - count; --i) { 203 for (int i = trees.Length - 1; i >= trees.Length - count; --i) 204 { 199 205 if (random.NextDouble() > PruningProbability) continue; 200 206 var tree = trees[i]; … … 202 208 var root = tree.Root.GetSubtree(0).GetSubtree(0); 203 209 204 foreach (var s in root.IterateNodesPrefix().Skip(1)) { 210 foreach (var s in root.IterateNodesPrefix().Skip(1)) 211 { 205 212 var r2 = EvaluateSubtree(s, interpreter, problemData, rows); 206 213 if (double.IsNaN(r2) || r2 <= quality) continue; … … 224 231 var results = ResultCollectionParameter.ActualValue; 225 232 DataTable table; 226 if (results.ContainsKey(PromotedSubtreesResultName)) { 233 if (results.ContainsKey(PromotedSubtreesResultName)) 234 { 227 235 table = (DataTable)results[PromotedSubtreesResultName].Value; 228 } else { 236 } 237 else 238 { 229 239 table = new DataTable(PromotedSubtreesResultName); 230 240 table.Rows.Add(new DataRow(PromotedSubtreesResultName)); … … 233 243 table.Rows[PromotedSubtreesResultName].Values.Add(replacedTrees); 234 244 235 if (results.ContainsKey(AverageQualityImprovementResultName)) { 245 if (results.ContainsKey(AverageQualityImprovementResultName)) 246 { 236 247 table = (DataTable)results[AverageQualityImprovementResultName].Value; 237 } else { 248 } 249 else 250 { 238 251 table = new DataTable(AverageQualityImprovementResultName); 239 252 table.Rows.Add(new DataRow(AverageQualityImprovementResultName)); … … 242 255 table.Rows[AverageQualityImprovementResultName].Values.Add(avgQualityImprovement); 243 256 244 if (results.ContainsKey(AverageLengthReductionResultName)) { 257 if (results.ContainsKey(AverageLengthReductionResultName)) 258 { 245 259 table = (DataTable)results[AverageLengthReductionResultName].Value; 246 } else { 260 } 261 else 262 { 247 263 table = new DataTable(AverageLengthReductionResultName); 248 264 table.Rows.Add(new DataRow(AverageLengthReductionResultName)); … … 254 270 } 255 271 256 private static double EvaluateSubtree(ISymbolicExpressionTreeNode subtree, ISymbolicDataAnalysisExpressionTreeInterpreter interpreter, IRegressionProblemData problemData, List<int> rows) { 272 private static double EvaluateSubtree(ISymbolicExpressionTreeNode subtree, ISymbolicDataAnalysisExpressionTreeInterpreter interpreter, IRegressionProblemData problemData, List<int> rows) 273 { 257 274 var linearInterpreter = (SymbolicDataAnalysisExpressionTreeLinearInterpreter)interpreter; 258 275 var dataset = problemData.Dataset; -
branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Analyzers/SymbolicDataAnalysisVariableFrequencyAnalyzer.cs
r16130 r17434 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-2018Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. … … 22 22 using System; 23 23 using System.Collections.Generic; 24 using System.Globalization;25 24 using System.Linq; 26 25 using HeuristicLab.Analysis; … … 31 30 using HeuristicLab.Optimization; 32 31 using HeuristicLab.Parameters; 33 using H euristicLab.Persistence.Default.CompositeSerializers.Storable;32 using HEAL.Attic; 34 33 35 34 namespace HeuristicLab.Problems.DataAnalysis.Symbolic { … … 38 37 /// </summary> 39 38 [Item("SymbolicDataAnalysisVariableFrequencyAnalyzer", "Calculates the accumulated frequencies of variable-symbols over all trees in the population.")] 40 [Storable Class]39 [StorableType("C7E9B375-6375-478F-8590-473BA567BA90")] 41 40 public sealed class SymbolicDataAnalysisVariableFrequencyAnalyzer : SymbolicDataAnalysisAnalyzer { 42 41 private const string VariableFrequenciesParameterName = "VariableFrequencies"; … … 70 69 #endregion 71 70 [StorableConstructor] 72 private SymbolicDataAnalysisVariableFrequencyAnalyzer( bool deserializing) : base(deserializing) { }71 private SymbolicDataAnalysisVariableFrequencyAnalyzer(StorableConstructorFlag _) : base(_) { } 73 72 private SymbolicDataAnalysisVariableFrequencyAnalyzer(SymbolicDataAnalysisVariableFrequencyAnalyzer original, Cloner cloner) 74 73 : base(original, cloner) {
Note: See TracChangeset
for help on using the changeset viewer.