How to build a recommender system?

Posted by:
**
Pir
**

Date: April 23, 2019 11:43PM

Is there steps or theory to build a recommender systems? Any books, PPT or tutorial?

Posted by:
**
webmasterphilfv
**

Date: April 24, 2019 07:35AM

This is a good book:

Recommender Systems: The Textbook - Charu Aggarwal

It introduces the main concepts of recommender systems.

Recommender Systems: The Textbook - Charu Aggarwal

It introduces the main concepts of recommender systems.

Posted by:
**
LSatterfield
**

Date: April 24, 2019 12:06PM

There are many types of recommendations that you may want to make. The type that is most obviously applicable to SPMF is called item to item recommendations. You can think of this like cross-sell. If you land on a page for product A recommendation might be for items that sell well with product A. This is what is described in the association rules section of SPMF.

Otherwise, to my knowledge, most companies do not use data mining. Modern techniques are often built using neural networks. If you would like to see some basic recommender system implementations, I recommend reading through the Lightfm and Spotlight implementations in python (linked below). Lightfm uses matrix decomposition to find similar items and users, while spotlight (same author) uses deep neural networks to identify common purchasing sequences. A good basic article on building one of these systems from scratch is the deep beers medium article:

https://medium.com/data-from-the-trenches/deep-beers-playing-with-deep-recommendation-engines-using-keras-part-1-1efc4779568f

Lightfm:

https://github.com/lyst/lightfm

Spotlight:

https://github.com/maciejkula/spotlight

Otherwise, to my knowledge, most companies do not use data mining. Modern techniques are often built using neural networks. If you would like to see some basic recommender system implementations, I recommend reading through the Lightfm and Spotlight implementations in python (linked below). Lightfm uses matrix decomposition to find similar items and users, while spotlight (same author) uses deep neural networks to identify common purchasing sequences. A good basic article on building one of these systems from scratch is the deep beers medium article:

https://medium.com/data-from-the-trenches/deep-beers-playing-with-deep-recommendation-engines-using-keras-part-1-1efc4779568f

Lightfm:

https://github.com/lyst/lightfm

Spotlight:

https://github.com/maciejkula/spotlight

Posted by:
**
LSatterfield
**

Date: June 03, 2019 01:14PM

I know this thread is dead but I have one other thought if anyone stumbles upon this in the future.

I have applied a very basic recommender using association rules is to take a list of transactions in a database, and a list of rules. Build a Trie out of the rule's ordered antecedent. When the Trie is evaluated it should return the consequent and interest metric for each node at that point in the trie. Then take an ordered transaction and recursively walk down the trie returning all rules that are subsets of that transaction. For instance, if I had rules

rule1 {1,2} -> 7, Interest: 1.4 and

rule2 {1} -> 3, Interest: 1.1

rule3 {1,2,3}->4, Interest: 1.01

rule4 {2} ->6, Interest: 1.9

and a transaction {1,2}

The Trie would look approximately like this

{{{{1:3,1.4},2:7,1.1},3:4,1.01},{2:6,1.9}}

So evaluation of the transaction would be as follows.

Iteration: 1 Item = 1, Recursion Depth:0 (from transaction item 1)

Returns '3, 1.4' (1.1 is the interest metric, 3 is the item number)

Iteration: 1 Item = 2, Recursion Depth: 1

Returns '7, 1.1'

Iteration: 2 Item = 2, Recursion Depth:0

Returns '6, 1.9'

Sort according to the interest metric of choice.

Final Recommendations {6,3,7}

If you also include an interest metric like lift, confidence, conviction, etc. then you can return this as well and rank the returned items like 6>3>7. Obviously, this won't work in all cases but the Trie is fast to evaluate and build. It may suit your needs as a limited form of recommender.

If you have a very small number of transactions and rules then a simple check if a rule is a subset of the transaction should be sufficient. Otherwise, the best case complexity is unfriendly for quick evaluation and a trie will speed this up considerably.

I have applied a very basic recommender using association rules is to take a list of transactions in a database, and a list of rules. Build a Trie out of the rule's ordered antecedent. When the Trie is evaluated it should return the consequent and interest metric for each node at that point in the trie. Then take an ordered transaction and recursively walk down the trie returning all rules that are subsets of that transaction. For instance, if I had rules

rule1 {1,2} -> 7, Interest: 1.4 and

rule2 {1} -> 3, Interest: 1.1

rule3 {1,2,3}->4, Interest: 1.01

rule4 {2} ->6, Interest: 1.9

and a transaction {1,2}

The Trie would look approximately like this

{{{{1:3,1.4},2:7,1.1},3:4,1.01},{2:6,1.9}}

So evaluation of the transaction would be as follows.

Iteration: 1 Item = 1, Recursion Depth:0 (from transaction item 1)

Returns '3, 1.4' (1.1 is the interest metric, 3 is the item number)

Iteration: 1 Item = 2, Recursion Depth: 1

Returns '7, 1.1'

Iteration: 2 Item = 2, Recursion Depth:0

Returns '6, 1.9'

Sort according to the interest metric of choice.

Final Recommendations {6,3,7}

If you also include an interest metric like lift, confidence, conviction, etc. then you can return this as well and rank the returned items like 6>3>7. Obviously, this won't work in all cases but the Trie is fast to evaluate and build. It may suit your needs as a limited form of recommender.

If you have a very small number of transactions and rules then a simple check if a rule is a subset of the transaction should be sufficient. Otherwise, the best case complexity is unfriendly for quick evaluation and a trie will speed this up considerably.