private IList <Rule> GetStrongRules(double minConfidence, HashSet <Rule> rules) { var strongRules = new List <Rule>(); foreach (Rule rule in rules) { string xy = Apriori.Sort(rule.X + rule.Y); AddStrongRule(rule, xy, strongRules, minConfidence); } strongRules.Sort(); return(strongRules); }
private Dictionary <string, double> GenerateCandidates(IList <Item> frequentItems) { Dictionary <string, double> candidates = new Dictionary <string, double>(); for (int i = 0; i < frequentItems.Count - 1; i++) { string firstItem = Apriori.Sort(frequentItems[i].Name); for (int j = i + 1; j < frequentItems.Count; j++) { string secondItem = Apriori.Sort(frequentItems[j].Name); string generatedCandidate = GenerateCandidate(firstItem, secondItem); if (generatedCandidate != string.Empty) { candidates.Add(generatedCandidate, GetSupport(generatedCandidate)); } } } return(candidates); }
public override int GetHashCode() { return(Apriori.Sort(X + Y).GetHashCode()); }