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(); }
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); }
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); }
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); }