Thought I'd add the debug flag output for those that care:
User:User[id:1] Recommender: GroupLensRecommender[recommender:CachingRecommender[recommender:SlopeOneRecommender[weighted:true, stdDevWeighted:true, diffStorage:MemoryDiffStorage]]] Top 20 Preferences: 5.0 1 Toy Story (1995) Animation|Children's|Comedy 5.0 1022 Cinderella (1950) Animation|Children's|Musical 5.0 1028 Mary Poppins (1964) Children's|Comedy|Musical 5.0 1029 Dumbo (1941) Animation|Children's|Musical 5.0 1035 Sound of Music The (1965) Musical 5.0 1193 One Flew Over the Cuckoo's Nest (1975) Drama 5.0 1270 Back to the Future (1985) Comedy|Sci-Fi 5.0 1287 Ben-Hur (1959) Action|Adventure|Drama 5.0 150 Apollo 13 (1995) Drama 5.0 1836 Last Days of Disco The (1998) Drama 5.0 1961 Rain Man (1988) Drama 5.0 2028 Saving Private Ryan (1998) Action|Drama|War 5.0 2355 Bug's Life A (1998) Animation|Children's|Comedy 5.0 2804 Christmas Story A (1983) Comedy|Drama 5.0 3105 Awakenings (1990) Drama 5.0 48 Pocahontas (1995) Animation|Children's|Musical|Romance 5.0 527 Schindler's List (1993) Drama|War 5.0 595 Beauty and the Beast (1991) Animation|Children's|Musical 4.0 1097 E.T. the Extra-Terrestrial (1982) Children's|Drama|Fantasy|Sci-Fi 4.0 1207 To Kill a Mockingbird (1962) Drama Recommendations: 7.321730220075736 557 Mamma Roma (1962) Drama 5.248598816436773 53 Lamerica (1994) Drama 5.117761222300874 1149 JLG/JLG - autoportrait de d�cembre (1994) Documentary|Drama 5.047946449451862 1039 Synthetic Pleasures (1995) Documentary 5.0 3382 Song of Freedom (1936) Drama 5.0 3607 One Little Indian (1973) Comedy|Drama|Western 5.0 989 Schlafes Bruder (Brother of Sleep) (1995) Drama 5.0 3172 Ulysses (Ulisse) (1954) Adventure 5.0 3656 Lured (1947) Crime 5.0 1830 Follow the Bitch (1998) Comedy 5.0 3881 Bittersweet Motel (2000) Documentary 5.0 572 Foreign Student (1994) Drama 5.0 3280 Baby The (1973) Horror 5.0 134 Sonic Outlaws (1995) Documentary 4.999999999999999 3233 Smashing Time (1967) Comedy 4.98947269776999 3338 For All Mankind (1989) Documentary 4.9753097928830785 3245 I Am Cuba (Soy Cuba/Ya Kuba) (1964) Drama 4.963755978247806 2503 Apple The (Sib) (1998) Drama 4.917827198841746 2931 Time of the Gypsies (Dom za vesanje) (1989) Drama 4.906247023765473 2930 Return with Honor (1998) Documentary On Sat, Mar 7, 2009 at 1:39 AM, Ryan Shih <[email protected]> wrote: > Hi Matt - This is actually the result of a code problem. For this example, > it picks up your data files fine (you'll be able to verify this by taking a > look in your temp directory on Tomcat because it will write files like > taste.movies.txt and taste.ratings.txt that hold your GLF converted file > after it reads it in from your classpath). However, the example currently > has logic that will look for additional files with the same prefix as > updates to your data. This fails, however because while taste.ratings.txt is > a valid ratings file, it reads taste.movies.txt as an an additional update > file but it's not and it fails to parse correctly. At the moment, it doesn't > appear like there is a way to override this because it's hardcoded so you'll > probably have to patch your file and rebuild. > > A quick & dirty approach that I got to work for me is by editing the > following file & patch the following line. > src/main/java/org/apache/mahout/cf/taste/example/grouplens/GroupLensDataModel.java > > > - "taste." + (ratings ? "ratings" : > "movies") + ".txt"); > + (ratings ? "ratings" : "movies") + > ".txt"); > > This will still allow updates, but you'll have to add them something along > the lines of movies.1.txt, ratings.1.txt, etc. > > If you get it all working, it'll take a short bit for it to do its magic > and you'll probably get results that look like for the following request: > http://localhost:8080/mahout-taste-webapp-0.1/RecommenderServlet?userID=1 > > 7.321730220075736 557 > 5.248598816436773 53 > 5.117761222300874 1149 > > 5.047946449451862 1039 > 5.0 3382 > 5.0 3607 > 5.0 989 > 5.0 3172 > 5.0 3656 > 5.0 1830 > 5.0 3881 > 5.0 572 > 5.0 3280 > 5.0 134 > 4.999999999999999 3233 > 4.98947269776999 3338 > 4.9753097928830785 3245 > > 4.963755978247806 2503 > 4.917827198841746 2931 > 4.906247023765473 2930 > > > Note that I'm building off of 0.1, but you'll see that the code problem > still exists in the most recent pull of trunk as of 3/7. > > Ryan > > > On Thu, Mar 5, 2009 at 10:42 AM, Matthew Roberson <[email protected]>wrote: > >> The data files appear to be there: >> >> WEB-INF/classes/org/apache/mahout/cf/taste/example/grouplens/movies.dat >> WEB-INF/classes/org/apache/mahout/cf/taste/example/grouplens/ratings.dat >> >> -- Matt >> >> >> On Thu, Mar 5, 2009 at 9:53 AM, Sean Owen <[email protected]> wrote: >> >> > What this suggests to me actually is that the 'movies.dat' file isn't >> > present or is otherwise not quite all there... the data file seems to >> > be being read but it's got a reference to a movie that doesn't exist, >> > somehow. >> > >> > Is movies.dat in place and getting packaged up? try "jar tf" on the >> > .war file to see its contents. >> > >> > The data files are expected under >> > /org/apache/mahout/cf/taste/example/grouplens/ >> > >> > >> > >> > On Thu, Mar 5, 2009 at 2:49 AM, Matthew Roberson <[email protected]> >> > wrote: >> > > So... >> > > >> > > I placed the GroupLens data files in the following directory: >> > > >> > >> /Mahout/trunk/examples/src/main/java/org/apache/mahout/cf/taste/example/grouplens >> > > >> > > I ran mvn package. >> > > >> > > I then set the path for recommender class in web.xml to poin to >> > > GroupLensRecommender. >> > > >> > > I then deploy the following war file in Tomcat: >> > > mahout-taste-webapp-0.2-SNAPSHOT.war (located in >> > > Mahout/trunk/taste-web/target) >> > > >> > > I then type in browser: http://localhost:8080/ >> > > >> mahout-taste-webapp-0.2-SNAPSHOT/RecommenderServlet?userID=1&debug=true >> > > >> > > And get NoSuchElementException regarding not finding the Group Lens >> data >> > > files in GroupLensDataModel. >> > > >> > > What am I doing wrong? >> > > >> > > If it can find the GroupLensRecommender class file, why can't it find >> the >> > > data files if they have the same path??? >> > > >> > > java.util.NoSuchElementException >> > > >> > >> >> org.apache.mahout.cf.taste.example.grouplens.GroupLensDataModel.buildItem(GroupLensDataModel.java:61) >> > > >> > >> >> org.apache.mahout.cf.taste.impl.model.file.FileDataModel.processLine(FileDataModel.java:244) >> > > >> > >> >> org.apache.mahout.cf.taste.impl.model.file.FileDataModel.processFile(FileDataModel.java:171) >> > > >> > >> >> org.apache.mahout.cf.taste.impl.model.file.FileDataModel.reload(FileDataModel.java:127) >> > > >> > >> >> org.apache.mahout.cf.taste.example.grouplens.GroupLensDataModel.reload(GroupLensDataModel.java:80) >> > > >> > >> >> org.apache.mahout.cf.taste.impl.model.file.FileDataModel.checkLoaded(FileDataModel.java:259) >> > > >> > >> >> org.apache.mahout.cf.taste.impl.model.file.FileDataModel.getUsers(FileDataModel.java:265) >> > > >> > >> > >
