示例#1
0
        static void Main(string[] args)
        {
            FileInputDatabaseHelper  inputHelper  = new FileInputDatabaseHelper("mushroom");
            FileOutputDatabaseHelper outputHelper = new FileOutputDatabaseHelper(@"D:\Data_Mining_Assignment\Apriori\Result\");
            AprioriAlgorithm         apriori      = new AprioriAlgorithm(inputHelper, outputHelper, 0.5f);

            apriori.GenerateFrequentItemSets();
        }
示例#2
0
文件: Program.cs 项目: tokichie/fp
        static void Main(string[] args)
        {
            IInputDatabaseHelper  inDatabaseHelper  = new FileInputDatabaseHelper("mushroom");
            IOutputDatabaseHelper outDatabaseHelper = new FileOutputDatabaseHelper(@"D:\Data_Mining_Assignment\FPGrowth\Result\");
            FPGrowth fpGrowth = new FPGrowth();

            fpGrowth.CreateFPTreeAndGenerateFrequentItemsets(
                inDatabaseHelper, outDatabaseHelper, 0.74f);
        }
示例#3
0
        static void Main(string[] args)
        {
            //pathin = Path.Combine("@", pathin);
            //pathout = Path.Combine("@", pathout);
            IInputDatabaseHelper  inDatabaseHelper  = new FileInputDatabaseHelper(pathin);
            IOutputDatabaseHelper outDatabaseHelper = new FileOutputDatabaseHelper(pathout);
            FPGrowth fpGrowth = new FPGrowth();

            fpGrowth.CreateFPTreeAndGenerateFrequentItemsets(
                inDatabaseHelper, outDatabaseHelper, 0.74f);
        }
        public void GenerateFrequentItemSetsTest()
        {
            IInputDatabaseHelper  _inDatabaseHelper  = new FileInputDatabaseHelper("mushroom");                                          // TODO: Initialize to an appropriate value
            IOutputDatabaseHelper _outDatabaseHelper = new FileOutputDatabaseHelper(@"D:\Data_Mining_Assignment\AprioriTests\Result\");; // TODO: Initialize to an appropriate value
            AprioriAlgorithm      target             = new AprioriAlgorithm(_inDatabaseHelper, _outDatabaseHelper, 0.5f);                // TODO: Initialize to an appropriate value
            int expected = 153;                                                                                                          // expected 153 itemsets for mushroom.dat minSup 0.5
            int actual;

            actual = target.GenerateFrequentItemSets();
            if (_inDatabaseHelper.DatabaseName == "mushroom" && target.MinimumSupport == 0.5f)
            {
                expected = 153;  // expected 153 itemsets for mushroom.dat minSup 0.5
            }
            else
            {
                expected = actual;
            }

            Assert.AreEqual(expected, actual);
        }
示例#5
0
        public void CreateFPTreeAndGenerateFrequentItemsetsTest()
        {
            FPGrowth              target             = new FPGrowth();                                                              // TODO: Initialize to an appropriate value
            IInputDatabaseHelper  _inDatabaseHelper  = new FileInputDatabaseHelper("mushroom");                                     // TODO: Initialize to an appropriate value
            IOutputDatabaseHelper _outDatabaseHelper = new FileOutputDatabaseHelper(@"D:\Data_Mining_Assignment\FPTests\Result\");; // TODO: Initialize to an appropriate value
            int   expected = 153;                                                                                                   // expected 153 itemsets for mushroom.dat minSup 0.5
            float minSup   = 0.5f;
            int   actual;

            actual = target.CreateFPTreeAndGenerateFrequentItemsets(_inDatabaseHelper, _outDatabaseHelper, minSup);

            if (_inDatabaseHelper.DatabaseName == "mushroom" && minSup == 0.5f)
            {
                expected = 153;  // expected 153 itemsets for mushroom.dat minSup 0.5
            }
            else
            {
                expected = actual;
            }

            Assert.AreEqual(expected, actual);
        }