lyst / lyst/lightfm

Error build_user_features.

Open
#435 13 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
5.1k
Forks
724
PR merge metrics
No merged PRs in 30d

Description

Hello, im trying to create an user_feature matrix but i cant.

data = Dataset()
data.fit(users.user_id.unique(),items.movie_id.unique())

ad_subset = users[["sex_F", 'age','occupation_administrator']]
ad_list = [list(x) for x in ad_subset.values]
ad_tuple = tuple(zip(users['user_id'], ad_list))

user_features = data.build_user_features(ad_tuple)

I excetude the last code but i got this error

File "C:\ProgramData\Anaconda3\lib\site-packages\lightfm\data.py", line 101, in _process_features
"Feature {} not in eature mapping. " "Call fit first.".format(feature)

ValueError: Feature 0 not in eature mapping. Call fit first.

Can anybody help please?
Thanks!

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with lightfm/data.py, especially build_user_features and _process_features, and review the reported call using Dataset.fit and the user feature tuples. Reproduce the ValueError with the example data, then determine whether the behavior is a library bug or an input/documentation issue; done requires a confirmed cause and a clear resolution path.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
machine-learning
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
20/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.