public static void discretizeNumericAttributesProcessClass(ArrayList<LearningObject> learningSet, ArrayList<Attribute> attributes){
		
		
		for(int i=0; i<attributes.size();i++){
			Attribute attr = attributes.get(i);
			
			if(attr.type == Attribute.NUMERIC){
				//apply discretization process
		
				
				TreeMap<Integer,Association> values = new TreeMap<Integer, Association>();
				//total number of values
				int totalNo = 0;
				//total number of classes
				int totalClasses = 0;
				//intervals to be split in
				ArrayList<Interval> intervals = new ArrayList<Interval>();
				
				for(int j=0;j<learningSet.size();j++){
					Association val = values.get(learningSet.get(j).values.get(attr.posInLearningSet).getValue());
					if(val == null){
						Association assoc = new Association();
						assoc.addClass(learningSet.get(j).classValue.name);
						values.put((Integer)learningSet.get(j).values.get(attr.posInLearningSet).getValue(),assoc);
						totalClasses++;
					}
					else 
						val.addClass(learningSet.get(j).classValue.name);
					totalNo++;
				}

				Interval interval = new Interval();
				Interval oldInterval;
				int index = 0;
				String currentClass = "nodInitialized";
				while(values.size()>0){
					
					Entry<Integer,Association> entry = values.firstEntry();
					
					if(!currentClass.equals(entry.getValue().getDominantClass())){
						
						//System.out.println("Class change from " + currentClass + " to " + entry.getValue().getDominantClass() + " when changed to" + entry.getKey());
						
						//class change
						oldInterval = interval;
						oldInterval.highBound = entry.getKey();
						interval = new Interval();
						interval.lowBound = entry.getKey();
						intervals.add(interval);
						currentClass = entry.getValue().getDominantClass();
					}
					
					if(index == 0){
						interval.lowBound = Integer.MIN_VALUE;
					}
					
					index++;
					values.remove(entry.getKey());
				}
				
				interval.highBound = Integer.MAX_VALUE;
				
				//add intervals to attribute
				attr.numericIntervalBounds = intervals;
				
				System.out.println("Attribute intervals:"+attr.name);
				
				for(int t=0;t<intervals.size();t++)
					System.out.print("[" +intervals.get(t).lowBound+" " + intervals.get(t).highBound+ "]");
				
			}
			
		}
		
		
	}