当前位置: 首页>>代码示例>>Java>>正文


Java AlgoApriori.runAlgorithm方法代码示例

本文整理汇总了Java中ca.pfv.spmf.algorithms.frequentpatterns.apriori.AlgoApriori.runAlgorithm方法的典型用法代码示例。如果您正苦于以下问题:Java AlgoApriori.runAlgorithm方法的具体用法?Java AlgoApriori.runAlgorithm怎么用?Java AlgoApriori.runAlgorithm使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在ca.pfv.spmf.algorithms.frequentpatterns.apriori.AlgoApriori的用法示例。


在下文中一共展示了AlgoApriori.runAlgorithm方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: runAlgorithm

import ca.pfv.spmf.algorithms.frequentpatterns.apriori.AlgoApriori; //导入方法依赖的package包/类
@Override
public void runAlgorithm(String[] parameters, String inputFile, String outputFile) throws IOException {
	double minsup = getParamAsDouble(parameters[0]);
	double minconf = getParamAsDouble(parameters[1]);

	AlgoApriori apriori = new AlgoApriori();
	ca.pfv.spmf.patterns.itemset_array_integers_with_count.Itemsets patterns = apriori
			.runAlgorithm(minsup, inputFile, null);
	apriori.printStats();
	int databaseSize = apriori.getDatabaseSize();

	// STEP 2: Generating all rules from the set of frequent itemsets
	// (based on Agrawal & Srikant, 94)
	ca.pfv.spmf.algorithms.associationrules.agrawal94_association_rules.AlgoAgrawalFaster94 algoAgrawal = new ca.pfv.spmf.algorithms.associationrules.agrawal94_association_rules.AlgoAgrawalFaster94();
	algoAgrawal.runAlgorithm(patterns, outputFile, databaseSize,
			minconf);
	algoAgrawal.printStats();
}
 
开发者ID:matfax,项目名称:spmf,代码行数:19,代码来源:DescriptionAlgoAprioriAssociationRules.java

示例2: mineFrequentItemsetsApriori

import ca.pfv.spmf.algorithms.frequentpatterns.apriori.AlgoApriori; //导入方法依赖的package包/类
/** Run Apriori algorithm */
public static SortedMap<Itemset, Integer> mineFrequentItemsetsApriori(final String dataset, final String saveFile,
		final double minSupp) throws IOException {

	// Remove transaction duplicates and sort items ascending
	final File TMPDB = File.createTempFile("fixed-dataset", ".dat");
	dbTool.convert(dataset, TMPDB.getAbsolutePath());

	final AlgoApriori algo = new AlgoApriori();
	final Itemsets patterns = algo.runAlgorithm(minSupp, TMPDB.getAbsolutePath(), saveFile);
	// algo.printStats();
	// patterns.printItemsets(algo.getDatabaseSize());

	return toMap(patterns);
}
 
开发者ID:mast-group,项目名称:itemset-mining,代码行数:16,代码来源:FrequentItemsetMining.java

示例3: main

import ca.pfv.spmf.algorithms.frequentpatterns.apriori.AlgoApriori; //导入方法依赖的package包/类
public static void main(String [] arg) throws IOException{
		
//		String input = fileToPath("E:/DMTest/contextPasquier99.txt");
		String input = "E:/DMTest/contextPasquier99.txt";
		String output = "E:/DMTest/Result/frequent_itemsets.txt";  // the path for saving the frequent itemsets found
		
		double minsup = 0.4; // means a minsup of 2 transaction (we used a relative support)
		
		// Applying the Apriori algorithm
		AlgoApriori apriori = new AlgoApriori();
		apriori.runAlgorithm(minsup, input, output);
		apriori.printStats();
	}
 
开发者ID:YinYanfei,项目名称:CadalWorkspace,代码行数:14,代码来源:MainTestApriori_saveToFile.java

示例4: main

import ca.pfv.spmf.algorithms.frequentpatterns.apriori.AlgoApriori; //导入方法依赖的package包/类
public static void main(String [] arg) throws IOException{

		String input = fileToPath("contextPasquier99.txt");
		String output = "C://patterns//frequent_itemsets.txt";  // the path for saving the frequent itemsets found
		
		double minsup = 0.4; // means a minsup of 2 transaction (we used a relative support)
		
		// Applying the Apriori algorithm
		AlgoApriori apriori = new AlgoApriori();
		apriori.runAlgorithm(minsup, input, output);
		apriori.printStats();
	}
 
开发者ID:YinYanfei,项目名称:CadalWorkspace,代码行数:13,代码来源:MainTestApriori_saveToFile.java


注:本文中的ca.pfv.spmf.algorithms.frequentpatterns.apriori.AlgoApriori.runAlgorithm方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。