public static RuleSet GenerateRuleSets(TransactionSet transSet, TransactionSet finalLargeItemSet,double minConfidenceLevel) {
		Timer timer = new Timer();
		timer.startTimer();
		RuleSet allRuleSets = new RuleSet(new ArrayList<Rule>());
		
		for (Transaction itemset : finalLargeItemSet.getTransactionSet()) {
			
			ArrayList<ItemSet> possibleRules = new ArrayList<ItemSet>();
			
			possibleRules = findRuleSubsets(itemset.getTransaction(), possibleRules);
	
			for (ItemSet subset : possibleRules) {
				
				double confidencePart1 = transSet.findSupport(itemset.getTransaction());
				double confidencePart2 = transSet.findSupport(subset);
				double confidence = (confidencePart1 / confidencePart2);
				if (confidence >= minConfidenceLevel) {
					
					Rule rule = new Rule();
					
					rule.setX(subset);
					
					ArrayList<Item> items = new ArrayList<Item>(itemset.getTransaction().getItemSet());
					ItemSet consequent = new ItemSet(items);
					
					for(int j = 0; j < subset.getItemSet().size(); j++){
						consequent.getItemSet().remove(subset.getItemSet().get(j));
					}
					/*Format to 4 decimal places */
					double formatConfidence = Math.round(confidence*10000.0)/10000.0;
					
					rule.setY(consequent);
					rule.setMinSupportLevel(transSet.findSupport(itemset.getTransaction()));
					rule.setActualConfidenceLevel(formatConfidence);
					
					if(rule.getX().getItemSet().size() > 0  && rule.getY().getItemSet().size() > 0){
						allRuleSets.getRuleSet().add(rule);
					}
				
				}
		
			
			}
			
		}		
		
		allRuleSets.setTimestamp();
		System.out.println("RuleSets:\n" + allRuleSets.toString());
		timer.stopTimer();
		//System.out.println("Generator.GenerateRuleSets: Time in Milliseconds" + timer.getTotal());
		return allRuleSets;
	}