>From some local IR precision/recall testing, I've found that user based recommenders do better on my data, so I'd like to stick with user based if I can. I know precision/recall measures aren't always that important when dealing with recommendation, but in the case I'm using the recommender for, I think it's worth maximizing. I'm getting more than double the precision out of the user based recommenders.
So I've gone ahead with a PlusAnonymousUserDataModel, and adding the anon user to the model seems to be working ok. I'm setting the anon user's preferences with setTempPrefs(...). To confirm the anon user's prefs got added, I check the number of prefs in the model for each of the user's items to confirm that they increase by 1 when the user's prefs are added to the model. After adding the temp preferences, I check to make sure the new preferences are associated with the temp user's in the data model by checking plusAnonModel.getPreferencesFromUser(PlusAnonymousUserDataModel.TEMP_USER_ID).length(); which is always greater than 0; Also, I'm sure that the anon user's prefs overlap with many other users prefs. Despite this, I'm getting 0 recommendations for all my anon users. I try to get the anon user's recommendations with: List<RecommendedItem> recommendations = recommend(PlusAnonymousUserDataModel.TEMP_USER_ID, 5, null); I've tried a bunch of anon users, and they all get 0 recommendations. Any ideas for what I could look at? I'll continue working on it myself, but any hints would be great. Thanks, Matt On Fri, Aug 9, 2013 at 2:09 AM, Sebastian Schelter <[email protected]>wrote: > There is an even simpler solution: train an itembased recommender and > use the interactions of the new user as input to the mostSimilarItems() > method. That should give you the same results. > > > On 09.08.2013 03:33, Matt Molek wrote: > > Thanks, Sebastian. > > > > To get around this problem, I was just reading about the > > PlusAnonymousUserDataModel. Would that be appropriate to use with boolean > > preferences? > > > > My whole motivation here is that I want to train a recommender on a large > > data model, and then get recommendations for a bunch of users who were > not > > in the original data model, without having to completely rebuild the > > original model for each user. I don't care if these new users don't > persist > > in the current model. (Actually I would prefer that they did not > influence > > the model at this point) I just need to quickly generate recommendations > > for them. > > > > Can I accomplish that by wrapping PlusAnonymousUserDataModel around a > > GenericBooleanPrefDataModel? > > Are there any performance implications to using the > > PlusAnonymousUserDataModel? I know I can only have one anonymous user at > at > > time. That's ok. > > > > Thanks again! > > Matt > > > > > > On Thu, Aug 8, 2013 at 6:08 PM, Sebastian Schelter <[email protected]> > wrote: > > > >> This is a design flaw unfortunately, because we don't support online > >> recommenders. You have to add the data to the underlying DataModel and > call > >> refresh on the Recommender. > >> > >> A common practice is for example to save new interactions in a database > and > >> load them into memory from time to time. > >> > >> 2013/8/8 Matt Molek <[email protected]> > >> > >>> Ok, having implemented a recommender that tried to call > >> setPreference(...) > >>> on a GenericBooleanPrefUserBasedRec > >>> ommender with a GenericBooleanPrefDataModel, I see this isn't the way. > >>> GenericBooleanPrefDataModel throws an UnsupportedOperationException. > >>> > >>> > >>> I don't see any other way to add new user-item associations to the > model > >>> though. Is this just no possible? That seems weird. I thought all of > the > >>> in-memory models supported having new data added on the fly. Am I > missing > >>> something? > >>> > >>> Thanks for the help, > >>> Matt > >>> > >>> > >>> On Thu, Aug 8, 2013 at 12:31 PM, Matt Molek <[email protected]> wrote: > >>> > >>>> I'm using a GenericBooleanPrefUserBasedRecommender with a > >>>> GenericBooleanPrefDataModel. > >>>> > >>>> When I load the historical user/item associations from a file, they're > >>>> just in the format of userid, itemid, and as I understand it, the > >>>> GenericBooleanPrefDataModel does not store any 'rating' data. > >>>> > >>>> I'd like to add new preferences (and users) to the recommender on the > >>> fly, > >>>> but the only method to add new preferences on > >>>> GenericBooleanPrefUserBasedRecommender is* setPreference*(long userID, > >>>> long itemID, float value). Is 1.0 the correct value to be using? Will > >> the > >>>> GenericBooleanPrefDataModel just ignore that 1.0 value that I pass to > >> it, > >>>> since it wasn't storing any other preferences? > >>>> > >>>> Also, is the right way to add a user on the fly just to set all their > >>>> preferences one at a time with setPreference(...) and then ask for > >>>> recommendations for them? > >>>> > >>>> Thanks! > >>>> Matt > >>>> > >>> > >> > > > >
