Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
02/23/17 10:42:58 (7 years ago)
Author:
abeham
Message:

#2457: working on identification of problem instances

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/PerformanceComparison/HeuristicLab.Analysis.FitnessLandscape/3.3/ProblemInstanceAnalysis/ProblemInstanceAnalyzer.cs

    r14678 r14691  
    7878      if (currentCharacteristics == null) return base.Apply();
    7979
    80       var order = Enumerable.Range(0, kbCharacteristics.Rows)
     80      var means = kbCharacteristics.GetRow(kbCharacteristics.Rows - 2).ToArray();
     81      var stdevs = kbCharacteristics.GetRow(kbCharacteristics.Rows - 1).ToArray();
     82
     83      for (var i = 0; i < means.Length; i++) {
     84        currentCharacteristics[i] = (currentCharacteristics[i] - means[i]) / stdevs[i];
     85      }
     86
     87      var order = Enumerable.Range(0, kbCharacteristics.Rows - 2)
    8188        .Select(row => new { Row = row, MSE = kbCharacteristics.GetRow(row).Zip(currentCharacteristics, (a, b) => (a - b) * (a - b)).Average() })
    8289        .OrderBy(x => x.MSE);
    8390
    8491      var instances = kbCharacteristics.RowNames.ToList();
    85       while (instances.Count < kbCharacteristics.Rows)
     92      while (instances.Count < kbCharacteristics.Rows - 2)
    8693        instances.Add(instances.Count.ToString(CultureInfo.CurrentCulture.NumberFormat));
    8794
Note: See TracChangeset for help on using the changeset viewer.