title: item based collaborative filtering algorithm to calculate similarity betweeb items using mahout
body: <p>i have been using this code , n i am getting an error</p>
  
  <pre><code>Exception in thread "main" java.util.NoSuchElementException
      at com.google.common.base.AbstractIterator.next(AbstractIterator.java:75)
      at org.apache.mahout.cf.taste.impl.model.file.FileDataModel.processLine(FileDataModel.java:385)
      at org.apache.mahout.cf.taste.impl.model.file.FileDataModel.processFile(FileDataModel.java:340)
      at org.apache.mahout.cf.taste.impl.model.file.FileDataModel.buildModel(FileDataModel.java:239)
      at org.apache.mahout.cf.taste.impl.model.file.FileDataModel.reload(FileDataModel.java:208)
      at org.apache.mahout.cf.taste.impl.model.file.FileDataModel.&lt;init&gt;(FileDataModel.java:194)
      at org.apache.mahout.cf.taste.impl.model.file.FileDataModel.&lt;init&gt;(FileDataModel.java:149)
      at ItemRecommender.main(ItemRecommender.java:22) 
  </code></pre>
  
  <p>Is there some jar file error, that i need to import or so...help me m stuck....code is as follows...</p>
  
  <pre><code>import java.io.File;
  import java.util.List;
  import java.io.IOException;
  import org.apache.mahout.cf.taste.impl.common.LongPrimitiveIterator;
  import org.apache.mahout.cf.taste.impl.recommender.GenericItemBasedRecommender;
  import org.apache.mahout.cf.taste.impl.similarity.LogLikelihoodSimilarity;
  import org.apache.mahout.cf.taste.recommender.RecommendedItem;
  import org.apache.mahout.cf.taste.similarity.ItemSimilarity;
  
  public class ItemRecommender {
  
  
  public static void main(String[] args) {
  
      try{
  
      DataModel dm = new FileDataModel(new File("data/movies.csv"));
  
  
      ItemSimilarity sim = new LogLikelihoodSimilarity(dm);
  
  
      GenericItemBasedRecommender recommender = new GenericItemBasedRecommender(dm, sim);
  
      int x=1;
  
      for(LongPrimitiveIterator items = dm.getItemIDs(); items.hasNext();){
          long itemId = items.nextLong();
          List&lt;RecommendedItem&gt; recommendations = recommender.mostSimilarItems(itemId, 5);
  
          for(RecommendedItem recommendation : recommendations){
              System.out.println(itemId + "," + recommendation.getItemID() + "," + recommendation.getValue());
  
          }
          x++;
          //if(x&gt;10) System.exit(1);
  
      }
  
      }catch(IOException e)
  { System.out.println("There was an error.");
      e.printStackTrace();
  } catch(TasteException e) 
  {
      System.out.println("There was a taste exception.");
      e.printStackTrace();
  }
  </code></pre>
  
  <p>}
  }</p>