get similar items

classic Classic list List threaded Threaded
17 messages Options
Reply | Threaded
Open this post in threaded view
|

get similar items

samsam
All:
  Can I get similar items of one item? I know ItemSimilarity is used to
compute the similarity between items,but seems can't get similar items of
one item.

Best Regards.

--
I'm samsam.
Reply | Threaded
Open this post in threaded view
|

Re: get similar items

Sean Owen
Yes, try GenericItemBasedRecommender.mostSimilarItems()

On Thu, Sep 23, 2010 at 4:43 PM, Sam Yang <[hidden email]> wrote:

> All:
>  Can I get similar items of one item? I know ItemSimilarity is used to
> compute the similarity between items,but seems can't get similar items of
> one item.
>
> Best Regards.
>
> --
> I'm samsam.
>
Reply | Threaded
Open this post in threaded view
|

Re: get similar items

samsam
GenericItemBasedRecommender.mostSimilarItems() need item preference data,if
there is no preference data at start,Is there some way to get similar items.
I integrated the recommendation engine to store,but at start there is no
enough preference data,but we need to show recommendations for  users,so I
want to find some similar
items of the tem user open.

On Thu, Sep 23, 2010 at 11:46 PM, Sean Owen <[hidden email]> wrote:

> Yes, try GenericItemBasedRecommender.mostSimilarItems()
>
> On Thu, Sep 23, 2010 at 4:43 PM, Sam Yang <[hidden email]> wrote:
> > All:
> >  Can I get similar items of one item? I know ItemSimilarity is used to
> > compute the similarity between items,but seems can't get similar items of
> > one item.
> >
> > Best Regards.
> >
> > --
> > I'm samsam.
> >
>



--
I'm samsam.
Reply | Threaded
Open this post in threaded view
|

Re: get similar items

Sebastian Schelter-4
Hi Sam,

You could use a custom implementation of ItemSimilarity that looks at
content-specific properties to compute the similarity. In an onlineshop you
would for example compare properties like price, manufacturer or color of
products. While the quality of the results might not be very high with this
approach, it's still better than showing nothing.

--sebastian

2010/9/26 Sam Yang <[hidden email]>

> GenericItemBasedRecommender.mostSimilarItems() need item preference data,if
> there is no preference data at start,Is there some way to get similar
> items.
> I integrated the recommendation engine to store,but at start there is no
> enough preference data,but we need to show recommendations for  users,so I
> want to find some similar
> items of the tem user open.
>
> On Thu, Sep 23, 2010 at 11:46 PM, Sean Owen <[hidden email]> wrote:
>
> > Yes, try GenericItemBasedRecommender.mostSimilarItems()
> >
> > On Thu, Sep 23, 2010 at 4:43 PM, Sam Yang <[hidden email]> wrote:
> > > All:
> > >  Can I get similar items of one item? I know ItemSimilarity is used to
> > > compute the similarity between items,but seems can't get similar items
> of
> > > one item.
> > >
> > > Best Regards.
> > >
> > > --
> > > I'm samsam.
> > >
> >
>
>
>
> --
> I'm samsam.
>
Reply | Threaded
Open this post in threaded view
|

Re: get similar items

Sean Owen
In reply to this post by samsam
No, it does not need preferences. Use a notion of similarity that does
not need preferences, like LogLikelihoodSimilarity.

But it sounds like you mean something different. You don't have any
data to start, yes, so you can't determine similar items. Well yes,
with no data at all, algorithms won't help. Don't launch this feature
until you have some data, or, make up a standard dummy list of similar
items to start.

But it also sounds like you want to recommend to users, which is not
the same as computing most similar items. Maybe you can clarify what
you're doing.

On Sun, Sep 26, 2010 at 7:26 AM, Sam Yang <[hidden email]> wrote:
> GenericItemBasedRecommender.mostSimilarItems() need item preference data,if
> there is no preference data at start,Is there some way to get similar items.
> I integrated the recommendation engine to store,but at start there is no
> enough preference data,but we need to show recommendations for  users,so I
> want to find some similar
> items of the tem user open.
Reply | Threaded
Open this post in threaded view
|

Re: get similar items

samsam
I have custom implementation of ItemSimilarity.Does
GenericItemBasedRecommender.mostSimilarItems()
need preference data?
I new GenericItemBasedRecommender with the preference data model and
implementation
of ItemSimilarity,but seems mostSimilarItems() return no results.

