List of usage examples for weka.associations FPGrowth FPGrowth
public FPGrowth()
From source file:com.starm.processors.miners.FPGrowthBasedARMiner.java
License:Open Source License
/** * For instantiating FPGrowthBasedARMiner using minimum support and minimum confidence values * /*from ww w. j av a 2 s.c o m*/ * @param minimumSupport minimum support value * @param minimumConfidence minimum confidence value * @param datasetFilePath folder path for dataset file * @param datasetFileNameAndExtenstion file name and extension of dataset file * @param outputRulesFilePath folder path for output association rules file * @param outputRulesFileNameAndExtension output association rules file name and extension */ public FPGrowthBasedARMiner(float minimumSupport, float minimumConfidence, String datasetFilePath, String datasetFileNameAndExtenstion, String outputRulesFilePath, String outputRulesFileNameAndExtension) { this.minimumSupport = minimumSupport; this.minimumConfidence = minimumConfidence; arMiner = new FPGrowth(); arMiner.setDelta(0.005f); arMiner.setFindAllRulesForSupportLevel(true); arMiner.setLowerBoundMinSupport(minimumSupport); arMiner.setUpperBoundMinSupport(1.0f); arMiner.setMetricType(new SelectedTag(0, FPGrowth.AssociationRule.TAGS_SELECTION)); arMiner.setMinMetric(minimumConfidence); this.datasetFilePath = datasetFilePath; this.datasetFileNameAndExtenstion = datasetFileNameAndExtenstion; this.outputRulesFilePath = outputRulesFilePath; this.outputRulesFileNameAndExtension = outputRulesFileNameAndExtension; }
From source file:fiit.gpminerstatic.Main.java
public static void main(String args[]) { ArrayList<Attribute> attributes = new ArrayList<Attribute>(); for (int i = 0; i < 1000; i++) { attributes.add(new Attribute(String.valueOf(i))); }//from w w w .j a v a2 s. c o m // load data from file into instances SessionsFileStream stream = new SessionsFileStream( "g:\\workspace_GPMiner\\data\\alef_sessions_aggregated.csv"); Instances instances = new Instances("Instances", attributes, 1000); Enumeration<Instance> enumer = instances.enumerateInstances(); while (enumer.hasMoreElements()) { instances.add(enumer.nextElement()); } try { // make global patterns with fpgrowth alghoritm FPGrowth fp = new FPGrowth(); fp.buildAssociations(instances); AssociationRules assocRules = fp.getAssociationRules(); } catch (Exception ex) { Logger.getLogger(Main.class.getName()).log(Level.SEVERE, null, ex); } }
From source file:rdfsystem.data.DataMining.java
public static String assoiate(RdfManager manager) throws Exception { Instances ins = transformData(manager, false); FPGrowth ass = new FPGrowth(); String[] options = "-T 0 -C 0.5 -M 0.1".split(" "); ass.setOptions(options);//from w w w .j a v a 2 s . c o m ass.buildAssociations(ins); List<AssociationRule> res = ass.getAssociationRules(); for (AssociationRule rule : res) System.out.println(rule); return null; }