コード例 #1
0
        private void AssociationRules(double minSup, double minConf)
        {
            var apriori = new Apriori(Tree);

            AssociationRule[] rules = apriori.GetAssociationRules(minSup, minConf);

            var sb = new StringBuilder();

            sb.AppendLine($"Association Rules minSup: {minSup}, minConf: {minConf}");

            foreach (var rule in rules.OrderByDescending(x => x.Confidence))
            {
                sb.AppendLine(rule.ToString());
            }

            string path = Path.Combine(DirectoryPath, $"{TreeName}-associationrules-{DoubleToString(minSup)}-{DoubleToString(minConf)}.txt");

            File.WriteAllText(path, sb.ToString());
        }