On Sun, Sep 26, 2010 at 4:31 PM, Sean Owen <[hidden email]> wrote:

> No, it does not need preferences. Use a notion of similarity that does
> not need preferences, like LogLikelihoodSimilarity.
>
> But it sounds like you mean something different. You don't have any
> data to start, yes, so you can't determine similar items. Well yes,
> with no data at all, algorithms won't help. Don't launch this feature
> until you have some data, or, make up a standard dummy list of similar
> items to start.
>
> But it also sounds like you want to recommend to users, which is not
> the same as computing most similar items. Maybe you can clarify what
> you're doing.
>
> On Sun, Sep 26, 2010 at 7:26 AM, Sam Yang <[hidden email]> wrote:
> > GenericItemBasedRecommender.mostSimilarItems() need item preference
> data,if
> > there is no preference data at start,Is there some way to get similar
> items.
> > I integrated the recommendation engine to store,but at start there is no
> > enough preference data,but we need to show recommendations for  users,so
> I
> > want to find some similar
> > items of the tem user open.
>



--
I'm samsam.
Reply | Threaded
Open this post in threaded view
|

Re: get similar items

Sean Owen
GenericItemBasedRecommender.mostSimilarItems() does not care. It just
uses your ItemSimilarity to do its work.
You'd have to be more specific to get more feedback. Are you sure your
ItemSimilarity is working, not returning NaN?

On Sun, Sep 26, 2010 at 2:40 PM, Sam Yang <[hidden email]> wrote:
> I have custom implementation of ItemSimilarity.Does
> GenericItemBasedRecommender.mostSimilarItems()
> need preference data?
> I new GenericItemBasedRecommender with the preference data model and
> implementation
> of ItemSimilarity,but seems mostSimilarItems() return no results.
Reply | Threaded
Open this post in threaded view
|

Re: get similar items

samsam
But I got this when no preference data:
======

java.lang.IllegalArgumentException: size is less than 1

at org.apache.mahout.cf.taste.impl.model.GenericItemPreferenceArray.<init>(
GenericItemPreferenceArray.java:49)

at org.apache.mahout.cf.taste.impl.model.GenericItemPreferenceArray.<init>(
GenericItemPreferenceArray.java:56)

at
org.apache.mahout.cf.taste.impl.model.jdbc.AbstractJDBCDataModel.getPreferencesForItem(
AbstractJDBCDataModel.java:441)

at
org.apache.mahout.cf.taste.impl.recommender.GenericItemBasedRecommender.doMostSimilarItems(
GenericItemBasedRecommender.java:169)

at
org.apache.mahout.cf.taste.impl.recommender.GenericItemBasedRecommender.mostSimilarItems(
GenericItemBasedRecommender.java:128)

at
org.apache.mahout.cf.taste.impl.recommender.GenericItemBasedRecommender.mostSimilarItems(
GenericItemBasedRecommender.java:121)

at net.gamestreamer.recommendation.SimilarItemsFinder.find(
SimilarItemsFinder.java:18)

at
net.gamestreamer.recommendation.test.RecommenderTest.testSimilarItemsFinder(
RecommenderTest.java:45)

at net.gamestreamer.recommendation.test.RecommenderTest.main(
RecommenderTest.java:85)

=========

When create a preference data for the
item,GenericItemBasedRecommender.mostSimilarItems()
works well.


On Sun, Sep 26, 2010 at 9:49 PM, Sean Owen <[hidden email]> wrote:

> GenericItemBasedRecommender.mostSimilarItems() does not care. It just
> uses your ItemSimilarity to do its work.
> You'd have to be more specific to get more feedback. Are you sure your
> ItemSimilarity is working, not returning NaN?
>
> On Sun, Sep 26, 2010 at 2:40 PM, Sam Yang <[hidden email]> wrote:
> > I have custom implementation of ItemSimilarity.Does
> > GenericItemBasedRecommender.mostSimilarItems()
> > need preference data?
> > I new GenericItemBasedRecommender with the preference data model and
> > implementation
> > of ItemSimilarity,but seems mostSimilarItems() return no results.
>



--
I'm samsam.
Reply | Threaded
Open this post in threaded view
|

Re: get similar items

samsam
And it's like this issue:   https://issues.apache.org/jira/browse/MAHOUT-367

On Mon, Sep 27, 2010 at 10:36 AM, Sam Yang <[hidden email]> wrote:

