Comments (1)
Everything seems to be working pretty well for algorithms that randomize some part of their training - we can provide a seed, and it works.
What isn't quite there is support for algorithms that randomize in their recommendations or predictions. Right now, randomization is unpredictable, particularly in the case of parallel batch recommendation.
To make algorithms with random recommendations reproducible, I propose to leverage NumPy's flexible SeedSequence. If the user instantiates Random
with rng='user'
, then it will:
- Spawn a child of the global seed sequence and save it for later use
- For each recommendation request, spawn a child of that sequence with the user ID as the next element of the spawn key, and use it to initialize an RNG to randomize the recommendations
This will achieve two things:
- Recommendations will be unpredictable per-user - by the time the user ID is mixed into the entropy, and the result used to seed a PRNG, the resulting bitstream is difficult to predict
- The same initial seed and the same user ID will produce the same recommendation list, regardless of parallelism or subprocess computations.
Experiment designs that require multiple recommendation lists per user may have a problem. If @kluver or @KimuraTian (or anyone else) has thoughts here, would love to hear them before doing this.
from lkpy.
Related Issues (20)
- include_missing fails in a few cases
- Parallel processing locks when the OOM killer comes for a worker HOT 1
- Split parallel code into separate project
- nDCG metric does not correctly truncate lists HOT 4
- lenskit-implicit install doesn't work HOT 2
- Add popularity metrics
- Add intra-list similarity diversity metric
- Add topical how-to guides to the manual
- Update to support Numba 0.56
- Backport build updates to 0.14 branch HOT 1
- Allow rng specification when partitions is None in crossfold.sample_rows HOT 1
- Best set up for MovieLens1M
- Drop Python before 3.10
- Replace Numba with Python + Cython
- Small bug while importing `TopN`
- Migrate LensKit to P2C
- Migrate LensKit to setuptools HOT 2
- Reformat LensKit with Ruff
- Drop legacy compat shims for SeedBank HOT 1
- Add explicit user-item matrix class
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from lkpy.