Changeset 12283 for branches/HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Analyzers/BuildingBlockAnalyzers
- Timestamp:
- 04/02/15 16:35:59 (10 years ago)
- File:
-
- 1 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 }
Note: See TracChangeset
for help on using the changeset viewer.