Skip to content

Conversation

@sushobhan2024
Copy link
Contributor

@sushobhan2024 sushobhan2024 commented Dec 8, 2025

Issue: #317
Added ILS and tests.

@codecov
Copy link

codecov bot commented Dec 8, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 88.96%. Comparing base (205bb74) to head (cac53cc).
⚠️ Report is 8 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #969      +/-   ##
==========================================
+ Coverage   88.93%   88.96%   +0.03%     
==========================================
  Files         217      218       +1     
  Lines       15045    15089      +44     
==========================================
+ Hits        13380    13424      +44     
  Misses       1665     1665              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@sushobhan2024 sushobhan2024 marked this pull request as ready for review December 8, 2025 21:38
Copy link
Member

@mdekstrand mdekstrand left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the code looks sound, some documentation comments (and we need to fix merge conflicts).

Evaluate recommendation diversity using intra-list similarity (ILS).

This metric measures the average pairwise cosine similarity between item
category vectors in a recommendation list. Lower values indicate more diverse
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ILS should not be limited to category vectors - it should also support arbitrary vectors (which is sort-of already the case, since cat_matrix returns the vectors as-is from sparse and dense attribute vectors), but the documentation should reflect the metric's generality.


Args:
items: Item list to evaluate.
categories: Item * category matrix (dense or sparse), unit-normalized.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Related to the other comment on categories vs. other names, let's call this vectors, and otherwise update the docs to reflect that we use vectors.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Document that the rows of the matrix must be unit-normalized.

@mdekstrand mdekstrand merged commit faa716f into lenskit:main Dec 18, 2025
40 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants