Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
12/16/16 17:10:05 (8 years ago)
Author:
abeham
Message:

#2701:

  • Reusing similiarty calculator in BinaryMemPR
  • Fixing distance calculation for linear linkage and LinearLinkageMemPR
  • Small changes to base algorithm
  • Added biased model trainer for permutation (rank and fitness)
  • Fixing best known quality calculation for GCP
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/MemPRAlgorithm/HeuristicLab.Encodings.LinearLinkageEncoding/3.4/SimilarityCalculators/HammingSimilarityCalculator.cs

    r14471 r14496  
    4646    public static double CalculateSimilarity(LinearLinkage left, LinearLinkage right) {
    4747      if (left.Length != right.Length) throw new ArgumentException("Comparing encodings of unequal length");
    48       var dist = 0;
     48      var similarity = 0;
    4949      for (var i = 0; i < left.Length; i++) {
    50         if (left[i] != right[i]) dist++;
     50        if (left[i] == right[i]) similarity++;
    5151      }
    52       return dist / (double)left.Length;
     52      return similarity / (double)left.Length;
    5353    }
    5454
Note: See TracChangeset for help on using the changeset viewer.