當前位置: 首頁>>代碼示例>>Java>>正文


Java AlgoZart.getTableFrequent方法代碼示例

本文整理匯總了Java中ca.pfv.spmf.algorithms.frequentpatterns.zart.AlgoZart.getTableFrequent方法的典型用法代碼示例。如果您正苦於以下問題:Java AlgoZart.getTableFrequent方法的具體用法?Java AlgoZart.getTableFrequent怎麽用?Java AlgoZart.getTableFrequent使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在ca.pfv.spmf.algorithms.frequentpatterns.zart.AlgoZart的用法示例。


在下文中一共展示了AlgoZart.getTableFrequent方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: main

import ca.pfv.spmf.algorithms.frequentpatterns.zart.AlgoZart; //導入方法依賴的package包/類
public static void main(String[] args) throws IOException {

		String input = fileToPath("contextZart.txt");  // the database
		String output = "C://patterns//zart_output.txt";  // the path for saving the frequent itemsets found
		
		// Load a binary context
		TransactionDatabase context = new TransactionDatabase();
		context.loadFile(input);

		// Apply the Zart algorithm
		double minsup = 0.4;
		AlgoZart zart = new AlgoZart();
		TZTableClosed results = zart.runAlgorithm(context, minsup);
		TFTableFrequent frequents = zart.getTableFrequent();
		zart.printStatistics();
		zart.saveResultsToFile(output);
			
	}
 
開發者ID:YinYanfei,項目名稱:CadalWorkspace,代碼行數:19,代碼來源:MainTestZart_saveToFile.java

示例2: main

import ca.pfv.spmf.algorithms.frequentpatterns.zart.AlgoZart; //導入方法依賴的package包/類
public static void main(String[] args) throws IOException {

		// Load a binary context
		TransactionDatabase context = new TransactionDatabase();
		context.loadFile(fileToPath("contextZart.txt"));

		// Apply the Zart algorithm
		double minsup = 0.4;
		AlgoZart zart = new AlgoZart();
		TZTableClosed results = zart.runAlgorithm(context, minsup);
		TFTableFrequent frequents = zart.getTableFrequent();
		zart.printStatistics();
		
		// PRINTING RESULTS
		int countClosed=0;
		int countGenerators=0;
		System.out.println("======= List of closed itemsets and their generators ============");
		for(int i=0; i< results.levels.size(); i++){
			System.out.println("LEVEL (SIZE) : " + i);
			for(Itemset closed : results.levels.get(i)){
				System.out.println(" CLOSED : " + closed.toString() + "  supp : " + closed.getAbsoluteSupport());
				countClosed++;
				System.out.println("   GENERATORS : ");
					for(Itemset generator : results.mapGenerators.get(closed)){
						countGenerators++;
						System.out.println("     =" + generator.toString());
					}
			}
		}
		System.out.println(" NUMBER OF CLOSED : " + countClosed +  " NUMBER OF GENERATORS : " + countGenerators );
		
		// SECOND, WE PRINT THE LIST OF ALL FREQUENT ITEMSETS
		System.out.println("======= List of all frequent itemsets ============");
		int countFrequent =0;
		for(int i=0; i< frequents.levels.size(); i++){
			System.out.println("LEVEL (SIZE) : " + i);
			for(Itemset itemset : frequents.levels.get(i)){
				countFrequent++;
				System.out.println(" ITEMSET : " + itemset.toString() + "  supp : " + itemset.getAbsoluteSupport());
			}
		}
		System.out.println("NB OF FREQUENT ITEMSETS : " + countFrequent);
		
	}
 
開發者ID:YinYanfei,項目名稱:CadalWorkspace,代碼行數:45,代碼來源:MainTestZart_saveToMemory.java


注:本文中的ca.pfv.spmf.algorithms.frequentpatterns.zart.AlgoZart.getTableFrequent方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。