Computing ranks from predictions
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 5.1k
- Forks
- 724
- PR merge metrics
- No merged PRs in 30d
Description
Hello, I'm trying to compute the ranks matrix from the model predictions. using the function below
` mask = ~test_interactions.A.astype(bool)
predictions = model.predict(user_ids, item_ids)
ranks_array = predictions.copy()
argsorts = np.argsort(ranks_array, axis=1)
rankings = range(argsorts.shape[1])[::-1]
for i in range(ranks_array.shape[0]):
ranks_array[i, argsorts[i]] = rankings
ranks_array[mask] = 0
return sparse.csr_matrix(ranks_array)`
When I compare the obtained ranks with the obtained ones from model.predict_rank() I dont get the same ranks.
What am I doing wrong? Can you help please Thank you
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 by reading the model.predict() and model.predict_rank() entry points, then compare their ranking behavior with the supplied NumPy sorting code. Reproduce the mismatch using the shown inputs and determine which rank semantics differ; done means the discrepancy is explained and the expected behavior is documented or covered by a regression test.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- numpy, python
- Domain
- machine-learning
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100