Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
04/02/15 16:35:59 (9 years ago)
Author:
bburlacu
Message:

#1772: Updated genealogy graph view and worked on subtree sample count.

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  
    4545    private const string BuildingBlocksFrequenciesTableName = "Building blocks frequencies";
    4646
    47 
    4847    // store evaluations of building blocks for phenotypic matching
    4948    private readonly Dictionary<string, List<double>> evaluationMap = new Dictionary<string, List<double>>();
     
    141140      var dataset = ProblemDataParameter.ActualValue.Dataset;
    142141      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);
    145143
    146144      foreach (var key in evaluationMap.Keys) {
     
    154152            var s = nodes[i];
    155153            var values = interpreter.GetValues(s, dataset, rows);
     154            OnlineCalculatorError error;
    156155            var r2 = OnlinePearsonsRSquaredCalculator.Calculate(values, evaluationMap[key], out error);
    157156            if (error == OnlineCalculatorError.None && r2 >= PhenotypicSimilarityThreshold) {
     
    163162      }
    164163      var table = (DataTable)results[BuildingBlocksFrequenciesTableName].Value;
     164      double max = bbFrequencies.Max(x => x.Value);
    165165      foreach (var pair in bbFrequencies) {
     166        var formatter = new SymbolicExpressionTreeStringFormatter();
     167        //        var label = formatter.Format(fragmentMap[pair.Key]) + "(" + prettyLabels[pair.Key] + ")";
    166168        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        }
    168179      }
    169180
     
    227238      table.Rows.Clear();
    228239      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 } });
    230241      }
    231242    }
  • branches/HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Tracking/Analyzers/SymbolicDataAnalysisSubtreeSampleCountAnalyzer.cs

    r12265 r12283  
    104104          g.Weight = v.Weight;
    105105        }
     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        }
    106114      }
     115
    107116      return base.Apply();
    108117    }
  • branches/HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Tracking/TraceCalculator.cs

    r12265 r12283  
    249249        arc = new GenealogyGraphArc(current, last) { Data = td };
    250250        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++;
    261260      }
    262261    }
Note: See TracChangeset for help on using the changeset viewer.