How to validate the Dataset.mapping
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 5.1k
- Forks
- 724
- PR merge metrics
- No merged PRs in 30d
Description
Using the same example from https://making.lyst.com/lightfm/docs/examples/dataset.html#building-the-id-mappings
How could I validade the mapping of each item feature?
When I call ```user_id_map, u_f_map, item_id_map, i_f_map = dataset.mapping()```
after this
```item_features = dataset.build_item_features(((x['ISBN'], [x['Book-Author']]) for x in get_book_features()))```
I got this result from item_id_map
```
{'034545104X': 0,
'0155061224': 1,
'0446520802': 2,
'052165615X': 3...}
```
Now, I know that '034545104X' is mapped as 0. Looking at item_features built before I got this
```
(0, 0) 0.5
(0, 343789) 0.5
(1, 1) 0.5
(1, 428522) 0.5
(2, 2) 0.5
(2, 341954) 0.5
(3, 3) 0.5 .......
```
Looking at ```book_features``` as a pandas dataframe

As seen, getting the item mapped as 0 which is the item 034545104X. And filtering the dataframe, for this item, the book-author is `Flesh Tones: A Novel`
But When I do this
```
item_feature_inverse_map = {v:k for k, v in i_f_map.items()}
print(item_feature_inverse_map[343789])
```
The result is `'M. J. Rose'` which is different of `Flesh Tones: A Novel`.
Contributor guide
No contributing guide indexed for this repository
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.
Research direction
Start with the Dataset.mapping() and build_item_features() entry points, using the linked dataset example as the initial reference. Trace how item IDs and item-feature IDs are assigned, then document or clarify the expected inverse mapping behavior and validate it against the reported ISBN and author values.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- data, machine-learning
- Issue type
- Documentation
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 25/100