private String KNNComputeCate(
			String testFileName,
			Map<String, Double> testWordTFMap,
			Map<String, TreeMap<String, Double>> trainFileNameWordTFMap, FileWriter testYangliuWriter) throws IOException {
		// TODO Auto-generated method stub
		HashMap<String,Double> simMap = new HashMap<String,Double>();//<Ŀ_ļ,> ҪHashMapvalue
		double similarity;
		Set<Map.Entry<String,TreeMap<String,Double>>> trainFileNameWordTFMapSet = trainFileNameWordTFMap.entrySet();
		for(Iterator<Map.Entry<String,TreeMap<String,Double>>> it = trainFileNameWordTFMapSet.iterator(); it.hasNext();){
			Map.Entry<String, TreeMap<String,Double>> me = it.next();
			similarity = computeSim(testWordTFMap, me.getValue());
			simMap.put(me.getKey(),similarity);
		}
		//simMapvalue
		ByValueComparator bvc = new ByValueComparator(simMap);
		TreeMap<String,Double> sortedSimMap = new TreeMap<String,Double>(bvc);
		sortedSimMap.putAll(simMap);
		
		//disMapȡǰKѵ֮ͣKֵͨ
		Map<String,Double> cateSimMap = new TreeMap<String,Double>();//KѵĿľ֮
		double K = 20;
		double count = 0;
		double tempSim;
		
		Set<Map.Entry<String, Double>> simMapSet = sortedSimMap.entrySet();
		for(Iterator<Map.Entry<String, Double>> it = simMapSet.iterator(); it.hasNext();){
			Map.Entry<String, Double> me = it.next();
			count++;
			String categoryName = me.getKey().split("_")[0];
			if(cateSimMap.containsKey(categoryName)){
				tempSim = cateSimMap.get(categoryName);
				cateSimMap.put(categoryName, tempSim + me.getValue());
			}
			else cateSimMap.put(categoryName, me.getValue());
			if (count > K) break;
		}
		//浽cateSimMapsimǸĿҳ
		//testYangliuWriter.flush();
		//testYangliuWriter.close();
		double maxSim = 0;
		String bestCate = null;
		Set<Map.Entry<String, Double>> cateSimMapSet = cateSimMap.entrySet();
		for(Iterator<Map.Entry<String, Double>> it = cateSimMapSet.iterator(); it.hasNext();){
			Map.Entry<String, Double> me = it.next();
			if(me.getValue()> maxSim){
				bestCate = me.getKey();
				maxSim = me.getValue();
			}
		}
		return bestCate;
	}