How to build a simple recommendation system? I have seen some algorithms but it is so difficult to implement I wish their is practical description to implement the most simple algorithm?
i have these three tables
Users
userid username
1 aaa
2 bbb
and
products
productid productname
1 laptop
2 mobile phone
3 car
and
users_products
userid productid
1 1
1 3
3 2
2 3
so I want to be able recommend items for each of the users depending on the items they purchased and other users' items
I knew it should something like calculating the similarites between users and then see their prosucts but how can be this done and stored in a database because this will require a table with something like this
1 2 3 4 5 6 << users' ids
1) 1 .4 .2 .3 .8 .4
2) .3 1 .5 .7 .3 .9
3) .4 .4 1 .8 .2 .3
4) .6 .6 .6 1 .4 .2
5) .8 .7 .4 .2 1 .3
6) 1 .4 .6 .7 .9 1
^
^
users'
ids
so how can similarty beween users calculated? and how could this complex data stored in ad database? (it requires a table with column for every user)? thanks
How you want to actually store the recommendations is as a question completely unrelated to how one would actually implement a recommendation engine. I leave that to your database architecture. On to the recommending.
You said "simple", so a Pearson correlation coefficient might be the thing you need to read up on.
Calculating such a thing is dead simple. Concept, example code.
Maybe reading "Programming Collective Intelligence" will help you.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With