int main(int argc, char *argv[]) { cout << "Apriori frequent itemset mining implementation" << endl; if (argc < 3) { cerr << "usage: " << argv[0] << " datafile minsup [output]" << endl; } else { AprioriSets a; a.setVerbose(); // print information on nr of candidate itemsets etc a.setData(argv[1], 3); a.setCountType(2); // 1: to check k-subsets of transaction in set of candidates // 2: to check all candidates in transaction (default - best performance) a.setMinSup(atoi(argv[2])); if (argc == 4) a.setOutputSets(argv[3]); clock_t start = clock(); int sets = a.generateSets(); cout << sets << "\t[" << (clock() - start) / double(CLOCKS_PER_SEC) << "s]" << endl; if (argc == 4) cout << "Frequent sets written to " << argv[3] << endl; } return 0; }
int main(int argc, char *argv[]) { // input: transaction data // support threshold, e.g., 1% or 0.1% * transaction number char *dataFile = "E:\\GPU_Bitmap_Apriori\\data\\fimi\\m_T10I4D10K.bin"; int minSup = 100; char *outputFile = "../output/fimi//m_T10I4D100K_1000.txt"; AprioriSets a; // print debug information a.setVerbose(); a.setData(dataFile); a.setMinSup(minSup); a.setOutputSets(outputFile); clock_t start = clock(); int sets = a.generateSets(); cout << "=========================done================================" << endl << "total pattern#: " << sets << endl << "total time: " << (clock()-start)/double(CLOCKS_PER_SEC) << "s]" << endl << "Frequent sets written to " << outputFile << endl << "print time: " << a.getPrintTime()/double(CLOCKS_PER_SEC) << endl; return 0; }