https://github.com/lene/tavsiye
A very basic recommendation engine implemented in Python.
https://github.com/lene/tavsiye
Last synced: 5 months ago
JSON representation
A very basic recommendation engine implemented in Python.
- Host: GitHub
- URL: https://github.com/lene/tavsiye
- Owner: lene
- License: gpl-3.0
- Created: 2015-04-08T14:59:46.000Z (about 11 years ago)
- Default Branch: master
- Last Pushed: 2018-03-05T12:20:07.000Z (over 8 years ago)
- Last Synced: 2025-03-21T22:02:58.163Z (over 1 year ago)
- Language: Python
- Homepage:
- Size: 43.9 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
A very basic recommendation engine implemented in Python.
Usage:
`python recommender.py [-h|-f FILENAME|--user USER|--set-comparison SET_COMPARISON|--cutoff CUTOFF]`
Running test suite:
`python test_recommender.py && mypy . && flake8 --max-line-length=100`
Implementation thoughts:
- The entire recommendation algorithm can be found in compare_sets.py.
- I found it useful to plug different algorithms for computing the similarity of sets into the
recommendation engine. The other comparison algorithms can be found in alternative_methods.py.
- In principle, nothing stops you from plugging custom objects as a similarity_matrix into
the similar_users() and recommendations() functions. (I don't supply an example for this though.)
You might want to do that because the similarity_matrix I calculate grows is O(N^2) in the number
of users - in real world settings you'd want to optimize this.
- You have to decide on a numeric value for the similarity of two sets of liked products to
consider two users similar in taste. I plugged that value as parameter 'cutoff' into the relevant
functions.
- I am not sure the MinHash-algorithm I used is stable - I sort of whipped it up. It is hard to
test stochastic algorithms, I considered this outside the scope of this exercise.