You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@predictionio.apache.org by Brian Chiu <br...@snaptee.co> on 2017/09/08 09:20:08 UTC

How to give bias on newer item?

Hi all.

In a recommender, it is quite common to give a higher priority to
newer items.  For example, when User A has created a tweet yesterday
and another tweet today, it is better to recommend the newer one to
the other users (assume the 2 tweets has similar property except
creation date)

Specifically for Universal Recommender, can we set such a bias to new
items?  I have read through the doc and some source code, but the best
option I can find is to set the hard limit "dataRange".  Is it
possible to set a smooth decay to the bias?  Or can I modify the
source code to achieve this functionality?

I notice that elasticsearch has an option function_score query:
  https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-function-score-query.html
Which seems to offer a smooth decay of bias, but I have no idea if it
can be integrated to Universal Recommender and solve the problem.  Can
anyone point out if it looks feasible?

And I also notice that in some old version of PredictionIO, there was
a parameter called freshness.

See this commit:
https://github.com/apache/incubator-predictionio/commit/4bebe7855767532fd4d2660548d32ab1581270d8
And this blog on freshness:
http://blog.monokkel.io/introduction-to-predictionio-by-example/

Is "freshness" now removed?

Sorry for asking so many question at a time.  The community here is great.
Thanks in advance!

Best,
Brain

Re: How to give bias on newer item?

Posted by Brian Chiu <br...@snaptee.co>.
Thanks for the detailed response!  It is very helpful.
2017年9月8日 下午11:42 於 "Pat Ferrel" <pa...@occamsmachete.com> 寫道:

> With the Universal Recommender there are a robust set of business rules
> including boosting by item properties. If you add a year+week to every
> item, then in the query you boost items from a range of weeks by differing
> amounts you can implement any “decay function you want without modifying
> code. There are many ways to set this up to get the granularity you want.
>
> I always strongly recommend that you get cross-validation or A/B tests
> with and without and with this type of business rule modification of
> results. The UR will automatically recommend things based on the user’s
> most recent behavior so biasing by date may not provide lift in results.
> Comparing the raw results to your bias will tell you what you want to know
> and give you a baseline to improve from. If you never test raw results you
> will never know for sure that you are improving.
>
> We had a client who insisted on some very complex business rules because
> they had been doing something similar in the past and we got virtually 0
> lift over no recommendations (curated recommendations). We convinced them
> to try without the rules and got a huge improvement. You may not see the
> same thing but testing will tell.
>
>
> On Sep 8, 2017, at 2:20 AM, Brian Chiu <br...@snaptee.co> wrote:
>
> Hi all.
>
> In a recommender, it is quite common to give a higher priority to
> newer items.  For example, when User A has created a tweet yesterday
> and another tweet today, it is better to recommend the newer one to
> the other users (assume the 2 tweets has similar property except
> creation date)
>
> Specifically for Universal Recommender, can we set such a bias to new
> items?  I have read through the doc and some source code, but the best
> option I can find is to set the hard limit "dataRange".  Is it
> possible to set a smooth decay to the bias?  Or can I modify the
> source code to achieve this functionality?
>
> I notice that elasticsearch has an option function_score query:
>  https://www.elastic.co/guide/en/elasticsearch/reference/
> current/query-dsl-function-score-query.html
> Which seems to offer a smooth decay of bias, but I have no idea if it
> can be integrated to Universal Recommender and solve the problem.  Can
> anyone point out if it looks feasible?
>
> And I also notice that in some old version of PredictionIO, there was
> a parameter called freshness.
>
> See this commit:
> https://github.com/apache/incubator-predictionio/commit/
> 4bebe7855767532fd4d2660548d32ab1581270d8
> And this blog on freshness:
> http://blog.monokkel.io/introduction-to-predictionio-by-example/
>
> Is "freshness" now removed?
>
> Sorry for asking so many question at a time.  The community here is great.
> Thanks in advance!
>
> Best,
> Brain
>
>

Re: How to give bias on newer item?

Posted by Pat Ferrel <pa...@occamsmachete.com>.
With the Universal Recommender there are a robust set of business rules including boosting by item properties. If you add a year+week to every item, then in the query you boost items from a range of weeks by differing amounts you can implement any “decay function you want without modifying code. There are many ways to set this up to get the granularity you want.

I always strongly recommend that you get cross-validation or A/B tests with and without and with this type of business rule modification of results. The UR will automatically recommend things based on the user’s most recent behavior so biasing by date may not provide lift in results. Comparing the raw results to your bias will tell you what you want to know and give you a baseline to improve from. If you never test raw results you will never know for sure that you are improving. 

We had a client who insisted on some very complex business rules because they had been doing something similar in the past and we got virtually 0 lift over no recommendations (curated recommendations). We convinced them to try without the rules and got a huge improvement. You may not see the same thing but testing will tell.


On Sep 8, 2017, at 2:20 AM, Brian Chiu <br...@snaptee.co> wrote:

Hi all.

In a recommender, it is quite common to give a higher priority to
newer items.  For example, when User A has created a tweet yesterday
and another tweet today, it is better to recommend the newer one to
the other users (assume the 2 tweets has similar property except
creation date)

Specifically for Universal Recommender, can we set such a bias to new
items?  I have read through the doc and some source code, but the best
option I can find is to set the hard limit "dataRange".  Is it
possible to set a smooth decay to the bias?  Or can I modify the
source code to achieve this functionality?

I notice that elasticsearch has an option function_score query:
 https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-function-score-query.html
Which seems to offer a smooth decay of bias, but I have no idea if it
can be integrated to Universal Recommender and solve the problem.  Can
anyone point out if it looks feasible?

And I also notice that in some old version of PredictionIO, there was
a parameter called freshness.

See this commit:
https://github.com/apache/incubator-predictionio/commit/4bebe7855767532fd4d2660548d32ab1581270d8
And this blog on freshness:
http://blog.monokkel.io/introduction-to-predictionio-by-example/

Is "freshness" now removed?

Sorry for asking so many question at a time.  The community here is great.
Thanks in advance!

Best,
Brain