> But I got this when no preference data:
> ======
>
> java.lang.IllegalArgumentException: size is less than 1
>
> at org.apache.mahout.cf.taste.impl.model.GenericItemPreferenceArray.<init>(
> GenericItemPreferenceArray.java:49)
>
> at org.apache.mahout.cf.taste.impl.model.GenericItemPreferenceArray.<init>(
> GenericItemPreferenceArray.java:56)
>
> at
> org.apache.mahout.cf.taste.impl.model.jdbc.AbstractJDBCDataModel.getPreferencesForItem(
> AbstractJDBCDataModel.java:441)
>
> at
> org.apache.mahout.cf.taste.impl.recommender.GenericItemBasedRecommender.doMostSimilarItems(
> GenericItemBasedRecommender.java:169)
>
> at
> org.apache.mahout.cf.taste.impl.recommender.GenericItemBasedRecommender.mostSimilarItems(
> GenericItemBasedRecommender.java:128)
>
> at
> org.apache.mahout.cf.taste.impl.recommender.GenericItemBasedRecommender.mostSimilarItems(
> GenericItemBasedRecommender.java:121)
>
> at net.gamestreamer.recommendation.SimilarItemsFinder.find(
> SimilarItemsFinder.java:18)
>
> at
> net.gamestreamer.recommendation.test.RecommenderTest.testSimilarItemsFinder(
> RecommenderTest.java:45)
>
> at net.gamestreamer.recommendation.test.RecommenderTest.main(
> RecommenderTest.java:85)
>
> =========
>
> When create a preference data for the item,GenericItemBasedRecommender.mostSimilarItems()
> works well.
>
>
> On Sun, Sep 26, 2010 at 9:49 PM, Sean Owen <[hidden email]> wrote:
>
>> GenericItemBasedRecommender.mostSimilarItems() does not care. It just
>> uses your ItemSimilarity to do its work.
>> You'd have to be more specific to get more feedback. Are you sure your
>> ItemSimilarity is working, not returning NaN?
>>
>> On Sun, Sep 26, 2010 at 2:40 PM, Sam Yang <[hidden email]> wrote:
>> > I have custom implementation of ItemSimilarity.Does
>> > GenericItemBasedRecommender.mostSimilarItems()
>> > need preference data?
>> > I new GenericItemBasedRecommender with the preference data model and
>> > implementation
>> > of ItemSimilarity,but seems mostSimilarItems() return no results.
>>
>
>
>
> --
> I'm samsam.
>



--
I'm samsam.
Reply | Threaded
Open this post in threaded view
|

Re: get similar items

Timothy Potter
Hi Sam,

Item similarity in Mahout is based on co-occurances between items, e.g. 15
users have X'd items A & B and 7 users have X'd items A & C where X is some
verb in your app (viewed, shared, rated, commented on ...). In my simplistic
example, A&B are more similar than A&C since they occurred together more
often. So, as Sean and Sebastian have said, you need this information before
you can make recommendations using Mahout. This is the case with any new app
that wants to use collaborative filtering but doesn't have a history of
user-item interactions.

As Sebastian pointed out, you could start out by making recommendations
strictly on content-based similarities (such as the output from a More Like
This query in Lucene) and then introduce recommendations based on
collaborative filtering as your user-item interaction data grows.
Collaborative filtering in Mahout has several moving parts (item-based vs.
user-based recommender, which similarity metric to use, optimal user
neighborhood size for user-based recommenders, etc).  To get "good"
recommendations, you'll need to run Mahout's evaluation framework against
your data so you can determine what are the best settings for your specific
needs. Again, you need data to do this evaluation.

Cheers,
Tim

On Sun, Sep 26, 2010 at 8:37 PM, Sam Yang <[hidden email]> wrote:

