lyst / lyst/lightfm

Auc evalutation return always nan

Open
#702 0 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,

I have an issue when i compute roc auc, ti's return always NAN for all the value in the matrix.
`interactions=interactions.tocsr().astype(np.float32)
user_features=interactions.tocsr().astype(np.float32)
item_features=interactions.tocsr().astype(np.float32)

train, test = random_train_test_split(interactions, test_percentage=0.2, random_state=42)

epochs = 30

# Train model
model = LightFM(loss='bpr', no_components=200, max_sampled=100, learning_schedule='adagrad', item_alpha=1e-6, learning_rate=0.001)

for epoch in range(epochs):
model.fit_partial(train, user_features=user_features, item_features=item_features, num_threads=3, epochs=1)
print(auc_score(model, test, train_interactions = train, user_features=user_features, item_features=item_features, check_intersections=True).mean())`

I check the train and test matrix there is no Null or Nan so I don't understand.
Can you help me on this case.

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 at the auc_score(...) call in the provided Python snippet and reproduce the NaN result with the shown train/test matrices and model settings. Trace the evaluation inputs and consider the issue complete when the cause of the NaN result is identified and a corrective change is documented or validated.

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
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.