Esempio n. 1
0
        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);
        }
Esempio n. 2
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);
        }