Dataset `update_interactions` method
Nobody has claimed this yet.
Assessment
- Difficulty
- 5/5
- Estimated time
- Over a week
- Newbie friendliness
- 25/100
- Issue type
- Feature
- Clarity
- Needs clarification
- Activity status
- Stale
- Domain
- data, machine-learning
Research direction
Read the discussion in issue #176 and review the Dataset implementation to understand how interactions, user and item ID maps, and feature rows are represented. Decide the intended API and whether to implement add or replace; the issue leaves both the method name and first release scope open. Done means interaction updates preserve the required ID map and feature row ordering, with behavior for duplicate pairs defined.
Written by the indexing model from the issue text.
Description
Feature Description
Draft functionality (to be discussed):
update_interactions method of the Dataset accepts:
interactions_df : pd.DataFramemethod: tp.Literal["add", "replace"]
The main goal is to get old dataset id maps, extend them to new users and items. Then convert new interactions to internal ids and append those new interactions to the old ones.
We have one very important thing to remember: dataset id_map always has hot users (who have interactions) before warm users (who don't have interactions but have features). New hot users should start from the last id that was relevant for the old hot users.
But previously these id belonged to warm users. So warm users will have their ids changed. So user_features array should also be changed. Row numbers in user_features correspond to internal user ids.
Same for items.
In the first PR we can implement just one of the methods.
"add" method should just append new interactions to the old ones. (duplicate user-item pairs will have multiple entries, this will result in their weights summed in user-item matrix)
"replace" method should remove old interactions.
Why this feature?
This allows for incremental training for models that support fit_partial.
Additional context
Discussed here: https://github.com/MobileTeleSystems/RecTools/issues/176
Updating user and item features should be done in next PRs.
Maybe we should call this method update_data or smth like that to create only one method for interactions and features with optional arguments.
To be discussed
- Dominant language
- Python
- Stars
- 457
- Forks
- 55
- PR merge metrics
- No merged PRs in 30d
Getting set up
- No Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from MTSWebServices/RecTools
-
good first issue
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
MTSWebServices/RecTools#330 ·
-
Is it not possible to `load` transformer model on cpu onlyPossibly taken @maxteneff claimed this 22 days ago. Openbug good first issue
Difficulty 3/5 1-2 days Newbie friendliness 35/100
MTSWebServices/RecTools#286 · 3 comments ·
-
bug good first issue
Difficulty 2/5 1-3 hours Newbie friendliness 35/100
MTSWebServices/RecTools#269 · 4 comments ·
-
enhancement
Difficulty 5/5 Over a week Newbie friendliness 25/100
MTSWebServices/RecTools#249 ·
-
enhancement
Difficulty 5/5 Over a week Newbie friendliness 25/100
MTSWebServices/RecTools#243 ·
All issues in MTSWebServices/RecTools
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 83/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 87/100
Maintainers usually reply within 7 days
-
area: web priority: P1 story
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
nfiasco/Quant-Time-Machine#151 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
autowarefoundation/autoware_carla_scenario#2019 ·
Maintainers usually reply within 1 day
-
docs pydanty:is-working
Difficulty 1/5 1-3 hours Newbie friendliness 85/100
pydantic/pydantic-ai#12892 ·
Maintainers usually reply within 1 day