You create the indicator and cross-indicator matrices with —omitStrength then 
if you are using a database with solr or elasticsearch you will create a table:

item ID, list of indicator Item IDs, list of cross-indicator item IDs

3 columns. All IDs will be like “nexus” in the example—they are your 
application’s item IDs. The second and third column contain lists of item IDs. 
There are several ways you can do this either by using a multi-valued field 
(array of IDs) or a space delimited string depending on how you want to 
integrate with your search engine and database. Check the instructions for your 
particular search engine.

At the time you want to recommend, take the user’s history of the primary 
action (purchase in the example) and map it to the "list of indicator Item IDs” 
field. Take the user’s history of the secondary action (view in the example) 
and map it to the "list of cross-indicator Item IDs” field. Then perform the 
search engine query and you’ll get back a list of item IDs to recommend. Filter 
out any items that the user has in their history (if you wish) and recommend 
the items in the order they were returned

This blog explains more:
http://occamsmachete.com/ml/2014/09/09/mahout-on-spark-whats-new-in-recommenders-part-2/

Ted’s book gives an example architecture:
https://www.mapr.com/practical-machine-learning
 
On Sep 18, 2014, at 10:00 AM, pol <[email protected]> wrote:

Hi, All
        I saw spark-itemsimilarity doc at 
http://mahout.apache.org/users/recommender/intro-cooccurrence-spark.html, but I 
don’t understand how can creating a recommender by spark-itemsimilarity? I 
don’t understand "3 Creating a Recommender" chapter.
For input of the form:
u1,purchase,iphone
u1,purchase,ipad
u2,purchase,nexus
u2,purchase,galaxy
u3,purchase,surface
u4,purchase,iphone
u4,purchase,galaxy
u1,view,iphone
u1,view,ipad
u1,view,nexus
u1,view,galaxy
u2,view,iphone
u2,view,ipad
u2,view,nexus
u2,view,galaxy
u3,view,surface
u3,view,nexus
u4,view,iphone
u4,view,ipad
u4,view,galaxy
output
out-path
 |-- indicator-matrix - TDF part files
 \-- cross-indicator-matrix - TDF part-files
The indicator matrix will contain the lines:
galaxy\tnexus:1.7260924347106847
ipad\tiphone:1.7260924347106847
nexus\tgalaxy:1.7260924347106847
iphone\tipad:1.7260924347106847
surface
The cross-indicator matrix will contain:
iphone\tnexus:1.7260924347106847 iphone:1.7260924347106847 
ipad:1.7260924347106847 galaxy:1.7260924347106847
ipad\tnexus:0.6795961471815897 iphone:0.6795961471815897 
ipad:0.6795961471815897 galaxy:0.6795961471815897
nexus\tnexus:0.6795961471815897 iphone:0.6795961471815897 
ipad:0.6795961471815897 galaxy:0.6795961471815897
galaxy\tnexus:1.7260924347106847 iphone:1.7260924347106847 
ipad:1.7260924347106847 galaxy:1.7260924347106847
surface\tsurface:4.498681156950466 nexus:0.6795961471815897
————----
Now,u4 view nexus, how to recommend for u4 by the above of output?

Thanks.





Reply via email to