ValueError: Sample weight and interaction matrix entries must be in the same order
- Dominant language
- Python
- Stars
- 5.1k
- Forks
- 724
- PR merge metrics
- No merged PRs in 30d
Description
I am really new to using lightFM and can't seem to figure out how to debug this error.
Attaching the code snippet :
interactions, weights = dataset.build_interactions(user_item_interactions['user_item_count'])
train, test = random_train_test_split(interactions, test_percentage = 0.2)
from lightfm import LightFM
model = LightFM(
no_components=350,
learning_rate=0.05,
loss='warp')
model.fit(
train,
item_features=item_features,
sample_weight = weights,
epochs=5, num_threads=4, verbose=True)
I do not get this error if I fit the whole interaction matrix instead of the train, test split.
Thanks.
Contributor guide
No contributing guide indexed for this repository
Research direction
Start by reproducing the snippet with LightFM's dataset.build_interactions, random_train_test_split, and model.fit entry points, comparing the full interaction matrix with the split matrices. Trace how the interaction and sample-weight entries are aligned, then make the failure mode and supported behavior clear in the relevant issue or documentation.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- machine-learning
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100