public static List<Vector> readDataset(String file,int maxSize) {
		List<Vector> ret = new ArrayList<Vector>();
		List<String[]> data = FileUtils.readCSVFile(file, " ", -1);
		if(data.size() > maxSize){
			data = data.subList(0, maxSize);
		}
		boolean firstColumnIsKey = false;
		try{
			Double.parseDouble(data.get(0)[0]);
		}catch(Exception e){
			firstColumnIsKey = true;
		}
		int dimensions = firstColumnIsKey ? data.get(0).length - 1 : data.get(0).length;
		int startIndex = firstColumnIsKey ? 1 : 0;
		for(String[] row : data){
			Vector item = new Vector(dimensions);
			if(firstColumnIsKey){
				item.setKey(row[0]);
			}
			for (int d = startIndex; d < row.length; d++) {
				double value = Double.parseDouble(row[d]);
				item.set(d - startIndex, value);
			}
			ret.add(item);
		}			
		return ret;
	}