private double doProcess(String trainFiles, String testFiles,
			String kNNResultFile) throws IOException {
		// TODO Auto-generated method stub
		//ȶȡѵͲmap<String,map<word,TF>>ԼѵעѵĿϢҲñ棬
		//Ȼÿһȥѵƶȣƶȱmap<String,double>
		//mapȥȻȡǰKkĿȨص÷֣ͬһĿȨͽõ
		//÷ֵĿͿжϲڸĿ£KֵԷԣҵ׼ȷߵǸֵ
		//עҪ"Ŀ_ļ"Ϊÿļkeyܱͬͬݵļ
		//עJMJAVA heap
		//нҼƶ
		File trainSamples = new File(trainFiles);
		BufferedReader trainSamplesBR = new BufferedReader(new FileReader(trainSamples));
		String line;
		String [] lineSplitBlock;
		Map<String,TreeMap<String,Double>> trainFileNameWordTFMap = new TreeMap<String,TreeMap<String,Double>> ();
		TreeMap<String,Double> trainWordTFMap = new TreeMap<String,Double>();
		while((line = trainSamplesBR.readLine()) != null){
			lineSplitBlock = line.split(" ");
			trainWordTFMap.clear();
			for(int i = 2; i < lineSplitBlock.length; i = i + 2){
				trainWordTFMap.put(lineSplitBlock[i], Double.valueOf(lineSplitBlock[i+1]));
			}
			TreeMap<String,Double> tempMap = new TreeMap<String,Double>();
			tempMap.putAll(trainWordTFMap);
			trainFileNameWordTFMap.put(lineSplitBlock[0]+"_"+lineSplitBlock[1], tempMap);
		}
		trainSamplesBR.close();
		
		File testSamples = new File(testFiles);
		BufferedReader testSamplesBR = new BufferedReader(new FileReader(testSamples));
		Map<String,Map<String,Double>> testFileNameWordTFMap = new TreeMap<String,Map<String,Double>> ();
		Map<String,String> testClassifyCateMap = new TreeMap<String, String>();//γɵ<ļĿ>
		Map<String,Double> testWordTFMap = new TreeMap<String,Double>();
		while((line = testSamplesBR.readLine()) != null){
			lineSplitBlock = line.split(" ");
			testWordTFMap.clear();
			for(int i = 2; i < lineSplitBlock.length; i = i + 2){
				testWordTFMap.put(lineSplitBlock[i], Double.valueOf(lineSplitBlock[i+1]));
			}
			TreeMap<String,Double> tempMap = new TreeMap<String,Double>();
			tempMap.putAll(testWordTFMap);
			testFileNameWordTFMap.put(lineSplitBlock[0]+"_"+lineSplitBlock[1], tempMap);
		}
		testSamplesBR.close();
		//ÿһѵľ룬
		String classifyResult;
		FileWriter testYangliuWriter = new FileWriter(new File("F:/DataMiningSample/docVector/yangliuTest"));
		FileWriter KNNClassifyResWriter = new FileWriter(kNNResultFile);
		Set<Map.Entry<String,Map<String,Double>>> testFileNameWordTFMapSet = testFileNameWordTFMap.entrySet();
		for(Iterator<Map.Entry<String,Map<String,Double>>> it = testFileNameWordTFMapSet.iterator(); it.hasNext();){
			Map.Entry<String, Map<String,Double>> me = it.next();
			classifyResult = KNNComputeCate(me.getKey(), me.getValue(), trainFileNameWordTFMap, testYangliuWriter);
			KNNClassifyResWriter.append(me.getKey()+" "+classifyResult+"\n");
			KNNClassifyResWriter.flush();
			testClassifyCateMap.put(me.getKey(), classifyResult);
		}
		KNNClassifyResWriter.close();
		//׼ȷ
		double righteCount = 0;
		Set<Map.Entry<String, String>> testClassifyCateMapSet = testClassifyCateMap.entrySet();
		for(Iterator <Map.Entry<String, String>> it = testClassifyCateMapSet.iterator(); it.hasNext();){
			Map.Entry<String, String> me = it.next();
			String rightCate = me.getKey().split("_")[0];
			if(me.getValue().equals(rightCate)){
				righteCount++;
			}
		}	
		testYangliuWriter.close();
		return righteCount / testClassifyCateMap.size();
	}