https://github.com/jbochi/facts
Matrix Factorization based recsys in Golang. Because facts are more important than ever
https://github.com/jbochi/facts
implicit implicit-feedback matrix-factorization recommender-system
Last synced: 10 months ago
JSON representation
Matrix Factorization based recsys in Golang. Because facts are more important than ever
- Host: GitHub
- URL: https://github.com/jbochi/facts
- Owner: jbochi
- License: mit
- Created: 2017-08-04T19:12:42.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2018-02-22T20:45:36.000Z (almost 8 years ago)
- Last Synced: 2024-06-20T02:12:10.712Z (over 1 year ago)
- Topics: implicit, implicit-feedback, matrix-factorization, recommender-system
- Language: Go
- Size: 10.7 KB
- Stars: 34
- Watchers: 4
- Forks: 4
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# facts
[](https://travis-ci.org/jbochi/facts)
Matrix Factorization based recommender system in Go. Because **facts** are more important than ever.
This project provides a `vectormodel` package that can be used to serve real time recommendations. First of all, you will need to train a model to get document embeddings or latent **fact**ors. I highly recommend the [implicit](https://github.com/benfred/implicit) library for that. Once you have the documents as a map of `int` ids to arrays of `float64`, you can create the vector model by calling:
`model, err := NewVectorModel(documents map[int][]float64, confidence, regularization float64)`
And to generate recommendations call `.Recommend` with a set of items the user has seen:
`recs := model.Recommend(seenDocs *map[int]bool, n int)`
Note that user vectors are not required. Matter of fact, you can use this to recommend documents to users that were *not* in the training set. The recommendations will be computed very efficiently (probably <1ms, depends on your model size) in real time.
Check out the [demo](https://github-recs.appspot.com/) for a complete example that recommends GitHub repositories.
Demo source code is available here: https://github.com/jbochi/github-recs