Changeset 12283 for branches/HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic
- Timestamp:
- 04/02/15 16:35:59 (10 years ago)
- Location:
- branches/HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Analyzers/BuildingBlockAnalyzers/SymbolicDataAnalysisPoly10Analyzer.cs
r11493 r12283 45 45 private const string BuildingBlocksFrequenciesTableName = "Building blocks frequencies"; 46 46 47 48 47 // store evaluations of building blocks for phenotypic matching 49 48 private readonly Dictionary<string, List<double>> evaluationMap = new Dictionary<string, List<double>>(); … … 141 140 var dataset = ProblemDataParameter.ActualValue.Dataset; 142 141 var rows = ProblemDataParameter.ActualValue.TrainingIndices.ToList(); 143 OnlineCalculatorError error; 144 Dictionary<string, int> bbFrequencies = evaluationMap.Keys.ToDictionary(x => x, x => 0); 142 var bbFrequencies = evaluationMap.Keys.ToDictionary(x => x, x => 0); 145 143 146 144 foreach (var key in evaluationMap.Keys) { … … 154 152 var s = nodes[i]; 155 153 var values = interpreter.GetValues(s, dataset, rows); 154 OnlineCalculatorError error; 156 155 var r2 = OnlinePearsonsRSquaredCalculator.Calculate(values, evaluationMap[key], out error); 157 156 if (error == OnlineCalculatorError.None && r2 >= PhenotypicSimilarityThreshold) { … … 163 162 } 164 163 var table = (DataTable)results[BuildingBlocksFrequenciesTableName].Value; 164 double max = bbFrequencies.Max(x => x.Value); 165 165 foreach (var pair in bbFrequencies) { 166 var formatter = new SymbolicExpressionTreeStringFormatter(); 167 // var label = formatter.Format(fragmentMap[pair.Key]) + "(" + prettyLabels[pair.Key] + ")"; 166 168 var label = prettyLabels[pair.Key]; 167 table.Rows[label].Values.Add(pair.Value); 169 if (table.Rows.ContainsKey(label)) { 170 var row = table.Rows[label]; 171 // scale previous values according to the new max 172 // if (row.Values.Count > 0) { 173 // var values = new List<double>(row.Values); 174 // var m = values.Max(); 175 // row.Values.Replace(values.Select(x => x * m / max)); 176 // } 177 row.Values.Add(max > 0 ? pair.Value / max : 0); 178 } 168 179 } 169 180 … … 227 238 table.Rows.Clear(); 228 239 foreach (var key in evaluationMap.Keys) { 229 table.Rows.Add(new DataRow(prettyLabels[key]) );240 table.Rows.Add(new DataRow(prettyLabels[key]) { VisualProperties = { StartIndexZero = true } }); 230 241 } 231 242 } -
branches/HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Tracking/Analyzers/SymbolicDataAnalysisSubtreeSampleCountAnalyzer.cs
r12265 r12283 104 104 g.Weight = v.Weight; 105 105 } 106 107 // analyze subtree frequencies 108 foreach (var v in PopulationGraph.GetByRank(Generation.Value)) { 109 var g = (IGenealogyGraphNode<ISymbolicExpressionTree>)v; 110 var t = g.Data; 111 112 113 } 106 114 } 115 107 116 return base.Apply(); 108 117 } -
branches/HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Tracking/TraceCalculator.cs
r12265 r12283 249 249 arc = new GenealogyGraphArc(current, last) { Data = td }; 250 250 TraceGraph.AddArc(arc); 251 } else { 252 if (UpdateVertexWeights) { 253 arc.Weight++; 254 current.Weight++; 255 } 256 if (UpdateSubtreeWeights) { 257 var subtree = NodeAt(current.Data, td.SubtreeIndex); 258 foreach (var s in subtree.IterateNodesPrefix()) 259 s.NodeWeight++; 260 } 251 } 252 if (UpdateVertexWeights) { 253 arc.Weight++; 254 current.Weight++; 255 } 256 if (UpdateSubtreeWeights) { 257 var subtree = NodeAt(current.Data, td.SubtreeIndex); 258 foreach (var s in subtree.IterateNodesPrefix()) 259 s.NodeWeight++; 261 260 } 262 261 }
Note: See TracChangeset
for help on using the changeset viewer.