> And it's like this issue:
> https://issues.apache.org/jira/browse/MAHOUT-367
>
> On Mon, Sep 27, 2010 at 10:36 AM, Sam Yang <[hidden email]> wrote:
>
> > But I got this when no preference data:
> > ======
> >
> > java.lang.IllegalArgumentException: size is less than 1
> >
> > at
> org.apache.mahout.cf.taste.impl.model.GenericItemPreferenceArray.<init>(
> > GenericItemPreferenceArray.java:49)
> >
> > at
> org.apache.mahout.cf.taste.impl.model.GenericItemPreferenceArray.<init>(
> > GenericItemPreferenceArray.java:56)
> >
> > at
> >
> org.apache.mahout.cf.taste.impl.model.jdbc.AbstractJDBCDataModel.getPreferencesForItem(
> > AbstractJDBCDataModel.java:441)
> >
> > at
> >
> org.apache.mahout.cf.taste.impl.recommender.GenericItemBasedRecommender.doMostSimilarItems(
> > GenericItemBasedRecommender.java:169)
> >
> > at
> >
> org.apache.mahout.cf.taste.impl.recommender.GenericItemBasedRecommender.mostSimilarItems(
> > GenericItemBasedRecommender.java:128)
> >
> > at
> >
> org.apache.mahout.cf.taste.impl.recommender.GenericItemBasedRecommender.mostSimilarItems(
> > GenericItemBasedRecommender.java:121)
> >
> > at net.gamestreamer.recommendation.SimilarItemsFinder.find(
> > SimilarItemsFinder.java:18)
> >
> > at
> >
> net.gamestreamer.recommendation.test.RecommenderTest.testSimilarItemsFinder(
> > RecommenderTest.java:45)
> >
> > at net.gamestreamer.recommendation.test.RecommenderTest.main(
> > RecommenderTest.java:85)
> >
> > =========
> >
> > When create a preference data for the
> item,GenericItemBasedRecommender.mostSimilarItems()
> > works well.
> >
> >
> > On Sun, Sep 26, 2010 at 9:49 PM, Sean Owen <[hidden email]> wrote:
> >
> >> GenericItemBasedRecommender.mostSimilarItems() does not care. It just
> >> uses your ItemSimilarity to do its work.
> >> You'd have to be more specific to get more feedback. Are you sure your
> >> ItemSimilarity is working, not returning NaN?
> >>
> >> On Sun, Sep 26, 2010 at 2:40 PM, Sam Yang <[hidden email]> wrote:
> >> > I have custom implementation of ItemSimilarity.Does
> >> > GenericItemBasedRecommender.mostSimilarItems()
> >> > need preference data?
> >> > I new GenericItemBasedRecommender with the preference data model and
> >> > implementation
> >> > of ItemSimilarity,but seems mostSimilarItems() return no results.
> >>
> >
> >
> >
> > --
> > I'm samsam.
> >
>
>
>
> --
> I'm samsam.
>
Reply | Threaded
Open this post in threaded view
|

Re: get similar items

Sean Owen
In reply to this post by samsam
OK, so that issue was fixed. What is your current issue then?

On Mon, Sep 27, 2010 at 3:37 AM, Sam Yang <[hidden email]> wrote:
> And it's like this issue:   https://issues.apache.org/jira/browse/MAHOUT-367
Reply | Threaded
Open this post in threaded view
|

Re: get similar items

samsam
I still get no results when GenericItemBasedRecommender.mostSimilarItems(),and
my ItemSimilarity works well.
Does GenericItemBasedRecommender.mostSimilarItems() works without preference
data?
Tim said:
"As Sebastian pointed out, you could start out by making recommendations
strictly on content-based similarities (such as the output from a More Like
This query in Lucene) and then introduce recommendations based on
collaborative filtering as your user-item interaction data grows."
Do I get the similar items with other tool.like Lucene,can Mahout do it
without preference data at start?

On Mon, Sep 27, 2010 at 2:59 PM, Sean Owen <[hidden email]> wrote:

> OK, so that issue was fixed. What is your current issue then?
>
> On Mon, Sep 27, 2010 at 3:37 AM, Sam Yang <[hidden email]> wrote:
> > And it's like this issue:
> https://issues.apache.org/jira/browse/MAHOUT-367
>



--
I'm samsam.
Reply | Threaded
Open this post in threaded view
|

Re: get similar items

Sean Owen
Sam I think you'll have to be clearer about what you are doing.

*Nothing* works with *no* data input at all, of course. Your last
question makes me think you are trying to feed no data at all to the
system and expect a result.

"Preferences" here mean something like ratings.  Is that what you
mean? mostSimilarItems() does not deal directly with this data so does
not care. It depends what ItemSimilarity you are using.

If your ItemSimilarity does not work correctly without preference
data, no, mostSimilarItems() won't work. But like we already pointed
out, that would be an issue with your implementation, which you have
not said anything about.

On Mon, Sep 27, 2010 at 8:08 AM, Sam Yang <[hidden email]> wrote:

