plugin/src/java/org/pm4knime/node/logmanipulation/classify/ClassifyUtil.java
public static void addLabelWithPercent(List<XTrace> traceList, Map<String, Double> lMap, String lName) {
		// sample the list of values from the percents, in descending order
		Map<String, Integer> result = new LinkedHashMap<String, Integer>();	
		
		double tNum = traceList.size();
		lMap.entrySet().stream()
				.sorted(Collections.reverseOrder(Map.Entry.comparingByValue()))
				.forEach(e -> result.put( e.getKey() , (int) (e.getValue() * tNum)));
		
		
		// how to differentiate if we should assign all the sum here, or just the one for them?? 
		// we need to know the percentage amount here. 
		// one condition to do this, is that we assign all the trace variant with labels!! 
		int sum = result.values().parallelStream().reduce(0,(a,b) -> a + b);
		int diff = traceList.size() - sum;
		String highKey = result.keySet().iterator().next();
		result.put(highKey, result.get(highKey) + diff);
		// create another map for it
		addLabelWithNumber(traceList, result, lName);
	}
/**
	 * Randomly assign label categories according to its percents.
	 * because the number is calculated from the 0.5 to 0.8. 
	 * if the number is only 1, how to judge them?? We need to rejudge the percentage again
	 * 
	 * @param traceList the trace list to be labelled with the values here
	 * @param lMap The label value and percent to be assigned 
	 */
Randomly assign label categories according to its percents.
because the number is calculated from the 0.5 to 0.8.

@param traceList the trace list to be labelled with the values here
@param lMap The label value and percent to be assigned
Randomly assign label categories according to its percents . because the number is calculated from the 0 . 5 to 0 . 8 . @param traceList the trace list to be labelled with the values here @param lMap The label value and percent to be assigned
public static void addLabelWithPercent(List<XTrace> traceList, Map<String, Double> lMap, String lName) {
		Map<String, Integer> result = new LinkedHashMap<String, Integer>();	
		double tNum = traceList.size();
		lMap.entrySet().stream()
				.sorted(Collections.reverseOrder(Map.Entry.comparingByValue()))
				.forEach(e -> result.put( e.getKey() , (int) (e.getValue() * tNum)));
		int sum = result.values().parallelStream().reduce(0,(a,b) -> a + b);
		int diff = traceList.size() - sum;
		String highKey = result.keySet().iterator().next();
		result.put(highKey, result.get(highKey) + diff);
		addLabelWithNumber(traceList, result, lName);
	}
public static void addLabelWithPercent ( List < XTrace > traceList , Map < String , Double > lMap , String lName ) { Map < String , Integer > result = new LinkedHashMap < String , Integer > ( ) ; double tNum = traceList . size ( ) ; lMap . entrySet ( ) . stream ( ) . sorted ( Collections . reverseOrder ( Map . Entry . comparingByValue ( ) ) ) . forEach ( e -> result . put ( e . getKey ( ) , ( int ) ( e . getValue ( ) * tNum ) ) ) ; int sum = result . values ( ) . parallelStream ( ) . reduce ( 0 , ( a , b ) -> a + b ) ; int diff = traceList . size ( ) - sum ; String highKey = result . keySet ( ) . iterator ( ) . next ( ) ; result . put ( highKey , result . get ( highKey ) + diff ) ; addLabelWithNumber ( traceList , result , lName ) ; }
Randomly assign label categories according to its percents.
Randomly assign label categories according to its percents .
// sample the list of values from the percents, in descending order // how to differentiate if we should assign all the sum here, or just the one for them??  // we need to know the percentage amount here.  // one condition to do this, is that we assign all the trace variant with labels!!  // create another map for it