StringTokenizer t = new StringTokenizer(line);
List<Item> items = new ArrayList<Item>();
while(t.countTokens() > 1){
String item = t.nextToken();
items.add(new Item(item));
}
// record the max value found for svm preperation
Item i = Collections.max(items, new Comparator<Item>() {
public int compare(Item o1, Item o2) {
return Integer.valueOf(o1.getItemName()).compareTo(Integer.valueOf(o2.getItemName()));
}
});
int largest = Integer.valueOf(i.getItemName()).intValue();
if(Double.isNaN(largestItemFoundInit) || largest > largestItemFound){
largestItemFound = largest;
}
String classLabel = t.nextToken();
Transaction tran = new Transaction(TID++,classLabel,items);