public void save2File(String filename) {
		if (filename==null || filename.isEmpty()) {
			System.out.println("Please specify the file name to save the vectors!");
			return;
		}
		
		try {
			BufferedWriter writer = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(filename)));
			for(_Doc doc:m_collection) {
				writer.write(String.format("%d", doc.getYLabel()));
				for(_SparseFeature fv:doc.getSparse())
					writer.write(String.format(" %d:%f", fv.getIndex()+1, fv.getValue()));//index starts from 1
				writer.write(String.format(" #%s-%s\n", doc.m_itemID, doc.m_name));//product ID and review ID
			}
			writer.close();
			
			System.out.format("%d feature vectors saved to %s\n", m_collection.size(), filename);
		} catch (IOException e) {
			e.printStackTrace();
		} 
	}