> I still get no results when GenericItemBasedRecommender.mostSimilarItems(),and
> my ItemSimilarity works well.
> Does GenericItemBasedRecommender.mostSimilarItems() works without preference
> data?
> Tim said:
> "As Sebastian pointed out, you could start out by making recommendations
> strictly on content-based similarities (such as the output from a More Like
> This query in Lucene) and then introduce recommendations based on
> collaborative filtering as your user-item interaction data grows."
> Do I get the similar items with other tool.like Lucene,can Mahout do it
> without preference data at start?
>
> On Mon, Sep 27, 2010 at 2:59 PM, Sean Owen <[hidden email]> wrote:
>
>> OK, so that issue was fixed. What is your current issue then?
>>
>> On Mon, Sep 27, 2010 at 3:37 AM, Sam Yang <[hidden email]> wrote:
>> > And it's like this issue:
>> https://issues.apache.org/jira/browse/MAHOUT-367
>>
>
>
>
> --
> I'm samsam.
>
Reply | Threaded
Open this post in threaded view
|

Re: get similar items

Sebastian Schelter-4
In reply to this post by samsam
I see the problem now.

The estimators (MostSimilarEstimator or MultiMostSimilarEstimator) used
to fetch the most similar items only use the ItemSimilarity
implementation and are therefore not dependent on having preferences.

But the initial set of "candidate" items that will be given to the
estimators in GenericItemBasedRecommender.doMostSimilarItems() is
fetched from the DataModel (it consists of all items preferred by a user
that also preferred the current item), which makes the computation
dependent on preference data being available.

The short term solution would be to subclass GenericItemBasedRecommender
and create your own customized way of candidate item fetching. The long
term solution should be to enable users to customize this like we
already did for recommendation with the CandidateItemsStrategy).

--sebastian

Am 27.09.2010 09:08, schrieb Sam Yang:

> I still get no results when GenericItemBasedRecommender.mostSimilarItems(),and
> my ItemSimilarity works well.
> Does GenericItemBasedRecommender.mostSimilarItems() works without preference
> data?
> Tim said:
> "As Sebastian pointed out, you could start out by making recommendations
> strictly on content-based similarities (such as the output from a More Like
> This query in Lucene) and then introduce recommendations based on
> collaborative filtering as your user-item interaction data grows."
> Do I get the similar items with other tool.like Lucene,can Mahout do it
> without preference data at start?
>
> On Mon, Sep 27, 2010 at 2:59 PM, Sean Owen <[hidden email]> wrote:
>
>  
>> OK, so that issue was fixed. What is your current issue then?
>>
>> On Mon, Sep 27, 2010 at 3:37 AM, Sam Yang <[hidden email]> wrote:
>>    
>>> And it's like this issue:
>>>      
>> https://issues.apache.org/jira/browse/MAHOUT-367
>>
>>    
>
>
>  

Reply | Threaded
Open this post in threaded view
|

Re: get similar items

Sean Owen
Yeah but that doesn't depend on having preference values right?
"Boolean" data works fine.


On Mon, Sep 27, 2010 at 8:23 AM, Sebastian Schelter <[hidden email]> wrote:

> But the initial set of "candidate" items that will be given to the
> estimators in GenericItemBasedRecommender.doMostSimilarItems() is
> fetched from the DataModel (it consists of all items preferred by a user
> that also preferred the current item), which makes the computation
> dependent on preference data being available.
>
> The short term solution would be to subclass GenericItemBasedRecommender
> and create your own customized way of candidate item fetching. The long
> term solution should be to enable users to customize this like we
> already did for recommendation with the CandidateItemsStrategy).
Reply | Threaded
Open this post in threaded view
|

Re: get similar items

Sean Owen
(+user)

Yes, I think that's the question to clarify.
But if an item is brand new and has no data whatsoever, nothing here helps.
You just want to return some generic default list of items.

On Mon, Sep 27, 2010 at 8:30 AM, Sebastian Schelter <[hidden email]> wrote:
> Maybe we misunderstand each other here. I understood Sam's question in a
> way that he needs a solution for the "cold-start problem" where he does
> not have any preferences at all (neither boolean nor numeric).
>
> Sam, what data do you exactly have? Boolean data or no preferences at all?
Reply | Threaded
Open this post in threaded view
|

Re: get similar items

12481228@qq.com
This post has NOT been accepted by the mailing list yet.
In reply to this post by Sean Owen
Hi Sean, you said "It depends what ItemSimilarity you are using. "
what kind of ItemSimilarity can work correctly without preference?

thanks.