@Override
	public double train(Collection<_Doc> trainSet) {
		ArrayList<_Doc> graph = new ArrayList<_Doc>();
		
		String lastItemID = null;
		for(_Doc d:trainSet) {
			if (lastItemID == null)
				lastItemID = d.getItemID();
			else if (lastItemID != d.getItemID()) {
				if (graph.size()>10)//otherwise the graph is too small
					calcPageRank(graph);
				graph.clear();
				lastItemID = d.getItemID();
			}
			
			graph.add(d);
		}
		
		//for the last product
		if (graph.size()>5)//otherwise the graph is too small
			calcPageRank(graph);
		return 0;
	}